!Fixed ChatInput eventHandler leak

This commit is contained in:
Indyuce 2020-04-25 16:58:59 +02:00
parent 2a64aae0f4
commit 2d032b2483

View File

@ -22,6 +22,7 @@ public class ChatInput extends PlayerInput {
@Override
public void close() {
AsyncPlayerChatEvent.getHandlerList().unregister(this);
InventoryOpenEvent.getHandlerList().unregister(this);
}
@EventHandler(priority = EventPriority.LOWEST)
@ -30,7 +31,7 @@ public class ChatInput extends PlayerInput {
close();
event.setCancelled(true);
if(!event.getMessage().equals("cancel"))
if (!event.getMessage().equals("cancel"))
Bukkit.getScheduler().scheduleSyncDelayedTask(MMOCore.plugin, () -> output(event.getMessage()));
}
}