mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 01:17:47 +01:00
Rename create method
This commit is contained in:
parent
f88a2f3883
commit
52547c5bd6
@ -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<>();
|
||||
}
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user