This commit is contained in:
YuTian 2024-08-08 05:00:46 +08:00
parent bd2ef8d853
commit 109845d5e4

View File

@ -22,6 +22,7 @@ public class PlayerChatInputListener extends IListener {
event.setCancelled(true);
String string = event.getMessage();
Player player = event.getPlayer();
Bukkit.getScheduler().runTask(ElementOriginLib.inst(), ()-> {
PlayerChatInput playerInput = PlayerChatInputManager.getInput(player);
if (string.toLowerCase().trim().equalsIgnoreCase("取消") || string.toLowerCase().trim().equalsIgnoreCase("none") || string.toLowerCase().trim().equalsIgnoreCase("cancle")) {
playerInput.cancle();
@ -29,10 +30,11 @@ public class PlayerChatInputListener extends IListener {
player.sendMessage("playerchatinput.cancle");
return;
}
Bukkit.getScheduler().runTask(ElementOriginLib.inst(), ()-> playerInput.call(string));
playerInput.call(string);
if (playerInput.isCall() || playerInput.isCancel()) {
PlayerChatInputManager.removeInput(player);
}
});
}
}