Skip to content

Commit

Permalink
rename RecipeBook.toBeDisplayed and related methods (#507)
Browse files Browse the repository at this point in the history
renamed RecipeBook.toBeDisplayed and related methods, fixes #472

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
supersaiyansubtlety and github-actions[bot] authored Oct 17, 2023
1 parent d048ddb commit 1e50ab3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mappings/net/minecraft/recipe/book/RecipeBook.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CLASS net/minecraft/unmapped/C_bluodrzq net/minecraft/recipe/book/RecipeBook
FIELD f_iavwhcwu toBeDisplayed Ljava/util/Set;
FIELD f_osoagsos options Lnet/minecraft/unmapped/C_krpwsfph;
FIELD f_uxxsaatt recipes Ljava/util/Set;
METHOD m_aqitkiku shouldDisplay (Lnet/minecraft/unmapped/C_dscbrwbj;)Z
METHOD m_dkodlkvz display (Lnet/minecraft/unmapped/C_ncpywfca;)V
METHOD m_aqitkiku shouldHighlight (Lnet/minecraft/unmapped/C_dscbrwbj;)Z
METHOD m_dkodlkvz queueForHighlight (Lnet/minecraft/unmapped/C_ncpywfca;)V
ARG 1 id
METHOD m_fhjstdra isFilteringCraftable (Lnet/minecraft/unmapped/C_mrybqpjh;)Z
ARG 1 category
Expand All @@ -18,7 +18,7 @@ CLASS net/minecraft/unmapped/C_bluodrzq net/minecraft/recipe/book/RecipeBook
ARG 1 id
METHOD m_ichoxvie remove (Lnet/minecraft/unmapped/C_ncpywfca;)V
ARG 1 id
METHOD m_laevpnyc onRecipeDisplayed (Lnet/minecraft/unmapped/C_dscbrwbj;)V
METHOD m_laevpnyc finishHighlight (Lnet/minecraft/unmapped/C_dscbrwbj;)V
METHOD m_ndyxwuyo setOptions (Lnet/minecraft/unmapped/C_krpwsfph;)V
ARG 1 options
METHOD m_oemftwbg setGuiOpen (Lnet/minecraft/unmapped/C_mrybqpjh;Z)V
Expand Down

1 comment on commit 1e50ab3

@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 1e50ab3, 14 file(s) were updated with 94 line(s) added and 85 removed compared to the latest Quilt Mappings version.

View the diff here:
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/button/recipe/book/AnimatedResultButton.java namedSrc/net/minecraft/client/gui/widget/button/recipe/book/AnimatedResultButton.java
--- namedTargetSrc/net/minecraft/client/gui/widget/button/recipe/book/AnimatedResultButton.java	2023-10-17 03:08:50.758700437 +0000
+++ namedSrc/net/minecraft/client/gui/widget/button/recipe/book/AnimatedResultButton.java	2023-10-17 03:07:16.979251039 +0000
@@ -113,7 +113,7 @@
       List<RecipeHolder<?>> list = resultCollection.getResults(this.recipeBook.isFilteringCraftable(this.craftingScreenHandler));
 
       for (RecipeHolder<?> lv : list) {
-         if (this.recipeBook.shouldDisplay(lv)) {
+         if (this.recipeBook.shouldHighlight(lv)) {
             results.onRecipesDisplayed(list);
             this.bounce = 15.0F;
             break;
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/button/recipe/book/RecipeGroupButtonWidget.java namedSrc/net/minecraft/client/gui/widget/button/recipe/book/RecipeGroupButtonWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/button/recipe/book/RecipeGroupButtonWidget.java	2023-10-17 03:08:50.830700011 +0000
+++ namedSrc/net/minecraft/client/gui/widget/button/recipe/book/RecipeGroupButtonWidget.java	2023-10-17 03:07:17.055250593 +0000
@@ -66,7 +66,7 @@
       if (client.player.currentScreenHandler instanceof AbstractRecipeScreenHandler) {
          for (RecipeResultCollection lv2 : list) {
             for (RecipeHolder<?> lv3 : lv2.getResults(lv.isFilteringCraftable((AbstractRecipeScreenHandler<?>)client.player.currentScreenHandler))) {
-               if (lv.shouldDisplay(lv3)) {
+               if (lv.shouldHighlight(lv3)) {
                   this.bounce = 15.0F;
                   return;
                }
Only in namedTargetSrc/net/minecraft/client/multiplayer: prediction
Only in namedSrc/net/minecraft/client/network: BlockUpdatePredictionManager.java
diff -bur namedTargetSrc/net/minecraft/client/network/ClientPlayerEntity.java namedSrc/net/minecraft/client/network/ClientPlayerEntity.java
--- namedTargetSrc/net/minecraft/client/network/ClientPlayerEntity.java	2023-10-17 03:08:50.762700413 +0000
+++ namedSrc/net/minecraft/client/network/ClientPlayerEntity.java	2023-10-17 03:07:16.983251016 +0000
@@ -668,8 +668,8 @@
     * @mapping {@literal named onRecipeDisplayed Lnet/minecraft/client/network/ClientPlayerEntity;onRecipeDisplayed(Lnet/minecraft/recipe/RecipeHolder;)V}
     */
    public void onRecipeDisplayed(RecipeHolder<?> recipeUnlocker) {
-      if (this.recipeBook.shouldDisplay(recipeUnlocker)) {
-         this.recipeBook.onRecipeDisplayed(recipeUnlocker);
+      if (this.recipeBook.shouldHighlight(recipeUnlocker)) {
+         this.recipeBook.finishHighlight(recipeUnlocker);
          this.networkHandler.send(new RecipeBookUpdateC2SPacket(recipeUnlocker));
       }
    }
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:50.678700910 +0000
+++ namedSrc/net/minecraft/client/network/ClientPlayerInteractionManager.java	2023-10-17 03:07:16.835251885 +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:50.814700106 +0000
+++ namedSrc/net/minecraft/client/network/ClientPlayNetworkHandler.java	2023-10-17 03:07:17.043250663 +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:50.778700318 +0000
+++ namedSrc/net/minecraft/client/world/ClientWorld.java	2023-10-17 03:07:17.003250898 +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:50.826700035 +0000
+++ namedSrc/net/minecraft/entity/ai/control/AquaticMoveControl.java	2023-10-17 03:07:17.051250616 +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:50.750700484 +0000
+++ namedSrc/net/minecraft/network/packet/c2s/play/PlayerActionC2SPacket.java	2023-10-17 03:07:16.963251133 +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:50.766700389 +0000
+++ namedSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithBlockC2SPacket.java	2023-10-17 03:07:16.991250969 +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:50.702700768 +0000
+++ namedSrc/net/minecraft/network/packet/c2s/play/PlayerInteractionWithItemC2SPacket.java	2023-10-17 03:07:16.859251744 +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:50.750700484 +0000
+++ namedSrc/net/minecraft/network/packet/s2c/play/BlockUpdateAcknowledgmentS2CPacket.java	2023-10-17 03:07:16.967251110 +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/recipe/book/RecipeBook.java namedSrc/net/minecraft/recipe/book/RecipeBook.java
--- namedTargetSrc/net/minecraft/recipe/book/RecipeBook.java	2023-10-17 03:08:50.746700508 +0000
+++ namedSrc/net/minecraft/recipe/book/RecipeBook.java	2023-10-17 03:07:16.955251180 +0000
@@ -90,17 +90,17 @@
 
    /**
     * @mapping {@literal hashed m_aqitkiku Lnet/minecraft/unmapped/C_bluodrzq;m_aqitkiku(Lnet/minecraft/unmapped/C_dscbrwbj;)Z}
-    * @mapping {@literal named shouldDisplay Lnet/minecraft/recipe/book/RecipeBook;shouldDisplay(Lnet/minecraft/recipe/RecipeHolder;)Z}
+    * @mapping {@literal named shouldHighlight Lnet/minecraft/recipe/book/RecipeBook;shouldHighlight(Lnet/minecraft/recipe/RecipeHolder;)Z}
     */
-   public boolean shouldDisplay(RecipeHolder<?> arg) {
+   public boolean shouldHighlight(RecipeHolder<?> arg) {
       return this.toBeDisplayed.contains(arg.id());
    }
 
    /**
     * @mapping {@literal hashed m_laevpnyc Lnet/minecraft/unmapped/C_bluodrzq;m_laevpnyc(Lnet/minecraft/unmapped/C_dscbrwbj;)V}
-    * @mapping {@literal named onRecipeDisplayed Lnet/minecraft/recipe/book/RecipeBook;onRecipeDisplayed(Lnet/minecraft/recipe/RecipeHolder;)V}
+    * @mapping {@literal named finishHighlight Lnet/minecraft/recipe/book/RecipeBook;finishHighlight(Lnet/minecraft/recipe/RecipeHolder;)V}
     */
-   public void onRecipeDisplayed(RecipeHolder<?> arg) {
+   public void finishHighlight(RecipeHolder<?> arg) {
       this.toBeDisplayed.remove(arg.id());
    }
 
@@ -108,14 +108,14 @@
     * Mapping not found
     */
    public void m_drzdihac(RecipeHolder<?> arg) {
-      this.display(arg.id());
+      this.queueForHighlight(arg.id());
    }
 
    /**
     * @mapping {@literal hashed m_dkodlkvz Lnet/minecraft/unmapped/C_bluodrzq;m_dkodlkvz(Lnet/minecraft/unmapped/C_ncpywfca;)V}
-    * @mapping {@literal named display Lnet/minecraft/recipe/book/RecipeBook;display(Lnet/minecraft/util/Identifier;)V}
+    * @mapping {@literal named queueForHighlight Lnet/minecraft/recipe/book/RecipeBook;queueForHighlight(Lnet/minecraft/util/Identifier;)V}
     */
-   protected void display(Identifier id) {
+   protected void queueForHighlight(Identifier id) {
       this.toBeDisplayed.add(id);
    }
 
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:50.746700508 +0000
+++ namedSrc/net/minecraft/server/network/ServerPlayNetworkHandler.java	2023-10-17 03:07:16.955251180 +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();
@@ -702,7 +702,7 @@
    @Override
    public void onRecipeBookUpdate(RecipeBookUpdateC2SPacket packet) {
       NetworkThreadUtils.forceMainThread(packet, this, this.player.getServerWorld());
-      this.server.getRecipeManager().get(packet.getRecipeId()).ifPresent(this.player.getRecipeBook()::onRecipeDisplayed);
+      this.server.getRecipeManager().get(packet.getRecipeId()).ifPresent(this.player.getRecipeBook()::finishHighlight);
    }
 
    /**
@@ -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);
       }
    }
 
diff -bur namedTargetSrc/net/minecraft/server/network/ServerRecipeBook.java namedSrc/net/minecraft/server/network/ServerRecipeBook.java
--- namedTargetSrc/net/minecraft/server/network/ServerRecipeBook.java	2023-10-17 03:08:50.834699987 +0000
+++ namedSrc/net/minecraft/server/network/ServerRecipeBook.java	2023-10-17 03:07:17.059250569 +0000
@@ -49,7 +49,7 @@
          Identifier lv2 = lv.id();
          if (!this.recipes.contains(lv2) && !lv.value().isIgnoredInRecipeBook()) {
             this.add(lv2);
-            this.display(lv2);
+            this.queueForHighlight(lv2);
             list.add(lv2);
             Criteria.RECIPE_UNLOCKED.trigger(player, lv);
             ++i;

Please sign in to comment.