From 1e8c2a9acfd48070161afb46e0fcbac3ae4f7c70 Mon Sep 17 00:00:00 2001 From: iChun Date: Sat, 24 Nov 2012 16:27:17 +0800 Subject: [PATCH] Add check that Entity saves to disk before saving entity to saved chunkloading data. Returning false to addEntityID prevents the entity from being saved (cred to LexManos) Entities which do not save to disk but are chunkloaders causes errors the next time the world loads. This ought to fix it. --- common/net/minecraftforge/common/ForgeChunkManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/net/minecraftforge/common/ForgeChunkManager.java b/common/net/minecraftforge/common/ForgeChunkManager.java index dead72995..1d2e296bb 100644 --- a/common/net/minecraftforge/common/ForgeChunkManager.java +++ b/common/net/minecraftforge/common/ForgeChunkManager.java @@ -744,7 +744,7 @@ public class ForgeChunkManager { ticket.setCompoundTag("ModData", tick.modData); } - if (tick.ticketType == Type.ENTITY && tick.entity != null) + if (tick.ticketType == Type.ENTITY && tick.entity != null && tick.entity.addEntityID(new NBTTagCompound())) { ticket.setInteger("chunkX", MathHelper.floor_double(tick.entity.chunkCoordX)); ticket.setInteger("chunkZ", MathHelper.floor_double(tick.entity.chunkCoordZ));