use of net.minecraft.world.chunk.storage.RegionFile in project BluePower by Qmunity.
the class WorldConverter method convertRegion.
private void convertRegion(File file) {
RegionFile reg = new RegionFile(file);
for (int x = 0; x < 32; x++) {
for (int z = 0; z < 32; z++) {
NBTTagCompound chunk = getChunk(reg, x, z);
if (chunk == null)
continue;
NBTTagList tileEntities = chunk.getTagList("TileEntities", new NBTTagCompound().getId());
boolean changed = false;
for (int i = 0; i < tileEntities.tagCount(); i++) {
NBTTagCompound te = tileEntities.getCompoundTagAt(i);
if (te.getString("id").equals("savedMultipart"))
changed |= convertTile(te);
}
if (changed)
saveChunk(reg, x, z, chunk);
}
}
try {
reg.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations