diff --git a/src/main/java/ac/grim/grimac/checks/impl/movement/NoSlowD.java b/src/main/java/ac/grim/grimac/checks/impl/movement/NoSlowD.java index a8ca86cc43..ddebfae5cd 100644 --- a/src/main/java/ac/grim/grimac/checks/impl/movement/NoSlowD.java +++ b/src/main/java/ac/grim/grimac/checks/impl/movement/NoSlowD.java @@ -33,7 +33,7 @@ public void onPacketReceive(PacketReceiveEvent event) { public void onPredictionComplete(final PredictionComplete predictionComplete) { if (!predictionComplete.isChecked()) return; - if (player.packetStateData.slowedByUsingItem) { + if (player.packetStateData.isSlowedByUsingItem()) { // https://bugs.mojang.com/browse/MC-152728 if (startedSprintingBeforeUse && player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_14_2)) { reward(); diff --git a/src/main/java/ac/grim/grimac/events/packets/PacketPlayerDigging.java b/src/main/java/ac/grim/grimac/events/packets/PacketPlayerDigging.java index 0bd764fdbb..86cbdd4aec 100644 --- a/src/main/java/ac/grim/grimac/events/packets/PacketPlayerDigging.java +++ b/src/main/java/ac/grim/grimac/events/packets/PacketPlayerDigging.java @@ -125,12 +125,12 @@ public static void handleUseItem(GrimPlayer player, ItemStack item, InteractionH } if (material == ItemTypes.SPYGLASS && player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_17)) { - player.packetStateData.slowedByUsingItem = true; + player.packetStateData.setSlowedByUsingItem(true); player.packetStateData.eatingHand = hand; } if (material == ItemTypes.GOAT_HORN && player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_19)) { - player.packetStateData.slowedByUsingItem = true; + player.packetStateData.setSlowedByUsingItem(true); player.packetStateData.eatingHand = hand; } @@ -216,12 +216,12 @@ public void onPacketReceive(PacketReceiveEvent event) { final ItemStack item = hand == InteractionHand.MAIN_HAND ? player.getInventory().getHeldItem() : player.getInventory().getOffHand(); - final boolean wasSlow = player.packetStateData.slowedByUsingItem; + final boolean wasSlow = player.packetStateData.isSlowedByUsingItem(); handleUseItem(player, item, hand); if (!wasSlow) { - player.checkManager.getPostPredictionCheck(NoSlowD.class).startedSprintingBeforeUse = player.packetStateData.slowedByUsingItem && player.isSprinting; + player.checkManager.getPostPredictionCheck(NoSlowD.class).startedSprintingBeforeUse = player.packetStateData.isSlowedByUsingItem() && player.isSprinting; } } } diff --git a/src/main/java/ac/grim/grimac/events/packets/PacketPlayerRespawn.java b/src/main/java/ac/grim/grimac/events/packets/PacketPlayerRespawn.java index 4778203e42..bee9772eb5 100644 --- a/src/main/java/ac/grim/grimac/events/packets/PacketPlayerRespawn.java +++ b/src/main/java/ac/grim/grimac/events/packets/PacketPlayerRespawn.java @@ -135,7 +135,7 @@ public void onPacketSend(PacketSendEvent event) { player.lastOnGround = false; player.onGround = false; player.isInBed = false; - player.packetStateData.slowedByUsingItem = player.packetStateData.wasSlowedByUsingItem = false; + player.packetStateData.setSlowedByUsingItem(false); player.packetStateData.packetPlayerOnGround = false; // If somewhere else pulls last ground to fix other issues player.packetStateData.lastClaimedPosition = new Vector3d(); player.filterMojangStupidityOnMojangStupidity = new Vector3d(); diff --git a/src/main/java/ac/grim/grimac/events/packets/PacketSelfMetadataListener.java b/src/main/java/ac/grim/grimac/events/packets/PacketSelfMetadataListener.java index ad8792fca3..bc62f3fdc0 100644 --- a/src/main/java/ac/grim/grimac/events/packets/PacketSelfMetadataListener.java +++ b/src/main/java/ac/grim/grimac/events/packets/PacketSelfMetadataListener.java @@ -207,7 +207,7 @@ public void onPacketSend(PacketSendEvent event) { // The above line is a hack to fake activate use item player.packetStateData.setSlowedByUsingItem(isActive); - player.checkManager.getPostPredictionCheck(NoSlowD.class).startedSprintingBeforeUse = player.packetStateData.slowedByUsingItem && player.isSprinting; + player.checkManager.getPostPredictionCheck(NoSlowD.class).startedSprintingBeforeUse = player.packetStateData.isSlowedByUsingItem() && player.isSprinting; if (isActive) { player.packetStateData.eatingHand = isOffhand ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;