mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 20:52:12 -07:00
Reset component prototype on itemtype change
This commit is contained in:
@@ -3,7 +3,25 @@ From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|||||||
Date: Sat, 27 Apr 2024 20:56:17 -0700
|
Date: Sat, 27 Apr 2024 20:56:17 -0700
|
||||||
Subject: [PATCH] General ItemMeta fixes
|
Subject: [PATCH] General ItemMeta fixes
|
||||||
|
|
||||||
|
== AT ==
|
||||||
|
private-f net/minecraft/world/item/ItemStack components
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
|
@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
|
public void setItem(Item item) {
|
||||||
|
this.bukkitStack = null; // Paper
|
||||||
|
this.item = item;
|
||||||
|
+ // Paper start - change base component prototype
|
||||||
|
+ final DataComponentPatch patch = this.getComponentsPatch();
|
||||||
|
+ this.components = new PatchedDataComponentMap(this.item.components());
|
||||||
|
+ this.applyComponents(patch);
|
||||||
|
+ // Paper end - change base component prototype
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||||
|
Reference in New Issue
Block a user