SteamWar/FightSystem
Archiviert
13
1

Fix ArrowStopper.java

Dieser Commit ist enthalten in:
Chaoscaot 2021-06-05 13:33:34 +02:00
Ursprung 394ccc251e
Commit 03f815ecfa

Datei anzeigen

@ -21,7 +21,6 @@ package de.steamwar.fightsystem.listener;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentListener;
import de.steamwar.fightsystem.states.StateDependentTask; import de.steamwar.fightsystem.states.StateDependentTask;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
@ -29,17 +28,15 @@ import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.projectiles.ProjectileSource; import org.bukkit.projectiles.ProjectileSource;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
public class ArrowStopper implements Listener { public class ArrowStopper {
private static final Vector NULL_VECTOR = new Vector(0, 0, 0); private static final Vector NULL_VECTOR = new Vector(0, 0, 0);
private static final BlockFace[] BLOCK_FACES = {BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH}; private static final BlockFace[] BLOCK_FACES = {BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH};
public ArrowStopper() { public ArrowStopper() {
new StateDependentListener(Config.TechhiderActive, FightState.Running, this);
new StateDependentTask(Config.TechhiderActive, FightState.Running, this::run, 1, 1); new StateDependentTask(Config.TechhiderActive, FightState.Running, this::run, 1, 1);
} }
@ -85,7 +82,7 @@ public class ArrowStopper implements Listener {
} }
private boolean checkBlock(Block block) { private boolean checkBlock(Block block) {
return Config.HiddenBlocks.contains(block.getType().name()); return Config.HiddenBlocks.contains(block.getType().name().toLowerCase());
} }
private boolean invalidEntity(Arrow entity) { private boolean invalidEntity(Arrow entity) {