From f8769d83a9e017a184f8446e8a0d95bef8b4a4e6 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 8 Jan 2021 17:42:35 +0100 Subject: [PATCH] Improve KitCreatorClosement Signed-off-by: Lixfel --- .../steamwar/fightsystem/listener/PersonalKitCreator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java index 0b8e181..04c7398 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java @@ -79,6 +79,7 @@ public class PersonalKitCreator extends BasicListener { player.updateInventory(); player.setGameMode(GameMode.CREATIVE); + toActionbar(player, TextComponent.fromLegacyText("§eInventar zum Anpassen des Kits öffnen§8!")); } public static boolean notInKitCreator(HumanEntity player){ @@ -108,11 +109,11 @@ public class PersonalKitCreator extends BasicListener { @EventHandler public void onMoveEvent(PlayerMoveEvent e){ - if(!openKitCreators.containsKey(e.getPlayer())) + InventoryBackup backup = openKitCreators.get(e.getPlayer()); + if(backup == null) return; - e.setCancelled(true); - toActionbar(e.getPlayer(), TextComponent.fromLegacyText("§eInventar zum Anpassen des Kits öffnen§8!")); + backup.close(); } @EventHandler