From 7ddd8052c8fc46f7eed0137e77b6a909bd54c24e Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 8 May 2021 14:56:29 +0200 Subject: [PATCH] Fix Dispenser Signed-off-by: Lixfel --- .../de/steamwar/fightsystem/listener/InFightInventory.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightInventory.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightInventory.java index c72a812..3dd0274 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightInventory.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/InFightInventory.java @@ -29,6 +29,7 @@ import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockDispenseEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryDragEvent; @@ -123,4 +124,10 @@ public class InFightInventory implements Listener { e.setCancelled(true); } } + + @EventHandler + public void onBlockDispense(BlockDispenseEvent e) { + if(e.getItem().getType() == Material.TNT) + e.setCancelled(true); + } } -- 2.39.5