forked from Upstream/mmocore
!Fixed ChatInput eventHandler leak
This commit is contained in:
parent
2a64aae0f4
commit
2d032b2483
@ -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()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user