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
|
@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()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user