fix asset id

This commit is contained in:
Lulu13022002 2024-12-04 20:01:17 +01:00
parent 68e1550ec9
commit 02ae3f591b
2 changed files with 6 additions and 6 deletions

View file

@ -1307,13 +1307,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Builder equipSound(Key sound);
+
+ /**
+ * Sets the model key for this item.
+ * Sets the asset id for this item.
+ *
+ * @param model the model key, nullable
+ * @param assetId the asset id, nullable
+ * @return the builder for chaining
+ */
+ @Contract(value = "_ -> this", mutates = "this")
+ Builder assetId(@Nullable Key model);
+ Builder assetId(@Nullable Key assetId);
+
+ /**
+ * Sets the camera overlay key for this item.

View file

@ -1376,8 +1376,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public Builder assetId(final @Nullable Key model) {
+ this.assetId = Optional.ofNullable(model)
+ public Builder assetId(final @Nullable Key assetId) {
+ this.assetId = Optional.ofNullable(assetId)
+ .map(key -> PaperAdventure.asVanilla(EquipmentAssets.ROOT_ID, key));
+
+ return this;
@ -1422,7 +1422,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ new net.minecraft.world.item.equipment.Equippable(
+ this.equipmentSlot,
+ this.equipSound,
+ null, // TODO
+ this.assetId,
+ this.cameraOverlay,
+ this.allowedEntities,
+ this.dispensable,