Deprecate ItemStack#setType & add ItemStack#withType (#10290)

This commit is contained in:
Owen1212055
2024-04-12 17:16:22 -04:00
parent 9e05b17b92
commit 14b0751f02
9 changed files with 229 additions and 4 deletions

View File

@@ -7907,6 +7907,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return asNMSCopy(bukkit);
+ }
+ }
+
+ public static net.minecraft.world.item.ItemStack getOrCloneOnMutation(ItemStack old, ItemStack newInstance) {
+ return old == newInstance ? unwrap(old) : asNMSCopy(newInstance);
+ }
+ // Paper end - MC Utils
+
public static net.minecraft.world.item.ItemStack asNMSCopy(ItemStack original) {