diff --git a/src/main/java/net/minecraft/world/chunk/Chunk.java b/src/main/java/net/minecraft/world/chunk/Chunk.java index 42a5876..fb6c30d 100644 --- a/src/main/java/net/minecraft/world/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/chunk/Chunk.java @@ -54,6 +54,7 @@ import org.ultramine.server.chunk.ChunkHash; import org.ultramine.server.chunk.IChunkDependency; import org.ultramine.server.chunk.PendingBlockUpdate; +import org.ultramine.server.event.WorldUpdateObject; import org.ultramine.server.event.WorldUpdateObjectType; public class Chunk implements IChunkDependency @@ -881,13 +882,16 @@ // This vanilla code restores broken TileEntities. Invokes only on TileEntity GET. // Newly created TileEntity should not be attached to WorldUpdateObject that invokes this method. // So using this hack to override and then restore WorldUpdateObject - WorldUpdateObjectType type = worldObj.getEventProxy().getUpdateObject().getType(); - worldObj.getEventProxy().pushState(WorldUpdateObjectType.UNKNOWN); + WorldUpdateObject obj = worldObj.getEventProxy().getUpdateObject(); + WorldUpdateObjectType type = obj == null ? null : obj.getType(); + if(type != null) + worldObj.getEventProxy().pushState(WorldUpdateObjectType.UNKNOWN); tileentity = block.createTileEntity(worldObj, meta); this.worldObj.setTileEntity(this.xPosition * 16 + p_150806_1_, p_150806_2_, this.zPosition * 16 + p_150806_3_, tileentity); - worldObj.getEventProxy().pushState(type); + if(type != null) + worldObj.getEventProxy().pushState(type); } return tileentity;