Skip to content

Commit 1c39298

Browse files
committed
Remove usage of var
1 parent 7737337 commit 1c39298

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsX.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public final void handle(BlockBreak blockBreak) {
3030
if (blockBreak.action != DiggingAction.START_DIGGING && blockBreak.action != DiggingAction.FINISHED_DIGGING)
3131
return;
3232

33-
final var block = blockBreak.block.getType();
33+
final StateType block = blockBreak.block.getType();
3434

3535
// Fixes false from breaking kelp underwater
3636
// The client sends two start digging packets to the server both in the same tick. BadPacketsX gets called twice, doesn't false the first time, but falses the second

src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private boolean shouldExempt(final Vector3i pos) {
4141

4242
public void handle(BlockBreak blockBreak) {
4343
if (blockBreak.action == DiggingAction.START_DIGGING) {
44-
final var pos = blockBreak.position;
44+
final Vector3i pos = blockBreak.position;
4545

4646
lastBlockWasInstantBreak = getBlockDamage(player, pos) >= 1;
4747
lastCancelledBlock = null;
@@ -50,7 +50,7 @@ public void handle(BlockBreak blockBreak) {
5050
}
5151

5252
if (blockBreak.action == DiggingAction.CANCELLED_DIGGING) {
53-
final var pos = blockBreak.position;
53+
final Vector3i pos = blockBreak.position;
5454

5555
if (shouldExempt(pos)) {
5656
lastCancelledBlock = pos;
@@ -78,7 +78,7 @@ public void handle(BlockBreak blockBreak) {
7878
}
7979

8080
if (blockBreak.action == DiggingAction.FINISHED_DIGGING) {
81-
final var pos = blockBreak.position;
81+
final Vector3i pos = blockBreak.position;
8282

8383
// when a player looks away from the mined block, they send a cancel, and if they look at it again, they don't send another start. (thanks mojang!)
8484
if (!pos.equals(lastCancelledBlock) && (!lastBlockWasInstantBreak || player.getClientVersion().isOlderThan(ClientVersion.V_1_14_4)) && !pos.equals(lastBlock)) {

src/main/java/ac/grim/grimac/events/packets/CheckManagerListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ public void onPacketReceive(PacketReceiveEvent event) {
453453
}
454454

455455
if (event.getPacketType() == PacketType.Play.Client.PLAYER_DIGGING) {
456-
final var packet = new WrapperPlayClientPlayerDigging(event);
457-
final var blockBreak = new BlockBreak(packet, player);
456+
final WrapperPlayClientPlayerDigging packet = new WrapperPlayClientPlayerDigging(event);
457+
final BlockBreak blockBreak = new BlockBreak(packet, player);
458458

459459
player.checkManager.getPacketCheck(BadPacketsX.class).handle(blockBreak);
460460
player.checkManager.getPacketCheck(BadPacketsZ.class).handle(blockBreak);

0 commit comments

Comments
 (0)