Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
SamB440 committed Jul 17, 2024
1 parent 4a0b2f0 commit c4e5916
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c4e5916

Please sign in to comment.