SteamWar/FightSystem
Archiviert
13
1

Anti water in Dispenser cleanup
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
MoBrot 2023-01-22 21:17:40 +01:00
Ursprung 914bf4f353
Commit b0c91b59fc
2 geänderte Dateien mit 4 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -20,17 +20,13 @@
package de.steamwar.fightsystem.listener; package de.steamwar.fightsystem.listener;
import de.steamwar.fightsystem.ArenaMode; import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.states.StateDependentListener;
import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.data.type.Dispenser;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockDispenseEvent;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent; import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.inventory.InventoryType;

Datei anzeigen

@ -29,6 +29,7 @@ import de.steamwar.fightsystem.states.StateDependentListener;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.data.type.Dispenser; import org.bukkit.block.data.type.Dispenser;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -166,11 +167,12 @@ public class Permanent implements Listener {
@EventHandler @EventHandler
public void onBlockDispense(BlockDispenseEvent e) { public void onBlockDispense(BlockDispenseEvent e) {
Block block = e.getBlock();
if(!Config.ArenaRegion.inRegion(e.getBlock())) if(!Config.ArenaRegion.inRegion(block))
return; 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); e.setCancelled(true);
} }
} }