From c038d8a229800592c1e665c7274c250586fb5106 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 3 Sep 2020 15:11:47 +0200 Subject: [PATCH] Fixes Item Taking From Chest Pre Fight --- src/de/steamwar/misslewars/listener/ItemListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/misslewars/listener/ItemListener.java b/src/de/steamwar/misslewars/listener/ItemListener.java index 275c99a..ae46b19 100644 --- a/src/de/steamwar/misslewars/listener/ItemListener.java +++ b/src/de/steamwar/misslewars/listener/ItemListener.java @@ -89,6 +89,10 @@ public class ItemListener extends BasicListener { @EventHandler public void onInventoryClick(InventoryClickEvent event) { Inventory clicked = event.getClickedInventory(); + if(MissileWars.getFightState() != FightState.FIGHTING) { + event.setCancelled(true); + return; + } if(event.getClick().isShiftClick()){ ItemStack clickedOn = event.getCurrentItem(); @@ -102,7 +106,7 @@ public class ItemListener extends BasicListener { clicked != null && clicked.getType() != InventoryType.PLAYER && event.getCursor() != null && - event.getCursor().getType() != Material.AIR) + event.getCursor().getType() != Material.AIR ) event.setCancelled(true); } }