Rename create method

This commit is contained in:
TheMode 2021-06-02 08:59:46 +02:00
parent f88a2f3883
commit 52547c5bd6
2 changed files with 5 additions and 5 deletions

View File

@ -15,16 +15,16 @@ public class EventNode<T extends EventTrait> {
return null;
}
public static <T extends EventTrait> EventNode<T> create(Class<T> eventType) {
return new EventNode<>();
}
public static <T extends EventTrait, E> EventNode<T> conditional(Class<T> eventType,
Class<E> handlerType,
Predicate<E> predicate) {
return new EventNode<>();
}
public static <T extends EventTrait> EventNode<T> conditional(Class<T> eventType) {
return new EventNode<>();
}
public static <T extends EventTrait> EventNode<T> unique(Class<T> eventType, EventHandler handler) {
return new EventNode<>();
}

View File

@ -137,7 +137,7 @@ public class PlayerInit {
// EVENT REGISTERING
var node = EventNode.create(PlayerEvent.class);
var node = EventNode.conditional(PlayerEvent.class);
node.addListener(EventListener.of(PlayerTickEvent.class)
.handler(playerTickEvent -> System.out.println("Player tick!"))
.build());