Skip to content

Commit

Permalink
1.21.2 fix final (#676)
Browse files Browse the repository at this point in the history
* Enchantment and tool work (#585)

* complete components, text, and village

* shown in tooltip

* tooltip config

* Completed several enchantment-related classes and ToolComponent

* fixed typos and javadoc references

* refined/reworked some names, added javadoc formatting, fixed hasSpace -> hasSpaceBelow and params

* Update mappings/net/minecraft/entity/player/PlayerEntity.mapping

Fix typo

* requiresTool/doesRequireTool -> toolRequired/isToolRequired

---------

Co-authored-by: ix0rai <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Improved some `BoatEntity` mappings. (#586)

* Improved some `BoatEntity` mappings.
- `checkBoatInWater` -> `isInWater`; conventional and consistent with `Location.IN_WATER`
- `checkLocation` -> `updateLocation`; a bit of an odd one, `updateLandFractionAndGetLocation` would be a verbose literal name, I think `updateLocation` communicates that reasonably well

* Improved some `BoatEntity` mappings.
- `checkBoatInWater` -> `isInWater`; conventional and consistent with `Location.IN_WATER`
- `checkLocation` -> `updateLocation`; a bit of an odd one, `updateLandFractionAndGetLocation` would be a verbose literal name, I think `updateLocation` communicates that reasonably well
- `landFriction` -> `groundFriction`; to match `getGroundFriction`
I considered renaming all `ground` -> `land` in `BoatEntity` to be consistent with `Location.ON_LAND`, but `Entity.fall`'s `onGround` param traces back to a string, so they can't be completely reconciled, and `ground` is used more in other classes and I think is slightly better in most cases.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Improved some `BookEditScreen` and related names. (#587)

* fixed BookEditScreen #writeNbtData -> #updateBookComponent

* Improved some `BookEditScreen` and related names.
Notably:
- **fixed**  `#writeNbtData` -> `#updateBookComponent`
- `PageContent` -> `Display`; it's not just content, it's only used for the current page, and having fields of `String`s, `int`s, and this all called "pages" was confusing. Mojmap is `DisplayCache`, but the field that holds the current instance is the cache of this, the display.

* LecterScreenHandler #getBookItem -> #getBook

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix 'overrides final method' error

* update InteractionEntity's tracked data fields to match method name changes

---------

Co-authored-by: ix0rai <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 5, 2025
1 parent 09189ab commit 6cea6a9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mappings/net/minecraft/entity/InteractionEntity.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ CLASS net/minecraft/unmapped/C_hvnhlgso net/minecraft/entity/InteractionEntity
FIELD f_ckdsvier WIDTH_KEY Ljava/lang/String;
FIELD f_ctyumtqt interaction Lnet/minecraft/unmapped/C_hvnhlgso$C_nzivpjdf;
FIELD f_jzdfpkpp attack Lnet/minecraft/unmapped/C_hvnhlgso$C_nzivpjdf;
FIELD f_luxekrhz HEIGHT Lnet/minecraft/unmapped/C_rinmcaxy;
FIELD f_rmbogufh WIDTH Lnet/minecraft/unmapped/C_rinmcaxy;
FIELD f_luxekrhz INTERACTION_HEIGHT Lnet/minecraft/unmapped/C_rinmcaxy;
FIELD f_rmbogufh INTERACTION_WIDTH Lnet/minecraft/unmapped/C_rinmcaxy;
FIELD f_vvmxstjr INTERACTION_KEY Ljava/lang/String;
FIELD f_vxdufukm RESPONSE Lnet/minecraft/unmapped/C_rinmcaxy;
FIELD f_xnjxidmy ATTACK_KEY Ljava/lang/String;
FIELD f_ygkdbibs HEIGHT_KEY Ljava/lang/String;
FIELD f_ztmqbiqd RESPONSE_KEY Ljava/lang/String;
METHOD m_acettnna getDimensions ()Lnet/minecraft/unmapped/C_sszpscpo;
METHOD m_dyvbaohz getHeight ()F
METHOD m_mcajgzfg getWidth ()F
METHOD m_acettnna getInteractionDimensions ()Lnet/minecraft/unmapped/C_sszpscpo;
METHOD m_dyvbaohz getInteractionHeight ()F
METHOD m_mcajgzfg getInteractionWidth ()F
METHOD m_oeurfxnz setResponse (Z)V
ARG 1 response
METHOD m_stegizgr getResponse ()Z
METHOD m_uesbqavb setWidth (F)V
METHOD m_uesbqavb setInteractionWidth (F)V
ARG 1 width
METHOD m_yvnkyldm setHeight (F)V
METHOD m_yvnkyldm setInteractionHeight (F)V
ARG 1 height
CLASS C_nzivpjdf Interaction
FIELD f_dckrisox CODEC Lcom/mojang/serialization/Codec;
Expand Down

1 comment on commit 6cea6a9

@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 6cea6a9, 12 file(s) were updated with 52 line(s) added and 52 removed compared to the latest Quilt Mappings version.

View the diff here:
diff -bur namedTargetSrc/net/minecraft/client/gui/ParentElement.java namedSrc/net/minecraft/client/gui/ParentElement.java
--- namedTargetSrc/net/minecraft/client/gui/ParentElement.java	2025-01-05 01:41:20.479333344 +0000
+++ namedSrc/net/minecraft/client/gui/ParentElement.java	2025-01-05 01:40:10.663007654 +0000
@@ -153,7 +153,7 @@
     * Mapping not found
     */
    @Override
-   default void setFocused(boolean bl) {
+   default void setFocused(boolean focused) {
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java namedSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java
--- namedTargetSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java	2025-01-05 01:41:20.623333930 +0000
+++ namedSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java	2025-01-05 01:40:10.795008452 +0000
@@ -1506,9 +1506,9 @@
        * Mapping not found
        */
       @Override
-      public void setFocused(boolean bl) {
-         super.setFocused(bl);
-         this.button.setFocused(bl);
+      public void setFocused(boolean focused) {
+         super.setFocused(focused);
+         this.button.setFocused(focused);
       }
 
       /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/ClickableWidget.java namedSrc/net/minecraft/client/gui/widget/ClickableWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/ClickableWidget.java	2025-01-05 01:41:20.647334028 +0000
+++ namedSrc/net/minecraft/client/gui/widget/ClickableWidget.java	2025-01-05 01:40:10.827008646 +0000
@@ -447,8 +447,8 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      this.focused = bl;
+   public void setFocused(boolean focused) {
+      this.focused = focused;
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/DraggingWidget.java namedSrc/net/minecraft/client/gui/widget/DraggingWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/DraggingWidget.java	2025-01-05 01:41:20.483333360 +0000
+++ namedSrc/net/minecraft/client/gui/widget/DraggingWidget.java	2025-01-05 01:40:10.671007702 +0000
@@ -121,7 +121,7 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      ParentElement.super.setFocused(bl);
+   public void setFocused(boolean focused) {
+      ParentElement.super.setFocused(focused);
    }
 }
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/EditBoxWidget.java namedSrc/net/minecraft/client/gui/widget/EditBoxWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/EditBoxWidget.java	2025-01-05 01:41:20.599333832 +0000
+++ namedSrc/net/minecraft/client/gui/widget/EditBoxWidget.java	2025-01-05 01:40:10.775008332 +0000
@@ -342,9 +342,9 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      super.setFocused(bl);
-      if (bl) {
+   public void setFocused(boolean focused) {
+      super.setFocused(focused);
+      if (focused) {
          this.focusTime = Util.getMeasuringTimeMs();
       }
    }
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/HeaderBar.java namedSrc/net/minecraft/client/gui/widget/HeaderBar.java
--- namedTargetSrc/net/minecraft/client/gui/widget/HeaderBar.java	2025-01-05 01:41:20.703334256 +0000
+++ namedSrc/net/minecraft/client/gui/widget/HeaderBar.java	2025-01-05 01:40:10.883010756 +0000
@@ -122,10 +122,10 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      super.setFocused(bl);
+   public void setFocused(boolean focused) {
+      super.setFocused(focused);
       if (this.getFocused() != null) {
-         this.getFocused().setFocused(bl);
+         this.getFocused().setFocused(focused);
       }
    }
 
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java namedSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java	2025-01-05 01:41:20.383332952 +0000
+++ namedSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java	2025-01-05 01:40:10.563007049 +0000
@@ -908,7 +908,7 @@
        * @mapping {@literal named setFocused Lnet/minecraft/client/gui/widget/list/EntryListWidget$Entry;setFocused(Z)V}
        */
       @Override
-      public void setFocused(boolean bl) {
+      public void setFocused(boolean focused) {
       }
 
       /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java	2025-01-05 01:41:20.487333376 +0000
+++ namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java	2025-01-05 01:40:10.671007702 +0000
@@ -249,7 +249,7 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
+   public void setFocused(boolean focused) {
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java	2025-01-05 01:41:20.655334060 +0000
+++ namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java	2025-01-05 01:40:10.835008694 +0000
@@ -742,7 +742,7 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
+   public void setFocused(boolean focused) {
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/SliderWidget.java namedSrc/net/minecraft/client/gui/widget/SliderWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/SliderWidget.java	2025-01-05 01:41:20.371332903 +0000
+++ namedSrc/net/minecraft/client/gui/widget/SliderWidget.java	2025-01-05 01:40:10.551006977 +0000
@@ -151,9 +151,9 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      super.setFocused(bl);
-      if (!bl) {
+   public void setFocused(boolean focused) {
+      super.setFocused(focused);
+      if (!focused) {
          this.mutable = false;
       } else {
          InputType lv = MinecraftClient.getInstance().getLastInputType();
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/TextFieldWidget.java namedSrc/net/minecraft/client/gui/widget/TextFieldWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/TextFieldWidget.java	2025-01-05 01:41:20.407333050 +0000
+++ namedSrc/net/minecraft/client/gui/widget/TextFieldWidget.java	2025-01-05 01:40:10.591007219 +0000
@@ -736,10 +736,10 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      if (this.focusUnlocked || bl) {
-         super.setFocused(bl);
-         if (bl) {
+   public void setFocused(boolean focused) {
+      if (this.focusUnlocked || focused) {
+         super.setFocused(focused);
+         if (focused) {
             this.lastFocusTime = Util.getMeasuringTimeMs();
          }
       }
diff -bur namedTargetSrc/net/minecraft/entity/InteractionEntity.java namedSrc/net/minecraft/entity/InteractionEntity.java
--- namedTargetSrc/net/minecraft/entity/InteractionEntity.java	2025-01-05 01:41:20.423333115 +0000
+++ namedSrc/net/minecraft/entity/InteractionEntity.java	2025-01-05 01:40:10.607007316 +0000
@@ -37,14 +37,14 @@
    private static final Logger LOGGER = LogUtils.getLogger();
    /**
     * @mapping {@literal hashed f_rmbogufh Lnet/minecraft/unmapped/C_hvnhlgso;f_rmbogufh:Lnet/minecraft/unmapped/C_rinmcaxy;}
-    * @mapping {@literal named WIDTH Lnet/minecraft/entity/InteractionEntity;WIDTH:Lnet/minecraft/entity/data/TrackedData;}
+    * @mapping {@literal named INTERACTION_WIDTH Lnet/minecraft/entity/InteractionEntity;INTERACTION_WIDTH:Lnet/minecraft/entity/data/TrackedData;}
     */
-   private static final TrackedData<Float> WIDTH = DataTracker.registerData(InteractionEntity.class, TrackedDataHandlerRegistry.FLOAT);
+   private static final TrackedData<Float> INTERACTION_WIDTH = DataTracker.registerData(InteractionEntity.class, TrackedDataHandlerRegistry.FLOAT);
    /**
     * @mapping {@literal hashed f_luxekrhz Lnet/minecraft/unmapped/C_hvnhlgso;f_luxekrhz:Lnet/minecraft/unmapped/C_rinmcaxy;}
-    * @mapping {@literal named HEIGHT Lnet/minecraft/entity/InteractionEntity;HEIGHT:Lnet/minecraft/entity/data/TrackedData;}
+    * @mapping {@literal named INTERACTION_HEIGHT Lnet/minecraft/entity/InteractionEntity;INTERACTION_HEIGHT:Lnet/minecraft/entity/data/TrackedData;}
     */
-   private static final TrackedData<Float> HEIGHT = DataTracker.registerData(InteractionEntity.class, TrackedDataHandlerRegistry.FLOAT);
+   private static final TrackedData<Float> INTERACTION_HEIGHT = DataTracker.registerData(InteractionEntity.class, TrackedDataHandlerRegistry.FLOAT);
    /**
     * @mapping {@literal hashed f_vxdufukm Lnet/minecraft/unmapped/C_hvnhlgso;f_vxdufukm:Lnet/minecraft/unmapped/C_rinmcaxy;}
     * @mapping {@literal named RESPONSE Lnet/minecraft/entity/InteractionEntity;RESPONSE:Lnet/minecraft/entity/data/TrackedData;}
@@ -102,8 +102,8 @@
     */
    @Override
    protected void initDataTracker(DataTracker.Builder builder) {
-      builder.add(WIDTH, 1.0F);
-      builder.add(HEIGHT, 1.0F);
+      builder.add(INTERACTION_WIDTH, 1.0F);
+      builder.add(INTERACTION_HEIGHT, 1.0F);
       builder.add(RESPONSE, false);
    }
 
@@ -113,11 +113,11 @@
    @Override
    protected void readCustomDataFromNbt(NbtCompound nbt) {
       if (nbt.contains("width", NbtElement.NUMBER_TYPE)) {
-         this.setWidth(nbt.getFloat("width"));
+         this.setInteractionWidth(nbt.getFloat("width"));
       }
 
       if (nbt.contains("height", NbtElement.NUMBER_TYPE)) {
-         this.setHeight(nbt.getFloat("height"));
+         this.setInteractionHeight(nbt.getFloat("height"));
       }
 
       if (nbt.contains("attack")) {
@@ -147,8 +147,8 @@
     */
    @Override
    protected void writeCustomDataToNbt(NbtCompound nbt) {
-      nbt.putFloat("width", this.getWidth());
-      nbt.putFloat("height", this.getHeight());
+      nbt.putFloat("width", this.getInteractionWidth());
+      nbt.putFloat("height", this.getInteractionHeight());
       if (this.attack != null) {
          InteractionEntity.Interaction.CODEC.encodeStart(NbtOps.INSTANCE, this.attack).ifSuccess(arg2 -> nbt.put("attack", arg2));
       }
@@ -166,7 +166,7 @@
    @Override
    public void onTrackedDataSet(TrackedData<?> data) {
       super.onTrackedDataSet(data);
-      if (HEIGHT.equals(data) || WIDTH.equals(data)) {
+      if (INTERACTION_HEIGHT.equals(data) || INTERACTION_WIDTH.equals(data)) {
          this.calculateDimensions();
       }
    }
@@ -269,34 +269,34 @@
 
    /**
     * @mapping {@literal hashed m_uesbqavb Lnet/minecraft/unmapped/C_hvnhlgso;m_uesbqavb(F)V}
-    * @mapping {@literal named setWidth Lnet/minecraft/entity/InteractionEntity;setWidth(F)V}
+    * @mapping {@literal named setInteractionWidth Lnet/minecraft/entity/InteractionEntity;setInteractionWidth(F)V}
     */
-   private void setWidth(float width) {
-      this.dataTracker.set(WIDTH, width);
+   private void setInteractionWidth(float width) {
+      this.dataTracker.set(INTERACTION_WIDTH, width);
    }
 
    /**
     * @mapping {@literal hashed m_mcajgzfg Lnet/minecraft/unmapped/C_hvnhlgso;m_mcajgzfg()F}
-    * @mapping {@literal named getWidth Lnet/minecraft/entity/InteractionEntity;getWidth()F}
+    * @mapping {@literal named getInteractionWidth Lnet/minecraft/entity/InteractionEntity;getInteractionWidth()F}
     */
-   private float getWidth() {
-      return this.dataTracker.get(WIDTH);
+   private float getInteractionWidth() {
+      return this.dataTracker.get(INTERACTION_WIDTH);
    }
 
    /**
     * @mapping {@literal hashed m_yvnkyldm Lnet/minecraft/unmapped/C_hvnhlgso;m_yvnkyldm(F)V}
-    * @mapping {@literal named setHeight Lnet/minecraft/entity/InteractionEntity;setHeight(F)V}
+    * @mapping {@literal named setInteractionHeight Lnet/minecraft/entity/InteractionEntity;setInteractionHeight(F)V}
     */
-   private void setHeight(float height) {
-      this.dataTracker.set(HEIGHT, height);
+   private void setInteractionHeight(float height) {
+      this.dataTracker.set(INTERACTION_HEIGHT, height);
    }
 
    /**
     * @mapping {@literal hashed m_dyvbaohz Lnet/minecraft/unmapped/C_hvnhlgso;m_dyvbaohz()F}
-    * @mapping {@literal named getHeight Lnet/minecraft/entity/InteractionEntity;getHeight()F}
+    * @mapping {@literal named getInteractionHeight Lnet/minecraft/entity/InteractionEntity;getInteractionHeight()F}
     */
-   private float getHeight() {
-      return this.dataTracker.get(HEIGHT);
+   private float getInteractionHeight() {
+      return this.dataTracker.get(INTERACTION_HEIGHT);
    }
 
    /**
@@ -317,10 +317,10 @@
 
    /**
     * @mapping {@literal hashed m_acettnna Lnet/minecraft/unmapped/C_hvnhlgso;m_acettnna()Lnet/minecraft/unmapped/C_sszpscpo;}
-    * @mapping {@literal named getDimensions Lnet/minecraft/entity/InteractionEntity;getDimensions()Lnet/minecraft/entity/EntityDimensions;}
+    * @mapping {@literal named getInteractionDimensions Lnet/minecraft/entity/InteractionEntity;getInteractionDimensions()Lnet/minecraft/entity/EntityDimensions;}
     */
-   private EntityDimensions getDimensions() {
-      return EntityDimensions.changing(this.getWidth(), this.getHeight());
+   private EntityDimensions getInteractionDimensions() {
+      return EntityDimensions.changing(this.getInteractionWidth(), this.getInteractionHeight());
    }
 
    /**
@@ -328,7 +328,7 @@
     */
    @Override
    public EntityDimensions getDimensions(EntityPose pose) {
-      return this.getDimensions();
+      return this.getInteractionDimensions();
    }
 
    /**
@@ -336,7 +336,7 @@
     */
    @Override
    protected Box calculateBoundingBox() {
-      return this.getDimensions().getBoxAt(this.getPos());
+      return this.getInteractionDimensions().getBoxAt(this.getPos());
    }
 
    /**

Please sign in to comment.