use of buildcraft.lib.misc.data.BoxIterator in project BuildCraft by BuildCraft.
the class TileQuarry method getDebugInfo.
@Override
public void getDebugInfo(List<String> left, List<String> right, EnumFacing side) {
left.add("battery = " + battery.getDebugString());
left.add("rate = " + LocaleUtil.localizeMjFlow(debugPowerRate));
left.add("frameBox");
left.add(" - min = " + frameBox.min());
left.add(" - max = " + frameBox.max());
left.add("miningBox:");
left.add(" - min = " + miningBox.min());
left.add(" - max = " + miningBox.max());
left.add("firstCheckedPoses = " + firstCheckedPoses.size());
left.add("frameBoxPosesCount = " + frameBoxPosesCount);
BoxIterator iter = boxIterator;
left.add("current = " + (iter == null ? "null" : iter.getCurrent()));
Task task = currentTask;
if (task != null) {
left.add("task:");
left.add(" - class = " + task.getClass().getName());
left.add(" - power = " + LocaleUtil.localizeMj(task.power));
left.add(" - target = " + LocaleUtil.localizeMj(task.getTarget()));
} else {
left.add("task = null");
}
left.add("drill = " + drillPos);
}
use of buildcraft.lib.misc.data.BoxIterator in project BuildCraft by BuildCraft.
the class TileArchitectTable method scanSingleBlock.
private void scanSingleBlock() {
BlockPos size = box.size();
if (templateScannedBlocks == null || blueprintScannedData == null) {
boxIterator = new BoxIterator(box, EnumAxisOrder.XZY.getMinToMaxOrder(), true);
templateScannedBlocks = new BitSet(Snapshot.getDataSize(size));
blueprintScannedData = new int[Snapshot.getDataSize(size)];
}
// Read from world
BlockPos worldScanPos = boxIterator.getCurrent();
BlockPos schematicPos = worldScanPos.subtract(box.min());
if (snapshotType == EnumSnapshotType.TEMPLATE) {
templateScannedBlocks.set(Snapshot.posToIndex(box.size(), schematicPos), !world.isAirBlock(worldScanPos));
}
if (snapshotType == EnumSnapshotType.BLUEPRINT) {
ISchematicBlock schematicBlock = readSchematicBlock(worldScanPos);
int index = blueprintScannedPalette.indexOf(schematicBlock);
if (index == -1) {
index = blueprintScannedPalette.size();
blueprintScannedPalette.add(schematicBlock);
}
blueprintScannedData[Snapshot.posToIndex(box.size(), schematicPos)] = index;
}
createAndSendMessage(NET_SCAN, buffer -> MessageUtil.writeBlockPos(buffer, worldScanPos));
sendNetworkUpdate(NET_RENDER_DATA);
// Move scanPos along
boxIterator.advance();
if (boxIterator.hasFinished()) {
scanning = false;
boxIterator = null;
}
}
Aggregations