mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Reset component prototype on itemtype change
This commit is contained in:
parent
c82479dc52
commit
9987c3cb96
1 changed files with 18 additions and 0 deletions
|
@ -3,7 +3,25 @@ From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|||
Date: Sat, 27 Apr 2024 20:56:17 -0700
|
||||
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
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
|
|
Loading…
Add table
Reference in a new issue