diff --git a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java index 24fb8e9f86..cd617d93e3 100644 --- a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java +++ b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java @@ -4,7 +4,9 @@ import ac.grim.grimac.checks.CheckData; import ac.grim.grimac.checks.type.PacketCheck; import ac.grim.grimac.player.GrimPlayer; +import com.github.retrooper.packetevents.PacketEvents; import com.github.retrooper.packetevents.event.PacketReceiveEvent; +import com.github.retrooper.packetevents.manager.server.ServerVersion; import com.github.retrooper.packetevents.protocol.player.ClientVersion; import com.github.retrooper.packetevents.protocol.player.DiggingAction; import com.github.retrooper.packetevents.util.Vector3i; @@ -21,7 +23,7 @@ public BadPacketsZ(final GrimPlayer player) { private boolean lastBlockWasInstantBreak = false; private Vector3i lastBlock, lastCancelledBlock, lastLastBlock = null; - private final int exemptedY = player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_8) ? 4095 : 255; + private final int exemptedY = player.getClientVersion().isOlderThan(ClientVersion.V_1_8) ? 255 : (PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_1_14) ? -1 : 4095); // The client sometimes sends a wierd cancel packet private boolean shouldExempt(final Vector3i pos) {