mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 17:37:42 +01:00
Introduce EventNode
This commit is contained in:
parent
2d8474282b
commit
77f74bb7dc
37
src/main/java/net/minestom/server/event/EventNode.java
Normal file
37
src/main/java/net/minestom/server/event/EventNode.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package net.minestom.server.event;
|
||||||
|
|
||||||
|
import net.minestom.server.event.handler.EventHandler;
|
||||||
|
import net.minestom.server.event.trait.EventTrait;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
public class EventNode<T extends EventTrait> {
|
||||||
|
|
||||||
|
private EventNode() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EventNode<?> create() {
|
||||||
|
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> unique(Class<T> eventType, EventHandler handler) {
|
||||||
|
return new EventNode<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addListener(EventListener<? extends T> listener) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public <E extends Event> void addListener(Class<E> eventClass, Consumer<E> listener) {
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user