mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
[Bleeding] Add missing methods to Bukkit class, fix non-static methods, and add a junit test to ensure both these problems will be caught in future.
By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
19
paper-api/src/test/java/org/bukkit/BukkitMirrorTest.java
Normal file
19
paper-api/src/test/java/org/bukkit/BukkitMirrorTest.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package org.bukkit;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class BukkitMirrorTest {
|
||||
@Test
|
||||
public final void test() throws NoSuchMethodException {
|
||||
Method[] serverMethods = Server.class.getDeclaredMethods();
|
||||
for(Method method : serverMethods) {
|
||||
Method mirrorMethod = Bukkit.class.getDeclaredMethod(method.getName(), method.getParameterTypes());
|
||||
assertTrue("Bukkit." + method.getName() + " must be static!", Modifier.isStatic(mirrorMethod.getModifiers()));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user