From 732ca0a71e77297f5429646507001c9ef89bb855 Mon Sep 17 00:00:00 2001 From: ManInMyVan Date: Wed, 16 Oct 2024 17:05:52 -0600 Subject: [PATCH] fix falses --- .../grim/grimac/checks/impl/packetorder/PacketOrderL.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/ac/grim/grimac/checks/impl/packetorder/PacketOrderL.java b/src/main/java/ac/grim/grimac/checks/impl/packetorder/PacketOrderL.java index fb4f7c9293..eddd681028 100644 --- a/src/main/java/ac/grim/grimac/checks/impl/packetorder/PacketOrderL.java +++ b/src/main/java/ac/grim/grimac/checks/impl/packetorder/PacketOrderL.java @@ -10,6 +10,7 @@ import com.github.retrooper.packetevents.event.PacketReceiveEvent; import com.github.retrooper.packetevents.protocol.packettype.PacketType; import com.github.retrooper.packetevents.protocol.player.ClientVersion; +import com.github.retrooper.packetevents.protocol.player.GameMode; import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientEntityAction; import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientPlayerDigging; import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientPlayerFlying; @@ -33,8 +34,9 @@ public void onPacketReceive(PacketReceiveEvent event) { switch (packet.getAction()) { case START_DIGGING: - if (BlockBreakSpeed.getBlockDamage(player, packet.getBlockPosition()) >= 1) { - return; // can false on insta-break blocks + double damage = BlockBreakSpeed.getBlockDamage(player, packet.getBlockPosition()); + if (damage >= 1 || damage <= 0 && player.gamemode == GameMode.CREATIVE) { + return; // can false on insta-break blocks, and unbreakable blocks in creative mode } case CANCELLED_DIGGING: case FINISHED_DIGGING: