use of com.ldtteam.structures.blueprints.v1.Blueprint in project minecolonies by ldtteam.
the class AbstractSchematicProvider method unsafeUpdateTEDataFromSchematic.
/**
* Load the schematic data from the TE schematic name, if it's a reattempt, calculate the name from the building (backup).
* Might throw exceptions if data is invalid.
*/
private void unsafeUpdateTEDataFromSchematic(final TileEntityColonyBuilding te) {
final String structureName;
if (te.getSchematicName().isEmpty()) {
structureName = new StructureName(Structures.SCHEMATICS_PREFIX, style, this.getSchematicName() + Math.max(1, buildingLevel)).toString();
} else {
structureName = new StructureName(Structures.SCHEMATICS_PREFIX, style, te.getSchematicName()).toString();
}
final LoadOnlyStructureHandler structure = new LoadOnlyStructureHandler(colony.getWorld(), getPosition(), structureName, new PlacementSettings(), true);
final Blueprint blueprint = structure.getBluePrint();
blueprint.rotateWithMirror(BlockPosUtil.getRotationFromRotations(getRotation()), isMirrored() ? Mirror.FRONT_BACK : Mirror.NONE, colony.getWorld());
final BlockInfo info = blueprint.getBlockInfoAsMap().getOrDefault(blueprint.getPrimaryBlockOffset(), null);
if (info.getTileEntityData() != null) {
te.readSchematicDataFromNBT(info.getTileEntityData());
}
}
use of com.ldtteam.structures.blueprints.v1.Blueprint in project minecolonies by ldtteam.
the class AbstractEntityAIStructure method fillItemsList.
/**
* Fill the list of the item positions to gather.
*/
@Override
public void fillItemsList() {
worker.getCitizenStatusHandler().setLatestStatus(new TranslationTextComponent("com.minecolonies.coremod.status.gathering"));
if (!structurePlacer.getB().hasBluePrint()) {
return;
}
final Blueprint blueprint = structurePlacer.getB().getBluePrint();
final BlockPos leftCorner = structurePlacer.getB().getWorldPos().subtract(blueprint.getPrimaryBlockOffset());
searchForItems(new AxisAlignedBB(leftCorner, leftCorner.offset(blueprint.getSizeX(), blueprint.getSizeY(), blueprint.getSizeZ())));
}
Aggregations