diff --git a/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch index 420d5f5297..7ff7a9abf4 100644 --- a/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch @@ -16,6 +16,23 @@ diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java +@@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper + public TileEntity(TileEntityTypes<?> tileentitytypes) { + this.position = BlockPosition.ZERO; + this.tileType = tileentitytypes; ++ persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY); // Paper - always init + } + + // Paper start +@@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper + public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) { + this.position = new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")); + // CraftBukkit start - read container +- this.persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY); ++ this.persistentDataContainer.clear(); // Paper - clear instead of reinit + + NBTTagCompound persistentDataTag = nbttagcompound.getCompound("PublicBukkitValues"); + if (persistentDataTag != null) { @@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper } @@ -130,3 +147,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java ++++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +@@ -0,0 +0,0 @@ public final class CraftPersistentDataContainer implements PersistentDataContain + public Map<String, Object> serialize() { + return (Map<String, Object>) CraftNBTTagConfigSerializer.serialize(toTagCompound()); + } ++ ++ // Paper start ++ public void clear() { ++ this.customDataTags.clear(); ++ } ++ // Paper end + }