mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 01:17:47 +01:00
Do not reuse node objects
This commit is contained in:
parent
12c620df7a
commit
bdfa164695
@ -23,16 +23,14 @@ public class EventNode<T extends Event> {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final EventNode<Event> EMPTY = new EventNode<>(Event.class);
|
|
||||||
|
|
||||||
public static EventNode<Event> create() {
|
|
||||||
return EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <E extends Event> EventNode<E> create(@NotNull Class<E> type) {
|
public static <E extends Event> EventNode<E> create(@NotNull Class<E> type) {
|
||||||
return new EventNode<>(type);
|
return new EventNode<>(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EventNode<Event> create() {
|
||||||
|
return create(Event.class);
|
||||||
|
}
|
||||||
|
|
||||||
public static <E extends Event> EventNode<E> conditional(@NotNull Class<E> type,
|
public static <E extends Event> EventNode<E> conditional(@NotNull Class<E> type,
|
||||||
@NotNull Predicate<E> predicate) {
|
@NotNull Predicate<E> predicate) {
|
||||||
return new EventNodeConditional<>(type, predicate);
|
return new EventNodeConditional<>(type, predicate);
|
||||||
|
Loading…
Reference in New Issue
Block a user