Commit 5561b6c 1 parent 7f7674b commit 5561b6c Copy full SHA for 5561b6c
File tree 3 files changed +12
-28
lines changed
src/main/java/ac/grim/grimac/checks/impl/breaking
3 files changed +12
-28
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,8 @@ public void onBlockBreak(BlockBreak blockBreak) {
35
35
double threshold = player .getMovementThreshold ();
36
36
maxReach += Math .hypot (threshold , threshold );
37
37
38
- if (min > maxReach * maxReach ) {
39
- if (flagAndAlert ("distance=" + Math .sqrt (min )) && shouldModifyPackets ()) {
40
- blockBreak .cancel ();
41
- }
38
+ if (min > maxReach * maxReach && flagAndAlert (String .format ("distance=%.2f" , Math .sqrt (min ))) && shouldModifyPackets ()) {
39
+ blockBreak .cancel ();
42
40
}
43
41
}
44
42
}
Original file line number Diff line number Diff line change @@ -104,9 +104,7 @@ public void onPacketReceive(PacketReceiveEvent event) {
104
104
player .getClientVersion ().isNewerThanOrEquals (ClientVersion .V_1_9 )
105
105
? event .getPacketType () == PacketType .Play .Client .ANIMATION
106
106
: WrapperPlayClientPlayerFlying .isFlying (event .getPacketType ())
107
- )) {
108
- maximumBlockDamage = Math .max (maximumBlockDamage , BlockBreakSpeed .getBlockDamage (player , targetBlock ));
109
- }
107
+ )) maximumBlockDamage = Math .max (maximumBlockDamage , BlockBreakSpeed .getBlockDamage (player , targetBlock ));
110
108
}
111
109
112
110
private void clampBalance () {
Original file line number Diff line number Diff line change @@ -48,27 +48,15 @@ public void onBlockBreak(BlockBreak blockBreak) {
48
48
49
49
// So now we have the player's possible eye positions
50
50
// So then look at the face that the player has clicked
51
- boolean flag = false ;
52
- switch (blockBreak .face ) {
53
- case NORTH : // Z- face
54
- flag = eyePositions .minZ > combined .minZ ;
55
- break ;
56
- case SOUTH : // Z+ face
57
- flag = eyePositions .maxZ < combined .maxZ ;
58
- break ;
59
- case EAST : // X+ face
60
- flag = eyePositions .maxX < combined .maxX ;
61
- break ;
62
- case WEST : // X- face
63
- flag = eyePositions .minX > combined .minX ;
64
- break ;
65
- case UP : // Y+ face
66
- flag = eyePositions .maxY < combined .maxY ;
67
- break ;
68
- case DOWN : // Y- face
69
- flag = eyePositions .minY > combined .minY ;
70
- break ;
71
- }
51
+ boolean flag = switch (blockBreak .face ) {
52
+ case NORTH -> eyePositions .minZ > combined .minZ ; // Z- face
53
+ case SOUTH -> eyePositions .maxZ < combined .maxZ ; // Z+ face
54
+ case EAST -> eyePositions .maxX < combined .maxX ; // X+ face
55
+ case WEST -> eyePositions .minX > combined .minX ; // X- face
56
+ case UP -> eyePositions .maxY < combined .maxY ; // Y+ face
57
+ case DOWN -> eyePositions .minY > combined .minY ; // Y- face
58
+ default -> false ;
59
+ };
72
60
73
61
if (flag && flagAndAlert ("action=" + blockBreak .action ) && shouldModifyPackets ()) {
74
62
blockBreak .cancel ();
You can’t perform that action at this time.
0 commit comments