From 03f815ecfac49db1fa4431ed2cb3191bfb29b55a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 5 Jun 2021 13:33:34 +0200 Subject: [PATCH] Fix ArrowStopper.java --- .../src/de/steamwar/fightsystem/listener/ArrowStopper.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/ArrowStopper.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/ArrowStopper.java index 696d0e7..35d8af1 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/ArrowStopper.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/ArrowStopper.java @@ -21,7 +21,6 @@ package de.steamwar.fightsystem.listener; import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.states.FightState; -import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.states.StateDependentTask; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -29,17 +28,15 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; -import org.bukkit.event.Listener; import org.bukkit.projectiles.ProjectileSource; 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 BlockFace[] BLOCK_FACES = {BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH}; public ArrowStopper() { - new StateDependentListener(Config.TechhiderActive, FightState.Running, this); new StateDependentTask(Config.TechhiderActive, FightState.Running, this::run, 1, 1); } @@ -85,7 +82,7 @@ public class ArrowStopper implements Listener { } 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) {