From 515f2e7bebc4b292a49f50012dae19b72e7cb98a Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 27 Sep 2018 00:11:50 -0400 Subject: [PATCH] Ignore Dimension NBT field in Entity data Minecraft is trying to set Dimension Objects based on a Dimension ID Dimension ID's for custom worlds are dynamically allocate dand not guaranteed consistent. This removes checking the NBT data, as the Entity will always have its DimensionManager set to the world it is being placed into. This fixes corrupt entities breaking chunk saving in custom worlds. --- ...e-Dimension-NBT-field-in-Entity-data.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Spigot-Server-Patches/0380-Ignore-Dimension-NBT-field-in-Entity-data.patch diff --git a/Spigot-Server-Patches/0380-Ignore-Dimension-NBT-field-in-Entity-data.patch b/Spigot-Server-Patches/0380-Ignore-Dimension-NBT-field-in-Entity-data.patch new file mode 100644 index 0000000000..e10d4f78fc --- /dev/null +++ b/Spigot-Server-Patches/0380-Ignore-Dimension-NBT-field-in-Entity-data.patch @@ -0,0 +1,40 @@ +From e46e19ead9f4a448a08718c466bade12cb589794 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Thu, 27 Sep 2018 00:08:31 -0400 +Subject: [PATCH] Ignore Dimension NBT field in Entity data + +Minecraft is trying to set Dimension Objects based on a Dimension ID + +Dimension ID's for custom worlds are dynamically allocate dand not guaranteed +consistent. + +This removes checking the NBT data, as the Entity will always have its +DimensionManager set to the world it is being placed into. + +This fixes corrupt entities breaking chunk saving in custom worlds. + +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index cd601f29a3..0c18405a8d 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -1583,7 +1583,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + nbttagcompound.setShort("Fire", (short) this.fireTicks); + nbttagcompound.setShort("Air", (short) this.getAirTicks()); + nbttagcompound.setBoolean("OnGround", this.onGround); +- nbttagcompound.setInt("Dimension", this.dimension.getDimensionID()); ++ //nbttagcompound.setInt("Dimension", this.dimension.getDimensionID()); // Paper - always controlled by world + nbttagcompound.setBoolean("Invulnerable", this.invulnerable); + nbttagcompound.setInt("PortalCooldown", this.portalCooldown); + nbttagcompound.a("UUID", this.getUniqueID()); +@@ -1720,7 +1720,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + this.setAirTicks(nbttagcompound.getShort("Air")); + this.onGround = nbttagcompound.getBoolean("OnGround"); + if (nbttagcompound.hasKey("Dimension")) { +- this.dimension = DimensionManager.a(nbttagcompound.getInt("Dimension")); ++ //this.dimension = DimensionManager.a(nbttagcompound.getInt("Dimension")); // Paper - always controlled by world + } + + this.invulnerable = nbttagcompound.getBoolean("Invulnerable"); +-- +2.19.0 +