diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/InFightInventory.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/InFightInventory.java index ffadab8..ad41d0a 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/InFightInventory.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/InFightInventory.java @@ -20,17 +20,13 @@ package de.steamwar.fightsystem.listener; import de.steamwar.fightsystem.ArenaMode; -import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentListener; -import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.block.data.type.Dispenser; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockDispenseEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryDragEvent; import org.bukkit.event.inventory.InventoryType; diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java index 2084291..e5f24a4 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java @@ -29,6 +29,7 @@ import de.steamwar.fightsystem.states.StateDependentListener; import net.md_5.bungee.api.ChatMessageType; import org.bukkit.GameMode; import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.block.data.type.Dispenser; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -166,11 +167,12 @@ public class Permanent implements Listener { @EventHandler public void onBlockDispense(BlockDispenseEvent e) { + Block block = e.getBlock(); - if(!Config.ArenaRegion.inRegion(e.getBlock())) + if(!Config.ArenaRegion.inRegion(block)) return; - if(e.getItem().getType() == Material.TNT || e.getBlock().getRelative(((Dispenser) e.getBlock().getBlockData()).getFacing()).isLiquid()) + if(e.getItem().getType() == Material.TNT || block.getRelative(((Dispenser) block.getBlockData()).getFacing()).isLiquid()) e.setCancelled(true); } }