Skip to content

Commit 67d4a07

Browse files
committed
Fixing target chamber inner validation
1 parent 3dd10a0 commit 67d4a07

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/main/java/igentuman/nc/multiblock/particle_chamber/TargetChamberMultiblock.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,20 +226,20 @@ private void validateBeamLines() {
226226
}
227227

228228
private void indexInnerBlocks() {
229-
BlockPosInstance toCheck = new BlockPosInstance(initialPos());
229+
BlockPos thePos = initialPos().copy();
230+
debugLog("height="+height+" width="+width+" depth="+depth);
230231
for(int y = 1; y < height - 1; y++) {
231232
for (int x = 1; x < width - 1; x++) {
232233
for (int z = 1; z < depth - 1; z++) {
233-
switch (getMultiblockDirection().ordinal()) {
234-
case 3 -> toCheck.revert().east(x - leftCasing);
235-
case 5 -> toCheck.revert().north(x - leftCasing);
236-
case 2 -> toCheck.revert().west(x - leftCasing);
237-
case 4 -> toCheck.revert().south(x - leftCasing);
234+
switch (getControllerDirection().ordinal()) {
235+
case 3 -> thePos = initialPos().copy().east(x - leftCasing).above(y - bottomCasing).relative(getControllerDirection(), -z);
236+
case 5 -> thePos = initialPos().copy().north(x - leftCasing).above(y - bottomCasing).relative(getControllerDirection(), -z);
237+
case 2 -> thePos = initialPos().copy().west(x - leftCasing).above(y - bottomCasing).relative(getControllerDirection(), -z);
238+
case 4 -> thePos = initialPos().copy().south(x - leftCasing).above(y - bottomCasing).relative(getControllerDirection(), -z);
238239
}
239-
toCheck.above(y - bottomCasing).relative(getControllerDirection(), -z);
240-
if(!processInnerBlock(toCheck)) {
240+
if(!processInnerBlock(thePos)) {
241241
validationResult = ValidationResult.WRONG_INNER;
242-
errorBlockPos = new BlockPos(toCheck);
242+
errorBlockPos = new BlockPos(thePos);
243243
return;
244244
}
245245
}

0 commit comments

Comments
 (0)