aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0226-Remove-unnecessary-itemmeta-handling.patch
blob: 6a2f490da8a9692cf6c54cd91a5e67ad7f5afcad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 22 Nov 2016 00:40:42 -0500
Subject: [PATCH] Remove unnecessary itemmeta handling


diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index abf502b8395bb0a8a32c1fdcd62532790deb1c6e..f53ce5f063d3b7b8d3f6a3bc1165d1788c112e6d 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -165,7 +165,7 @@ public final class ItemStack implements DataComponentHolder {
 
                 // CraftBukkit start
                 ItemStack itemstack = new ItemStack(holder, i, datacomponentpatch);
-                if (!datacomponentpatch.isEmpty()) {
+                if (false && !datacomponentpatch.isEmpty()) { // Paper - This is no longer needed with raw NBT being handled in metadata
                     CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
                 }
                 return itemstack;
@@ -179,8 +179,8 @@ public final class ItemStack implements DataComponentHolder {
             } else {
                 registryfriendlybytebuf.writeVarInt(itemstack.getCount());
                 // Spigot start - filter
-                itemstack = itemstack.copy();
-                CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
+                // itemstack = itemstack.copy();
+                // CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); // Paper - This is no longer with raw NBT being handled in metadata
                 // Spigot end
                 ITEM_STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.getItemHolder()); // CraftBukkit - decompile error
                 // Paper start - adventure; conditionally render translatable components