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.
This commit is contained in:
iChun 2012-11-24 16:27:17 +08:00
parent 9a1c12c492
commit 1e8c2a9acf

View file

@ -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));