Update to Spigot 1.18 api

+ Add legacy jar for 1.17 and previous
This commit is contained in:
Gabriele C
2021-11-28 18:17:10 +01:00
parent c4534e9546
commit b74496fb15
3 changed files with 32 additions and 22 deletions
@@ -2,7 +2,6 @@ package fr.xephi.authme.events;
import fr.xephi.authme.ClassCollector;
import fr.xephi.authme.TestHelper;
import org.apache.commons.lang.reflect.MethodUtils;
import org.bukkit.event.Event;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -49,7 +48,11 @@ public class EventsConsistencyTest {
@Test
public void shouldHaveStaticEventHandlerMethod() {
for (Class<?> clazz : classes) {
Method handlerListMethod = MethodUtils.getAccessibleMethod(clazz, "getHandlerList", new Class<?>[]{});
Method handlerListMethod = null;
try {
handlerListMethod = clazz.getMethod("getHandlerList");
} catch (NoSuchMethodException ignored) {
}
if (canBeInstantiated(clazz)) {
assertThat("Class " + clazz.getSimpleName() + " has static method getHandlerList()",
handlerListMethod != null && Modifier.isStatic(handlerListMethod.getModifiers()), equalTo(true));