summaryrefslogtreecommitdiffstats
path: root/nms-patches/PacketDataSerializer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/PacketDataSerializer.patch')
-rw-r--r--nms-patches/PacketDataSerializer.patch12
1 files changed, 6 insertions, 6 deletions
diff --git a/nms-patches/PacketDataSerializer.patch b/nms-patches/PacketDataSerializer.patch
index 00bc7794..d257ef48 100644
--- a/nms-patches/PacketDataSerializer.patch
+++ b/nms-patches/PacketDataSerializer.patch
@@ -30,21 +30,21 @@
@@ -232,7 +234,7 @@
}
- public PacketDataSerializer a(@Nullable ItemStack itemstack) {
-- if (itemstack == null) {
-+ if (itemstack == null || itemstack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
+ public PacketDataSerializer a(ItemStack itemstack) {
+- if (itemstack.isEmpty()) {
++ if (itemstack.isEmpty() || itemstack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
this.writeShort(-1);
} else {
this.writeShort(Item.getId(itemstack.getItem()));
@@ -261,6 +263,11 @@
+ ItemStack itemstack = new ItemStack(Item.getById(short0), b0, short1);
- itemstack = new ItemStack(Item.getById(short0), b0, short1);
itemstack.setTag(this.j());
+ // CraftBukkit start
+ if (itemstack.getTag() != null) {
+ CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
+ }
+ // CraftBukkit end
+ return itemstack;
}
-
- return itemstack;
+ }