Skip to content

Commit

Permalink
Merge pull request #1257 from Wruczek/2.0
Browse files Browse the repository at this point in the history
Fix FastBreak alert for players with nomodifypacket permission
  • Loading branch information
AoElite authored Dec 19, 2023
2 parents 649245a + 13a4ee6 commit 83450a2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/ac/grim/grimac/checks/impl/misc/FastBreak.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ public void onPacketReceive(PacketReceiveEvent event) {
blockDelayBalance += 300 - breakDelay;
}

if (blockDelayBalance > 1000 && shouldModifyPackets()) { // If more than a second of advantage
event.setCancelled(true); // Cancelling start digging will cause server to reject block break
player.onPacketCancel();
if (blockDelayBalance > 1000) { // If more than a second of advantage
flagAndAlert("Delay=" + breakDelay);
if (shouldModifyPackets()) {
event.setCancelled(true); // Cancelling start digging will cause server to reject block break
player.onPacketCancel();
}
}

clampBalance();
Expand Down

0 comments on commit 83450a2

Please sign in to comment.