PaperMC/patches/server/0222-Remove-unnecessary-itemmeta-handling.patch

31 lines
1.9 KiB
Diff
Raw Permalink Normal View History

2024-04-24 04:46:06 +02:00
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
2024-12-03 19:05:31 +01:00
index 1db50e72ad8e04e54bed9b462bd7276feb06ce4c..1e16482830556cf34f3b68fc2af8216663b075e4 100644
2024-04-24 04:46:06 +02:00
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
2024-12-03 19:05:31 +01:00
@@ -166,7 +166,7 @@ public final class ItemStack implements DataComponentHolder {
2024-04-24 04:46:06 +02:00
// 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;
2024-12-03 19:05:31 +01:00
@@ -180,8 +180,8 @@ public final class ItemStack implements DataComponentHolder {
2024-04-27 04:09:42 +02:00
} else {
2024-04-24 04:46:06 +02:00
registryfriendlybytebuf.writeVarInt(itemstack.getCount());
// Spigot start - filter
2024-04-27 04:09:42 +02:00
- itemstack = itemstack.copy();
2024-04-24 04:46:06 +02:00
- CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
2024-04-27 04:09:42 +02:00
+ // itemstack = itemstack.copy();
2024-04-24 04:46:06 +02:00
+ // 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
2024-04-27 00:08:35 +02:00
// Paper start - adventure; conditionally render translatable components