Skip to content

Commit

Permalink
Added getAirSpeedMultiplier mapping in AquaticMoveControl (#509)
Browse files Browse the repository at this point in the history
* Added getAirSpeedMultiplier mapping for static method in AquaticMoveControl.

* Update mappings/net/minecraft/entity/ai/control/AquaticMoveControl.mapping

Co-authored-by: Will <[email protected]>

---------

Co-authored-by: Will <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 17, 2023
1 parent 7d14505 commit d048ddb
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ CLASS net/minecraft/unmapped/C_rtyfovet net/minecraft/entity/ai/control/AquaticM
ARG 4 speedInWater
ARG 5 speedInAir
ARG 6 buoyant
METHOD m_rvgifltm calcAirSpeedMultiplier (F)F

1 comment on commit d048ddb

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With commit d048ddb, 9 file(s) were updated with 81 line(s) added and 72 removed compared to the latest Quilt Mappings version.

View the diff here:
Only in namedTargetSrc/net/minecraft/client/multiplayer: prediction
Only in namedSrc/net/minecraft/client/network: BlockUpdatePredictionManager.java
diff -bur namedTargetSrc/net/minecraft/client/network/ClientPlayerInteractionManager.java namedSrc/net/minecraft/client/network/ClientPlayerInteractionManager.java
--- namedTargetSrc/net/minecraft/client/network/ClientPlayerInteractionManager.java	2023-10-17 03:08:16.076994233 +0000
+++ namedSrc/net/minecraft/client/network/ClientPlayerInteractionManager.java	2023-10-17 03:06:45.252725265 +0000
@@ -11,8 +11,6 @@
 import net.minecraft.block.BlockState;
 import net.minecraft.block.OperatorBlock;
 import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.multiplayer.prediction.BlockStatePredictionManager;
-import net.minecraft.client.multiplayer.prediction.PredictiveAction;
 import net.minecraft.client.recipe_book.ClientRecipeBook;
 import net.minecraft.client.sound.PositionedSoundInstance;
 import net.minecraft.client.sound.SoundInstance;
@@ -220,9 +218,9 @@
          if (this.gameMode.isCreative()) {
             BlockState lv = this.client.world.getBlockState(pos);
             this.client.getTutorialManager().onBlockBreaking(this.client.world, pos, lv, 1.0F);
-            this.startPrediction(this.client.world, sequence -> {
+            this.sendActionPacket(this.client.world, actionIndex -> {
                this.breakBlock(pos);
-               return new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, direction, sequence);
+               return new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, direction, actionIndex);
             });
             this.blockBreakingCooldown = 5;
          } else if (!this.breakingBlock || !this.isCurrentlyBreaking(pos)) {
@@ -232,7 +230,7 @@
 
             BlockState lv2 = this.client.world.getBlockState(pos);
             this.client.getTutorialManager().onBlockBreaking(this.client.world, pos, lv2, 0.0F);
-            this.startPrediction(this.client.world, sequence -> {
+            this.sendActionPacket(this.client.world, actionIndex -> {
                boolean bl = !lv2.isAir();
                if (bl && this.currentBreakingProgress == 0.0F) {
                   lv2.onBlockBreakStart(this.client.world, pos, this.client.player);
@@ -249,7 +247,7 @@
                   this.client.world.setBlockBreakingInfo(this.client.player.getId(), this.currentBreakingPos, this.getBlockBreakingProgress());
                }
 
-               return new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, direction, sequence);
+               return new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, direction, actionIndex);
             });
          }
 
@@ -286,9 +284,9 @@
          this.blockBreakingCooldown = 5;
          BlockState lv = this.client.world.getBlockState(pos);
          this.client.getTutorialManager().onBlockBreaking(this.client.world, pos, lv, 1.0F);
-         this.startPrediction(this.client.world, sequence -> {
+         this.sendActionPacket(this.client.world, actionIndex -> {
             this.breakBlock(pos);
-            return new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, direction, sequence);
+            return new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, direction, actionIndex);
          });
          return true;
       } else if (this.isCurrentlyBreaking(pos)) {
@@ -313,9 +311,9 @@
             this.client.getTutorialManager().onBlockBreaking(this.client.world, pos, lv2, MathHelper.clamp(this.currentBreakingProgress, 0.0F, 1.0F));
             if (this.currentBreakingProgress >= 1.0F) {
                this.breakingBlock = false;
-               this.startPrediction(this.client.world, sequence -> {
+               this.sendActionPacket(this.client.world, actionIndex -> {
                   this.breakBlock(pos);
-                  return new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, pos, direction, sequence);
+                  return new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, pos, direction, actionIndex);
                });
                this.currentBreakingProgress = 0.0F;
                this.blockBreakingSoundCooldown = 0.0F;
@@ -332,12 +330,12 @@
 
    /**
     * @mapping {@literal hashed m_vvsqjptk Lnet/minecraft/unmapped/C_uxbydbcj;m_vvsqjptk(Lnet/minecraft/unmapped/C_ghdnlrrw;Lnet/minecraft/unmapped/C_suesdakf;)V}
-    * @mapping {@literal named startPrediction Lnet/minecraft/client/network/ClientPlayerInteractionManager;startPrediction(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/multiplayer/prediction/PredictiveAction;)V}
+    * @mapping {@literal named sendActionPacket Lnet/minecraft/client/network/ClientPlayerInteractionManager;sendActionPacket(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/network/PlayerActionPacketFactory;)V}
     */
-   private void startPrediction(ClientWorld world, PredictiveAction action) {
-      try (BlockStatePredictionManager lv = world.getBlockPredictionManager().startPredicting()) {
-         int i = lv.getSequence();
-         Packet<ServerPlayPacketListener> lv2 = action.predict(i);
+   private void sendActionPacket(ClientWorld world, PlayerActionPacketFactory packetFactory) {
+      try (BlockUpdatePredictionManager lv = world.getBlockPredictionManager().incrementActionIndex()) {
+         int i = lv.getActionIndex();
+         Packet<ServerPlayPacketListener> lv2 = packetFactory.create(i);
          this.networkHandler.send(lv2);
       }
    }
@@ -394,9 +392,9 @@
          return ActionResult.FAIL;
       } else {
          MutableObject<ActionResult> mutableObject = new MutableObject<>();
-         this.startPrediction(this.client.world, i -> {
+         this.sendActionPacket(this.client.world, actionIndex -> {
             mutableObject.setValue(this.doInteractBlock(player, hand, hitResult));
-            return new PlayerInteractionWithBlockC2SPacket(hand, hitResult, i);
+            return new PlayerInteractionWithBlockC2SPacket(hand, hitResult, actionIndex);
          });
          return mutableObject.getValue();
       }
@@ -456,8 +454,8 @@
          this.networkHandler
             .send(new PlayerMoveC2SPacket.Full(player.getX(), player.getY(), player.getZ(), player.getYaw(), player.getPitch(), player.isOnGround()));
          MutableObject<ActionResult> mutableObject = new MutableObject<>();
-         this.startPrediction(this.client.world, i -> {
-            PlayerInteractionWithItemC2SPacket lv = new PlayerInteractionWithItemC2SPacket(hand, i);
+         this.sendActionPacket(this.client.world, actionIndex -> {
+            PlayerInteractionWithItemC2SPacket lv = new PlayerInteractionWithItemC2SPacket(hand, actionIndex);
             ItemStack lv2 = player.getStackInHand(hand);
             if (player.getItemCooldownManager().isCoolingDown(lv2.getItem())) {
                mutableObject.setValue(ActionResult.PASS);
diff -bur namedTargetSrc/net/minecraft/client/network/ClientPlayNetworkHandler.java namedSrc/net/minecraft/client/network/ClientPlayNetworkHandler.java
--- namedTargetSrc/net/minecraft/client/network/ClientPlayNetworkHandler.java	2023-10-17 03:08:16.216994665 +0000
+++ namedSrc/net/minecraft/client/network/ClientPlayNetworkHandler.java	2023-10-17 03:06:45.404725721 +0000
@@ -2609,7 +2609,7 @@
    @Override
    public void onBlockUpdateAcknowledgment(BlockUpdateAcknowledgmentS2CPacket packet) {
       NetworkThreadUtils.forceMainThread(packet, this, this.client);
-      this.world.onBlockChangeAcknowledgement(packet.sequence());
+      this.world.onBlockUpdateAcknowledgement(packet.getActionIndex());
    }
 
    /**
Only in namedSrc/net/minecraft/client/network: PlayerActionPacketFactory.java
diff -bur namedTargetSrc/net/minecraft/client/world/ClientWorld.java namedSrc/net/minecraft/client/world/ClientWorld.java
--- namedTargetSrc/net/minecraft/client/world/ClientWorld.java	2023-10-17 03:08:16.180994554 +0000
+++ namedSrc/net/minecraft/client/world/ClientWorld.java	2023-10-17 03:06:45.364725601 +0000
@@ -19,8 +19,8 @@
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.color.biome.BiomeColorProvider;
 import net.minecraft.client.color.world.BiomeColors;
-import net.minecraft.client.multiplayer.prediction.BlockStatePredictionManager;
 import net.minecraft.client.network.AbstractClientPlayerEntity;
+import net.minecraft.client.network.BlockUpdatePredictionManager;
 import net.minecraft.client.network.ClientPlayNetworkHandler;
 import net.minecraft.client.particle.FireworksSparkParticle;
 import net.minecraft.client.render.DimensionVisualEffects;
@@ -201,9 +201,9 @@
    private int simulationDistance;
    /**
     * @mapping {@literal hashed f_ycswtnpc Lnet/minecraft/unmapped/C_ghdnlrrw;f_ycswtnpc:Lnet/minecraft/unmapped/C_czisrdmd;}
-    * @mapping {@literal named blockPredictionManager Lnet/minecraft/client/world/ClientWorld;blockPredictionManager:Lnet/minecraft/client/multiplayer/prediction/BlockStatePredictionManager;}
+    * @mapping {@literal named blockPredictionManager Lnet/minecraft/client/world/ClientWorld;blockPredictionManager:Lnet/minecraft/client/network/BlockUpdatePredictionManager;}
     */
-   private final BlockStatePredictionManager blockPredictionManager = new BlockStatePredictionManager();
+   private final BlockUpdatePredictionManager blockPredictionManager = new BlockUpdatePredictionManager();
    /**
     * @mapping {@literal hashed f_fcmyqkjf Lnet/minecraft/unmapped/C_ghdnlrrw;f_fcmyqkjf:Ljava/util/Set;}
     * @mapping {@literal named MARKER_PARTICLE_ITEMS Lnet/minecraft/client/world/ClientWorld;MARKER_PARTICLE_ITEMS:Ljava/util/Set;}
@@ -212,9 +212,9 @@
 
    /**
     * @mapping {@literal hashed m_nsvkfxjo Lnet/minecraft/unmapped/C_ghdnlrrw;m_nsvkfxjo(I)V}
-    * @mapping {@literal named onBlockChangeAcknowledgement Lnet/minecraft/client/world/ClientWorld;onBlockChangeAcknowledgement(I)V}
+    * @mapping {@literal named onBlockUpdateAcknowledgement Lnet/minecraft/client/world/ClientWorld;onBlockUpdateAcknowledgement(I)V}
     */
-   public void onBlockChangeAcknowledgement(int sequence) {
+   public void onBlockUpdateAcknowledgement(int sequence) {
       this.blockPredictionManager.endPredictionsUntil(sequence, this);
    }
 
@@ -245,9 +245,9 @@
 
    /**
     * @mapping {@literal hashed m_lvsrwztn Lnet/minecraft/unmapped/C_ghdnlrrw;m_lvsrwztn()Lnet/minecraft/unmapped/C_czisrdmd;}
-    * @mapping {@literal named getBlockPredictionManager Lnet/minecraft/client/world/ClientWorld;getBlockPredictionManager()Lnet/minecraft/client/multiplayer/prediction/BlockStatePredictionManager;}
+    * @mapping {@literal named getBlockPredictionManager Lnet/minecraft/client/world/ClientWorld;getBlockPredictionManager()Lnet/minecraft/client/network/BlockUpdatePredictionManager;}
     */
-   BlockStatePredictionManager getBlockPredictionManager() {
+   BlockUpdatePredictionManager getBlockPredictionManager() {
       return this.blockPredictionManager;
    }
 
diff -bur namedTargetSrc/net/minecraft/entity/ai/control/AquaticMoveControl.java namedSrc/net/minecraft/entity/ai/control/AquaticMoveControl.java
--- namedTargetSrc/net/minecraft/entity/ai/control/AquaticMoveControl.java	2023-10-17 03:08:16.228994702 +0000
+++ namedSrc/net/minecraft/entity/ai/control/AquaticMoveControl.java	2023-10-17 03:06:45.416725757 +0000
@@ -93,7 +93,7 @@
                this.entity.upwardSpeed = -m * i;
             } else {
                float n = Math.abs(MathHelper.wrapDegrees(this.entity.getYaw() - h));
-               float o = m_rvgifltm(n);
+               float o = calcAirSpeedMultiplier(n);
                this.entity.setMovementSpeed(i * this.speedInAir * o);
             }
          }
@@ -106,9 +106,10 @@
    }
 
    /**
-    * Mapping not found
+    * @mapping {@literal hashed m_rvgifltm Lnet/minecraft/unmapped/C_rtyfovet;m_rvgifltm(F)F}
+    * @mapping {@literal named calcAirSpeedMultiplier Lnet/minecraft/entity/ai/control/AquaticMoveControl;calcAirSpeedMultiplier(F)F}
     */
-   private static float m_rvgifltm(float f) {
+   private static float calcAirSpeedMultiplier(float f) {
       return 1.0F - MathHelper.clamp((f - 10.0F) / 50.0F, 0.0F, 1.0F);
    }
 }
diff -bur namedTargetSrc/net/minecraft/network/packet/c2s/play/PlayerActionC2SPacket.java namedSrc/net/minecraft/network/packet/c2s/play/PlayerActionC2SPacket.java
--- namedTargetSrc/net/minecraft/network/packet/c2s/play/PlayerActionC2SPacket.java	2023-10-17 03:08:16.148994455 +0000
+++ namedSrc/net/minecraft/network/packet/c2s/play/PlayerActionC2SPacket.java	2023-10-17 03:06:45.332725505 +0000
@@ -28,19 +28,19 @@
    private final PlayerActionC2SPacket.Action action;
    /**
     * @mapping {@literal hashed f_xytphvpc Lnet/minecraft/unmapped/C_cbvghftd;f_xytphvpc:I}
-    * @mapping {@literal named sequence Lnet/minecraft/network/packet/c2s/play/PlayerActionC2SPacket;sequence:I}
+    * @mapping {@literal named actionIndex Lnet/minecraft/network/packet/c2s/play/PlayerActionC2SPacket;actionIndex:I}
     */
-   private final int sequence;
+   private final int actionIndex;
 
    /**
     * @mapping {@literal hashed <init> Lnet/minecraft/unmapped/C_cbvghftd;<init>(Lnet/minecraft/unmapped/C_cbvghftd$C_dowtgrks;Lnet/minecraft/unmapped/C_hynzadkk;Lnet/minecraft/unmapped/C_xpuuihxf;I)V}
     * @mapping {@literal named <init> Lnet/minecraft/network/packet/c2s/play/PlayerActionC2SPacket;<init>(Lnet/minecraft/network/packet/c2s/play/PlayerActionC2SPacket$Action;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;I)V}
     */
-   public PlayerActionC2SPacket(PlayerActionC2SPacket.Action action, BlockPos pos, Direction direction, int sequence) {
+   public PlayerActionC2SPacket(PlayerActionC2SPacket.Action action, BlockPos pos, Direction direction, int actionIndex) {
       this.action = action;
       this.pos = pos.toImmutable();
       this.direction = direction;
-      this.sequence = sequence;
+      this.actionIndex = actionIndex;
    }
 
    /**
@@ -59,7 +59,7 @@
       this.action = buf.readEnumConstant(PlayerActionC2SPacket.Action.class);
       this.pos = buf.readBlockPos();
       this.direction = Direction.byId(buf.readUnsignedByte());
-      this.sequence = buf.readVarInt();
+      this.actionIndex = buf.readVarInt();
    }
 
    /**
@@ -70,7 +70,7 @@
       buf.writeEnumConstant(this.action);
       buf.writeBlockPos(this.pos);
       buf.writeByte(this.direction.getId());
-      buf.writeVarInt(this.sequence);
+      buf.writeVarInt(this.actionIndex);
    }
 
    /**
@@ -107,10 +107,10 @@
 
    /**
     * @mapping {@literal hashed m_aavwutsx Lnet/minecraft/unmapped/C_cbvghftd;m_aavwutsx()I}
-    * @mapping {@literal named getSequence Lnet/minecraft/network/packet/c2s/play/PlayerActionC2SPacket;getSequence()I}
+    * @mapping {@literal named getActionIndex Lnet/minecraft/network/packet/c2s/play/PlayerActionC2SPacket;getActionIndex()I}
     */
-   public int getSequence() {
-      return this.sequence;
+   public int getActionIndex() {
+      return this.actionIndex;
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket.java namedSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket.java
--- namedTargetSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket.java	2023-10-17 03:08:16.164994504 +0000
+++ namedSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket.java	2023-10-17 03:06:45.352725565 +0000
@@ -23,18 +23,18 @@
    private final Hand hand;
    /**
     * @mapping {@literal hashed f_wmewrihq Lnet/minecraft/unmapped/C_yiwzfjbl;f_wmewrihq:I}
-    * @mapping {@literal named sequence Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket;sequence:I}
+    * @mapping {@literal named actionIndex Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket;actionIndex:I}
     */
-   private final int sequence;
+   private final int actionIndex;
 
    /**
     * @mapping {@literal hashed <init> Lnet/minecraft/unmapped/C_yiwzfjbl;<init>(Lnet/minecraft/unmapped/C_laxmzoqs;Lnet/minecraft/unmapped/C_jdakttms;I)V}
     * @mapping {@literal named <init> Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket;<init>(Lnet/minecraft/util/Hand;Lnet/minecraft/util/hit/BlockHitResult;I)V}
     */
-   public PlayerInteractionWithBlockC2SPacket(Hand hand, BlockHitResult result, int sequence) {
+   public PlayerInteractionWithBlockC2SPacket(Hand hand, BlockHitResult result, int actionIndex) {
       this.hand = hand;
       this.blockHitResult = result;
-      this.sequence = sequence;
+      this.actionIndex = actionIndex;
    }
 
    /**
@@ -44,7 +44,7 @@
    public PlayerInteractionWithBlockC2SPacket(PacketByteBuf buf) {
       this.hand = buf.readEnumConstant(Hand.class);
       this.blockHitResult = buf.readBlockHitResult();
-      this.sequence = buf.readVarInt();
+      this.actionIndex = buf.readVarInt();
    }
 
    /**
@@ -54,7 +54,7 @@
    public void write(PacketByteBuf buf) {
       buf.writeEnumConstant(this.hand);
       buf.writeBlockHitResult(this.blockHitResult);
-      buf.writeVarInt(this.sequence);
+      buf.writeVarInt(this.actionIndex);
    }
 
    /**
@@ -83,9 +83,9 @@
 
    /**
     * @mapping {@literal hashed m_loxsqyym Lnet/minecraft/unmapped/C_yiwzfjbl;m_loxsqyym()I}
-    * @mapping {@literal named getSequence Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket;getSequence()I}
+    * @mapping {@literal named getActionIndex Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket;getActionIndex()I}
     */
-   public int getSequence() {
-      return this.sequence;
+   public int getActionIndex() {
+      return this.actionIndex;
    }
 }
diff -bur namedTargetSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket.java namedSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket.java
--- namedTargetSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket.java	2023-10-17 03:08:16.100994307 +0000
+++ namedSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket.java	2023-10-17 03:06:45.276725337 +0000
@@ -17,17 +17,17 @@
    private final Hand hand;
    /**
     * @mapping {@literal hashed f_bevivupc Lnet/minecraft/unmapped/C_mnaqbeyf;f_bevivupc:I}
-    * @mapping {@literal named sequence Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket;sequence:I}
+    * @mapping {@literal named actionIndex Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket;actionIndex:I}
     */
-   private final int sequence;
+   private final int actionIndex;
 
    /**
     * @mapping {@literal hashed <init> Lnet/minecraft/unmapped/C_mnaqbeyf;<init>(Lnet/minecraft/unmapped/C_laxmzoqs;I)V}
     * @mapping {@literal named <init> Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket;<init>(Lnet/minecraft/util/Hand;I)V}
     */
-   public PlayerInteractionWithItemC2SPacket(Hand hand, int sequence) {
+   public PlayerInteractionWithItemC2SPacket(Hand hand, int actionIndex) {
       this.hand = hand;
-      this.sequence = sequence;
+      this.actionIndex = actionIndex;
    }
 
    /**
@@ -36,7 +36,7 @@
     */
    public PlayerInteractionWithItemC2SPacket(PacketByteBuf buf) {
       this.hand = buf.readEnumConstant(Hand.class);
-      this.sequence = buf.readVarInt();
+      this.actionIndex = buf.readVarInt();
    }
 
    /**
@@ -45,7 +45,7 @@
    @Override
    public void write(PacketByteBuf buf) {
       buf.writeEnumConstant(this.hand);
-      buf.writeVarInt(this.sequence);
+      buf.writeVarInt(this.actionIndex);
    }
 
    /**
@@ -66,9 +66,9 @@
 
    /**
     * @mapping {@literal hashed m_qzbliggz Lnet/minecraft/unmapped/C_mnaqbeyf;m_qzbliggz()I}
-    * @mapping {@literal named getSequence Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket;getSequence()I}
+    * @mapping {@literal named getActionIndex Lnet/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket;getActionIndex()I}
     */
-   public int getSequence() {
-      return this.sequence;
+   public int getActionIndex() {
+      return this.actionIndex;
    }
 }
diff -bur namedTargetSrc/net/minecraft/network/packet/s2c/play/BlockUpdateAcknowledgmentS2CPacket.java namedSrc/net/minecraft/network/packet/s2c/play/BlockUpdateAcknowledgmentS2CPacket.java
--- namedTargetSrc/net/minecraft/network/packet/s2c/play/BlockUpdateAcknowledgmentS2CPacket.java	2023-10-17 03:08:16.152994467 +0000
+++ namedSrc/net/minecraft/network/packet/s2c/play/BlockUpdateAcknowledgmentS2CPacket.java	2023-10-17 03:06:45.336725517 +0000
@@ -8,7 +8,7 @@
  * @mapping {@literal hashed net/minecraft/unmapped/C_ohnbgqmp}
  * @mapping {@literal named net/minecraft/network/packet/s2c/play/BlockUpdateAcknowledgmentS2CPacket}
  */
-public record BlockUpdateAcknowledgmentS2CPacket(int sequence) implements Packet<ClientPlayPacketListener> {
+public record BlockUpdateAcknowledgmentS2CPacket(int actionIndex) implements Packet<ClientPlayPacketListener> {
    /**
     * @mapping {@literal hashed <init> Lnet/minecraft/unmapped/C_ohnbgqmp;<init>(Lnet/minecraft/unmapped/C_idfydwco;)V}
     * @mapping {@literal named <init> Lnet/minecraft/network/packet/s2c/play/BlockUpdateAcknowledgmentS2CPacket;<init>(Lnet/minecraft/network/PacketByteBuf;)V}
@@ -22,7 +22,7 @@
     */
    @Override
    public void write(PacketByteBuf buf) {
-      buf.writeVarInt(this.sequence);
+      buf.writeVarInt(this.actionIndex);
    }
 
    /**
@@ -32,4 +32,12 @@
    public void apply(ClientPlayPacketListener arg) {
       arg.onBlockUpdateAcknowledgment(this);
    }
+
+   /**
+    * @mapping {@literal hashed m_rbfsyvrn Lnet/minecraft/unmapped/C_ohnbgqmp;m_rbfsyvrn()I}
+    * @mapping {@literal named getActionIndex Lnet/minecraft/network/packet/s2c/play/BlockUpdateAcknowledgmentS2CPacket;getActionIndex()I}
+    */
+   public int getActionIndex() {
+      return this.actionIndex;
+   }
 }
diff -bur namedTargetSrc/net/minecraft/server/network/ServerPlayNetworkHandler.java namedSrc/net/minecraft/server/network/ServerPlayNetworkHandler.java
--- namedTargetSrc/net/minecraft/server/network/ServerPlayNetworkHandler.java	2023-10-17 03:08:16.144994443 +0000
+++ namedSrc/net/minecraft/server/network/ServerPlayNetworkHandler.java	2023-10-17 03:06:45.328725493 +0000
@@ -229,9 +229,9 @@
    private int ticks;
    /**
     * @mapping {@literal hashed f_bragqdfw Lnet/minecraft/unmapped/C_hwbabymg;f_bragqdfw:I}
-    * @mapping {@literal named blockChangeSequence Lnet/minecraft/server/network/ServerPlayNetworkHandler;blockChangeSequence:I}
+    * @mapping {@literal named actionIndex Lnet/minecraft/server/network/ServerPlayNetworkHandler;actionIndex:I}
     */
-   private int blockChangeSequence = -1;
+   private int actionIndex = -1;
    /**
     * @mapping {@literal hashed f_edhjuvkw Lnet/minecraft/unmapped/C_hwbabymg;f_edhjuvkw:I}
     * @mapping {@literal named messageCooldown Lnet/minecraft/server/network/ServerPlayNetworkHandler;messageCooldown:I}
@@ -410,9 +410,9 @@
     */
    @Override
    public void tick() {
-      if (this.blockChangeSequence > -1) {
-         this.send(new BlockUpdateAcknowledgmentS2CPacket(this.blockChangeSequence));
-         this.blockChangeSequence = -1;
+      if (this.actionIndex > -1) {
+         this.send(new BlockUpdateAcknowledgmentS2CPacket(this.actionIndex));
+         this.actionIndex = -1;
       }
 
       this.syncWithPlayerPosition();
@@ -1317,8 +1317,10 @@
          case START_DESTROY_BLOCK:
          case ABORT_DESTROY_BLOCK:
          case STOP_DESTROY_BLOCK:
-            this.player.interactionManager.processBlockBreakingAction(lv, lv2, packet.getDirection(), this.player.getWorld().getTopY(), packet.getSequence());
-            this.player.networkHandler.updateBlockChangeSequence(packet.getSequence());
+            this.player
+               .interactionManager
+               .processBlockBreakingAction(lv, lv2, packet.getDirection(), this.player.getWorld().getTopY(), packet.getActionIndex());
+            this.player.networkHandler.updateActionIndex(packet.getActionIndex());
             return;
          default:
             throw new IllegalArgumentException("Invalid player action");
@@ -1348,7 +1350,7 @@
    @Override
    public void onPlayerInteractionWithBlock(PlayerInteractionWithBlockC2SPacket packet) {
       NetworkThreadUtils.forceMainThread(packet, this, this.player.getServerWorld());
-      this.player.networkHandler.updateBlockChangeSequence(packet.getSequence());
+      this.player.networkHandler.updateActionIndex(packet.getActionIndex());
       ServerWorld lv = this.player.getServerWorld();
       Hand lv2 = packet.getHand();
       ItemStack lv3 = this.player.getStackInHand(lv2);
@@ -1396,7 +1398,7 @@
    @Override
    public void onPlayerInteractionWithItem(PlayerInteractionWithItemC2SPacket packet) {
       NetworkThreadUtils.forceMainThread(packet, this, this.player.getServerWorld());
-      this.updateBlockChangeSequence(packet.getSequence());
+      this.updateActionIndex(packet.getActionIndex());
       ServerWorld lv = this.player.getServerWorld();
       Hand lv2 = packet.getHand();
       ItemStack lv3 = this.player.getStackInHand(lv2);
@@ -1465,13 +1467,13 @@
 
    /**
     * @mapping {@literal hashed m_rpjisoud Lnet/minecraft/unmapped/C_hwbabymg;m_rpjisoud(I)V}
-    * @mapping {@literal named updateBlockChangeSequence Lnet/minecraft/server/network/ServerPlayNetworkHandler;updateBlockChangeSequence(I)V}
+    * @mapping {@literal named updateActionIndex Lnet/minecraft/server/network/ServerPlayNetworkHandler;updateActionIndex(I)V}
     */
-   public void updateBlockChangeSequence(int blockChangeSequence) {
-      if (blockChangeSequence < 0) {
+   public void updateActionIndex(int actionIndex) {
+      if (actionIndex < 0) {
          throw new IllegalArgumentException("Expected packet sequence nr >= 0");
       } else {
-         this.blockChangeSequence = Math.max(blockChangeSequence, this.blockChangeSequence);
+         this.actionIndex = Math.max(actionIndex, this.actionIndex);
       }
    }
 

Please sign in to comment.