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