mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 17:37:42 +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;
|
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,
|
public static <T extends EventTrait, E> EventNode<T> conditional(Class<T> eventType,
|
||||||
Class<E> handlerType,
|
Class<E> handlerType,
|
||||||
Predicate<E> predicate) {
|
Predicate<E> predicate) {
|
||||||
return new EventNode<>();
|
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) {
|
public static <T extends EventTrait> EventNode<T> unique(Class<T> eventType, EventHandler handler) {
|
||||||
return new EventNode<>();
|
return new EventNode<>();
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ public class PlayerInit {
|
|||||||
|
|
||||||
// EVENT REGISTERING
|
// EVENT REGISTERING
|
||||||
|
|
||||||
var node = EventNode.create(PlayerEvent.class);
|
var node = EventNode.conditional(PlayerEvent.class);
|
||||||
node.addListener(EventListener.of(PlayerTickEvent.class)
|
node.addListener(EventListener.of(PlayerTickEvent.class)
|
||||||
.handler(playerTickEvent -> System.out.println("Player tick!"))
|
.handler(playerTickEvent -> System.out.println("Player tick!"))
|
||||||
.build());
|
.build());
|
||||||
|
Loading…
Reference in New Issue
Block a user