diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java index c9c2dd4..f9a3b2d 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java @@ -37,6 +37,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.inventory.InventoryOpenEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.ItemStack; @@ -108,6 +109,15 @@ public class PersonalKitCreator implements Listener { backup.close(); } + @EventHandler + public void onOpenEvent(InventoryOpenEvent e){ + InventoryBackup backup = openKitCreators.get(e.getPlayer()); + if(backup == null) + return; + + backup.close(); + } + @EventHandler public void onInventoryClose(InventoryCloseEvent e) { InventoryBackup backup = openKitCreators.get(e.getPlayer());