mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 00:42:05 +01:00
SPIGOT-7393: Fix new tile entities not loading Bukkit's PersistentDataContainer
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
parent
ece42b939b
commit
5480af2bba
3 changed files with 24 additions and 3 deletions
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue