List<CompoundTag> storedTileEntities = levelTag.getCompoundList("TileEntities");
for (CompoundTag tileEntityTag : storedTileEntities) {
int tx = tileEntityTag.getInt("x");
int ty = tileEntityTag.getInt("y");
int tz = tileEntityTag.getInt("z");
TileEntity tileEntity = chunk.getEntity(tx & 0xf, ty, tz & 0xf);
if (tileEntity != null) {
try {
tileEntity.loadNbt(tileEntityTag);
} catch (Exception ex) {
GlowServer.logger.log(Level.SEVERE, "Error loading TileEntity at " + tileEntity.getBlock(), ex);
}
} else {
GlowServer.logger.warning("No tile entity at " + chunk.getWorld() + "," + tx + "," + ty + "," + tz);
}
}