From 9a21b0b89ebf7810b6cfb5a5cd7ef4f1a6e0843a Mon Sep 17 00:00:00 2001 From: Parker Hawke Date: Thu, 15 Jun 2023 20:25:35 +1000 Subject: [PATCH] SPIGOT-7393: Fix new tile entities not loading Bukkit's PersistentDataContainer --- .../level/block/entity/BrushableBlockEntity.patch | 8 ++++++++ .../block/entity/ChiseledBookShelfBlockEntity.patch | 12 ++++++++++-- .../block/entity/SculkCatalystBlockEntity.patch | 7 ++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/nms-patches/net/minecraft/world/level/block/entity/BrushableBlockEntity.patch b/nms-patches/net/minecraft/world/level/block/entity/BrushableBlockEntity.patch index a2fe021cb..b49f70712 100644 --- a/nms-patches/net/minecraft/world/level/block/entity/BrushableBlockEntity.patch +++ b/nms-patches/net/minecraft/world/level/block/entity/BrushableBlockEntity.patch @@ -25,3 +25,11 @@ this.item = ItemStack.EMPTY; } +@@ -230,6 +239,7 @@ + + @Override + public void load(NBTTagCompound nbttagcompound) { ++ super.load(nbttagcompound); // CraftBukkit - SPIGOT-7393: Load super Bukkit data + if (!this.tryLoadLootTable(nbttagcompound) && nbttagcompound.contains("item")) { + this.item = ItemStack.of(nbttagcompound.getCompound("item")); + } diff --git a/nms-patches/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.patch b/nms-patches/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.patch index d96970439..b8eda8ce9 100644 --- a/nms-patches/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.patch +++ b/nms-patches/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.patch @@ -55,7 +55,15 @@ public ChiseledBookShelfBlockEntity(BlockPosition blockposition, IBlockData iblockdata) { super(TileEntityTypes.CHISELED_BOOKSHELF, blockposition, iblockdata); -@@ -106,7 +148,7 @@ +@@ -50,6 +92,7 @@ + + @Override + public void load(NBTTagCompound nbttagcompound) { ++ super.load(nbttagcompound); // CraftBukkit - SPIGOT-7393: Load super Bukkit data + this.items.clear(); + ContainerUtil.loadAllItems(nbttagcompound, this.items); + this.lastInteractedSlot = nbttagcompound.getInt("last_interacted_slot"); +@@ -106,7 +149,7 @@ public void setItem(int i, ItemStack itemstack) { if (itemstack.is(TagsItem.BOOKSHELF_BOOKS)) { this.items.set(i, itemstack); @@ -64,7 +72,7 @@ } } -@@ -120,7 +162,7 @@ +@@ -120,7 +163,7 @@ @Override public int getMaxStackSize() { diff --git a/nms-patches/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.patch b/nms-patches/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.patch index 7a6c34dce..24b71f33a 100644 --- a/nms-patches/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.patch +++ b/nms-patches/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java +++ b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java -@@ -35,7 +35,9 @@ +@@ -35,11 +35,14 @@ } public static void serverTick(World world, BlockPosition blockposition, IBlockData iblockdata, SculkCatalystBlockEntity sculkcatalystblockentity) { @@ -10,3 +10,8 @@ } @Override + public void load(NBTTagCompound nbttagcompound) { ++ super.load(nbttagcompound); // CraftBukkit - SPIGOT-7393: Load super Bukkit data + this.catalystListener.sculkSpreader.load(nbttagcompound); + } +