diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ClickAnalyzer.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ClickAnalyzer.java index 3def965c..3e84d916 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ClickAnalyzer.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ClickAnalyzer.java @@ -24,6 +24,7 @@ import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.utils.CraftbukkitWrapper; import de.steamwar.linkage.Linked; import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket; +import net.minecraft.network.protocol.game.ServerboundUseItemPacket; import org.bukkit.entity.Player; import java.io.*; @@ -42,7 +43,7 @@ public class ClickAnalyzer { } public ClickAnalyzer() { - TinyProtocol.instance.addFilter(Recording.blockPlacePacket, this::onBlockPlace); + TinyProtocol.instance.addFilter(ServerboundUseItemPacket.class, this::onBlockPlace); TinyProtocol.instance.addFilter(ServerboundUseItemOnPacket.class, this::onBlockPlace); } diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Recording.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Recording.java index 24741cda..0187d089 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Recording.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Recording.java @@ -125,7 +125,7 @@ public class Recording implements Listener { @Override public void disable() { - TinyProtocol.instance.removeFilter(blockPlacePacket, place); + TinyProtocol.instance.removeFilter(ServerboundUseItemPacket.class, place); TinyProtocol.instance.removeFilter(blockDigPacket, dig); } }.register(); @@ -155,8 +155,6 @@ public class Recording implements Listener { return packet; } - public static final Class blockPlacePacket = ServerboundUseItemPacket.class; - private Object blockPlace(Player p, ServerboundUseItemPacket packet) { boolean mainHand = packet.getHand() == InteractionHand.MAIN_HAND; if (!isNotSent(p) && (mainHand ? p.getInventory().getItemInMainHand() : p.getInventory().getItemInOffHand()).getType() == Material.BOW) {