Skip to content

Commit f1742c5

Browse files
committed
Respect rotations in ShapeMatcher build multiblock method
1 parent 5062c9a commit f1742c5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/aztech/modern_industrialization/machines/multiblocks/ShapeMatcher.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
package aztech.modern_industrialization.machines.multiblocks;
2525

26+
import aztech.modern_industrialization.machines.multiblocks.structure.member.StructureMember;
2627
import aztech.modern_industrialization.machines.multiblocks.world.ChunkEventListener;
2728
import aztech.modern_industrialization.machines.multiblocks.world.ChunkEventListeners;
2829
import java.util.ArrayList;
@@ -247,9 +248,14 @@ public int buildMultiblock(Level level) {
247248
int setBlocks = 0;
248249

249250
for (var entry : simpleMembers.entrySet()) {
250-
var current = level.getBlockState(entry.getKey()); // TODO SWEDZ: account for rotation
251+
BlockPos pos = entry.getKey();
252+
var current = level.getBlockState(pos);
251253
if (!entry.getValue().matchesState(current)) {
252-
level.setBlockAndUpdate(entry.getKey(), entry.getValue().getPreviewState()); // TODO SWEDZ: account for rotation
254+
BlockState state = entry.getValue().getPreviewState();
255+
if (entry.getValue() instanceof StructureMember) {
256+
state = toWorldState(level, pos, state, controllerDirection);
257+
}
258+
level.setBlockAndUpdate(pos, state);
253259
++setBlocks;
254260
}
255261
}

0 commit comments

Comments
 (0)