From 1c3929834a948cd5d6191f05dd7524e8b8109313 Mon Sep 17 00:00:00 2001 From: Axionize <154778082+Axionize@users.noreply.github.com> Date: Sun, 1 Dec 2024 17:08:01 -0500 Subject: [PATCH] Remove usage of var --- .../ac/grim/grimac/checks/impl/badpackets/BadPacketsX.java | 2 +- .../ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java | 6 +++--- .../ac/grim/grimac/events/packets/CheckManagerListener.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsX.java b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsX.java index e3a5d3c1ce..2590770481 100644 --- a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsX.java +++ b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsX.java @@ -30,7 +30,7 @@ public final void handle(BlockBreak blockBreak) { if (blockBreak.action != DiggingAction.START_DIGGING && blockBreak.action != DiggingAction.FINISHED_DIGGING) return; - final var block = blockBreak.block.getType(); + final StateType block = blockBreak.block.getType(); // Fixes false from breaking kelp underwater // 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 diff --git a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java index 8f8e1b820b..8f9e91e116 100644 --- a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java +++ b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsZ.java @@ -41,7 +41,7 @@ private boolean shouldExempt(final Vector3i pos) { public void handle(BlockBreak blockBreak) { if (blockBreak.action == DiggingAction.START_DIGGING) { - final var pos = blockBreak.position; + final Vector3i pos = blockBreak.position; lastBlockWasInstantBreak = getBlockDamage(player, pos) >= 1; lastCancelledBlock = null; @@ -50,7 +50,7 @@ public void handle(BlockBreak blockBreak) { } if (blockBreak.action == DiggingAction.CANCELLED_DIGGING) { - final var pos = blockBreak.position; + final Vector3i pos = blockBreak.position; if (shouldExempt(pos)) { lastCancelledBlock = pos; @@ -78,7 +78,7 @@ public void handle(BlockBreak blockBreak) { } if (blockBreak.action == DiggingAction.FINISHED_DIGGING) { - final var pos = blockBreak.position; + final Vector3i pos = blockBreak.position; // 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!) if (!pos.equals(lastCancelledBlock) && (!lastBlockWasInstantBreak || player.getClientVersion().isOlderThan(ClientVersion.V_1_14_4)) && !pos.equals(lastBlock)) { diff --git a/src/main/java/ac/grim/grimac/events/packets/CheckManagerListener.java b/src/main/java/ac/grim/grimac/events/packets/CheckManagerListener.java index a18757ea14..0f850628aa 100644 --- a/src/main/java/ac/grim/grimac/events/packets/CheckManagerListener.java +++ b/src/main/java/ac/grim/grimac/events/packets/CheckManagerListener.java @@ -453,8 +453,8 @@ public void onPacketReceive(PacketReceiveEvent event) { } if (event.getPacketType() == PacketType.Play.Client.PLAYER_DIGGING) { - final var packet = new WrapperPlayClientPlayerDigging(event); - final var blockBreak = new BlockBreak(packet, player); + final WrapperPlayClientPlayerDigging packet = new WrapperPlayClientPlayerDigging(event); + final BlockBreak blockBreak = new BlockBreak(packet, player); player.checkManager.getPacketCheck(BadPacketsX.class).handle(blockBreak); player.checkManager.getPacketCheck(BadPacketsZ.class).handle(blockBreak);