Remove unnecessary itemmeta handling

This commit is contained in:
Aikar 2016-11-22 00:40:42 -05:00
parent 394e4c04f7
commit 223c6c3b5a

View File

@ -100,7 +100,7 @@
- return new ItemStack(holder, i, datacomponentpatch);
+ // 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;
@ -116,8 +116,8 @@
registryfriendlybytebuf.writeVarInt(itemstack.getCount());
- null.ITEM_STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.getItemHolder());
+ // 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