use of net.glowstone.generator.structures.GlowStructurePiece in project Glowstone by GlowstoneMC.
the class StructureStore method save.
/**
* Save information about this structure to the given tag.
*
* @param structure The structure to save.
* @param compound The target tag.
*/
public void save(T structure, CompoundTag compound) {
StructureBoundingBox boundingBox = structure.getBoundingBox();
int[] bb = new int[6];
bb[0] = boundingBox.getMin().getBlockX();
bb[1] = boundingBox.getMin().getBlockY();
bb[2] = boundingBox.getMin().getBlockZ();
bb[3] = boundingBox.getMax().getBlockX();
bb[4] = boundingBox.getMax().getBlockY();
bb[5] = boundingBox.getMax().getBlockZ();
compound.putIntArray("BB", bb);
List<CompoundTag> children = new ArrayList<>();
for (GlowStructurePiece piece : structure.getPieces()) {
CompoundTag tag = new CompoundTag();
StructurePieceStorage.saveStructurePiece(piece, tag);
children.add(tag);
}
compound.putCompoundList("Children", children);
}
Aggregations