Skip to content

Commit

Permalink
fix falses
Browse files Browse the repository at this point in the history
  • Loading branch information
ManInMyVan committed Nov 7, 2024
1 parent b6eb079 commit cbb1d30
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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:
Expand Down

0 comments on commit cbb1d30

Please sign in to comment.