use of org.pepsoft.minecraft.ChunkImpl2 in project WorldPainter by Captain-Chaos.
the class DumpEntities method main.
public static void main(String[] args) throws IOException {
File worldDir = new File(args[0]);
File[] regionFiles = new File(worldDir, "region").listFiles();
for (File file : regionFiles) {
RegionFile regionFile = new RegionFile(file);
try {
for (int x = 0; x < 32; x++) {
for (int z = 0; z < 32; z++) {
if (regionFile.containsChunk(x, z)) {
CompoundTag tag;
try (NBTInputStream in = new NBTInputStream(regionFile.getChunkDataInputStream(x, z))) {
tag = (CompoundTag) in.readTag();
}
ChunkImpl2 chunk = new ChunkImpl2(tag, 256);
/*&& (((Painting) entity).getTileX() == 40) && (((Painting) entity).getTileZ() == 31)*/
chunk.getEntities().stream().filter(entity -> (entity instanceof Painting)).forEach(System.out::println);
}
}
}
} finally {
regionFile.close();
}
}
}
Aggregations