From 64d34063b8e734b9a824c1e3642a7814283c9a74 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 17 Feb 2023 15:15:08 +0100 Subject: [PATCH] Remove nocom detection Signed-off-by: Lixfel --- .../fightsystem/listener/AntiCheat.java | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/AntiCheat.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/AntiCheat.java index 8534579..ad16213 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/AntiCheat.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/AntiCheat.java @@ -22,10 +22,6 @@ package de.steamwar.fightsystem.listener; import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.TinyProtocol; import de.steamwar.fightsystem.FightSystem; -import de.steamwar.sql.SWException; -import de.steamwar.techhider.ProtocolUtils; -import de.steamwar.techhider.TechHider; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -38,7 +34,6 @@ public class AntiCheat { TinyProtocol.instance.addFilter(teleport, this::onTeleport); TinyProtocol.instance.addFilter(position, this::onMove); TinyProtocol.instance.addFilter(positionLook, this::onMove); - TinyProtocol.instance.addFilter(blockDig, this::onDig); } private static final Class flying = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying"); @@ -88,20 +83,6 @@ public class AntiCheat { return packet; } - private static final Class blockDig = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInBlockDig"); - private static final Reflection.FieldAccessor digPosition = Reflection.getField(blockDig, TechHider.blockPosition, 0); - private Object onDig(Player player, Object packet) { - Object pos = digPosition.get(packet); - int x = TechHider.blockPositionX.get(pos); - int z = TechHider.blockPositionZ.get(pos); - if(!player.getWorld().isChunkLoaded(ProtocolUtils.posToChunk(x), ProtocolUtils.posToChunk(z))) { - Bukkit.getScheduler().runTask(FightSystem.getPlugin(), () -> player.kickPlayer(null)); - SWException.log(player.getName() + " tried to dig an unloaded block", ""); - return null; - } - return packet; - } - private static class Movement { private final double x; private final double y;