From 46d2542d59bb89a25deaabd5bbc4ef55883a80ef Mon Sep 17 00:00:00 2001 From: TheMode Date: Thu, 19 Aug 2021 22:53:20 +0200 Subject: [PATCH] Rename EventListener#eventType --- src/main/java/net/minestom/server/event/EventListener.java | 4 ++-- src/main/java/net/minestom/server/event/EventNodeImpl.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/minestom/server/event/EventListener.java b/src/main/java/net/minestom/server/event/EventListener.java index 83271d2ff..7dc6a0bd5 100644 --- a/src/main/java/net/minestom/server/event/EventListener.java +++ b/src/main/java/net/minestom/server/event/EventListener.java @@ -19,7 +19,7 @@ import java.util.function.Predicate; */ public interface EventListener { - @NotNull Class getEventType(); + @NotNull Class eventType(); @NotNull Result run(@NotNull T event); @@ -122,7 +122,7 @@ public interface EventListener { final var handler = this.handler; return new EventListener<>() { @Override - public @NotNull Class getEventType() { + public @NotNull Class eventType() { return eventType; } diff --git a/src/main/java/net/minestom/server/event/EventNodeImpl.java b/src/main/java/net/minestom/server/event/EventNodeImpl.java index 0805d605b..f4c2dd926 100644 --- a/src/main/java/net/minestom/server/event/EventNodeImpl.java +++ b/src/main/java/net/minestom/server/event/EventNodeImpl.java @@ -172,7 +172,7 @@ class EventNodeImpl implements EventNode { @Override public @NotNull EventNode addListener(@NotNull EventListener listener) { synchronized (GLOBAL_CHILD_LOCK) { - final var eventType = listener.getEventType(); + final var eventType = listener.eventType(); var entry = getEntry(eventType); entry.listeners.add((EventListener) listener); propagateEvent(eventType); @@ -183,7 +183,7 @@ class EventNodeImpl implements EventNode { @Override public @NotNull EventNode removeListener(@NotNull EventListener listener) { synchronized (GLOBAL_CHILD_LOCK) { - final var eventType = listener.getEventType(); + final var eventType = listener.eventType(); var entry = listenerMap.get(eventType); if (entry == null) return this; var listeners = entry.listeners;