def addTileEntity(self, ref): x, y, z = ref.Position cx, cz = chunk_pos(x, z) chunk = self.getChunk(cx, cz, create=True) existing = [old for old in chunk.TileEntities if old.Position == (x, y, z)] for e in existing: chunk.removeTileEntity(e) chunk.addTileEntity(ref.copy())
def addEntity(self, ref): x, y, z = ref.Position cx, cz = chunk_pos(x, z) chunk = self.getChunk(cx, cz, create=True) chunk.addEntity(ref.copy())