Skip to content

Commit af717b2

Browse files
committed
fix LiquidAirBreak false
1 parent 009422d commit af717b2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/main/java/ac/grim/grimac/checks/impl/breaking/LiquidAirBreak.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import ac.grim.grimac.checks.type.BlockBreakCheck;
66
import ac.grim.grimac.player.GrimPlayer;
77
import ac.grim.grimac.utils.anticheat.update.BlockBreak;
8-
import ac.grim.grimac.utils.nmsutil.BlockBreakSpeed;
98
import com.github.retrooper.packetevents.protocol.item.type.ItemTypes;
109
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
1110
import com.github.retrooper.packetevents.protocol.player.DiggingAction;
@@ -26,19 +25,19 @@ public void onBlockBreak(BlockBreak blockBreak) {
2625
return;
2726
}
2827

29-
final boolean invalid;
30-
3128
final StateType block = blockBreak.block.getType();
3229

33-
if (blockBreak.action == DiggingAction.FINISHED_DIGGING) {
34-
invalid = BlockBreakSpeed.getBlockDamage(player, blockBreak.position) >= 1 || block.getHardness() == -1.0f;
35-
} else invalid = (block == StateTypes.LIGHT && !(player.getInventory().getHeldItem().is(ItemTypes.LIGHT) || player.getInventory().getOffHand().is(ItemTypes.LIGHT)))
30+
// the block does not have a hitbox
31+
boolean invalid =
32+
(block == StateTypes.LIGHT && !(player.getInventory().getHeldItem().is(ItemTypes.LIGHT) || player.getInventory().getOffHand().is(ItemTypes.LIGHT)))
3633
|| block.isAir()
3734
|| block == StateTypes.WATER
3835
|| block == StateTypes.LAVA
3936
|| block == StateTypes.BUBBLE_COLUMN
4037
|| block == StateTypes.MOVING_PISTON
41-
|| (block == StateTypes.FIRE && noFireHitbox);
38+
|| (block == StateTypes.FIRE && noFireHitbox)
39+
// or the client claims to have broken an unbreakable block
40+
|| block.getHardness() == -1.0f && blockBreak.action == DiggingAction.FINISHED_DIGGING;
4241

4342
if (invalid && flagAndAlert("block=" + block.getName() + ", type=" + blockBreak.action) && shouldModifyPackets()) {
4443
blockBreak.cancel();

0 commit comments

Comments
 (0)