@@ -165,8 +165,8 @@ public static void showPreview(BlockPos pos, MultiblockControllerMachine control
165165 offset = switch (front ) {
166166 case NORTH , UP , DOWN -> offset .rotate (Rotation .NONE );
167167 case SOUTH -> offset .rotate (Rotation .CLOCKWISE_180 );
168- case WEST -> offset .rotate (Rotation .COUNTERCLOCKWISE_90 );
169- case EAST -> offset .rotate (Rotation .CLOCKWISE_90 );
168+ case EAST -> offset .rotate (Rotation .COUNTERCLOCKWISE_90 );
169+ case WEST -> offset .rotate (Rotation .CLOCKWISE_90 );
170170 };
171171
172172 Rotation r = up == Direction .NORTH ? Rotation .NONE : up == Direction .EAST ? Rotation .CLOCKWISE_90 :
@@ -217,32 +217,36 @@ public static void showPreview(BlockPos pos, MultiblockControllerMachine control
217217 private static BlockPos rotateByFrontAxis (BlockPos pos , Direction front , Rotation rotation ) {
218218 if (front .getAxis () == Direction .Axis .X ) {
219219 return switch (rotation ) {
220- default -> pos ;
221- case CLOCKWISE_90 -> new BlockPos (pos .getX (), -front .getAxisDirection ().getStep () * pos .getZ (),
222- - front .getAxisDirection ().getStep () * -pos .getY ());
223- case CLOCKWISE_180 -> new BlockPos (pos .getX (), -pos .getY (), - pos .getZ ());
224- case COUNTERCLOCKWISE_90 -> new BlockPos (pos .getX (), front .getAxisDirection ().getStep () * pos .getZ (),
225- - front .getAxisDirection ().getStep () * pos .getY ());
220+ default -> new BlockPos (- pos . getX (), pos . getY (), - pos . getZ ()) ;
221+ case CLOCKWISE_90 -> new BlockPos (- pos .getX (), -front .getAxisDirection ().getStep () * pos .getZ (),
222+ front .getAxisDirection ().getStep () * -pos .getY ());
223+ case CLOCKWISE_180 -> new BlockPos (- pos .getX (), -pos .getY (), pos .getZ ());
224+ case COUNTERCLOCKWISE_90 -> new BlockPos (- pos .getX (), front .getAxisDirection ().getStep () * pos .getZ (),
225+ front .getAxisDirection ().getStep () * pos .getY ());
226226 };
227227 } else if (front .getAxis () == Direction .Axis .Y ) {
228228 return switch (rotation ) {
229- default -> new BlockPos (-pos .getX (), -front .getAxisDirection ().getStep () * pos .getZ (),
230- -front .getAxisDirection ().getStep () * pos .getY ());
231- case CLOCKWISE_90 -> new BlockPos (-front .getAxisDirection ().getStep () * pos .getY (),
232- -front .getAxisDirection ().getStep () * pos .getZ (), pos .getX ());
233- case CLOCKWISE_180 -> new BlockPos (pos .getX (), -front .getAxisDirection ().getStep () * pos .getZ (),
234- front .getAxisDirection ().getStep () * pos .getY ());
235- case COUNTERCLOCKWISE_90 -> new BlockPos (front .getAxisDirection ().getStep () * pos .getY (),
236- -front .getAxisDirection ().getStep () * pos .getZ (), -pos .getX ());
229+ default -> new BlockPos (-front .getAxisDirection ().getStep () * pos .getX (),
230+ -front .getAxisDirection ().getStep () * pos .getZ (),
231+ -pos .getY ());
232+ case CLOCKWISE_90 -> new BlockPos (pos .getY (),
233+ -front .getAxisDirection ().getStep () * pos .getZ (),
234+ -front .getAxisDirection ().getStep () * pos .getX ());
235+ case CLOCKWISE_180 -> new BlockPos (front .getAxisDirection ().getStep () * pos .getX (),
236+ -front .getAxisDirection ().getStep () * pos .getZ (),
237+ pos .getY ());
238+ case COUNTERCLOCKWISE_90 -> new BlockPos (-pos .getY (),
239+ -front .getAxisDirection ().getStep () * pos .getZ (),
240+ front .getAxisDirection ().getStep () * pos .getX ());
237241 };
238242 } else if (front .getAxis () == Direction .Axis .Z ) {
239243 return switch (rotation ) {
240244 default -> pos ;
241- case CLOCKWISE_90 -> new BlockPos (-front .getAxisDirection ().getStep () * pos .getY (),
242- front .getAxisDirection ().getStep () * pos .getX (), pos .getZ ());
243- case CLOCKWISE_180 -> new BlockPos (-pos .getX (), -pos .getY (), pos .getZ ());
244- case COUNTERCLOCKWISE_90 -> new BlockPos (-front .getAxisDirection ().getStep () * -pos .getY (),
245+ case CLOCKWISE_90 -> new BlockPos (front .getAxisDirection ().getStep () * pos .getY (),
245246 -front .getAxisDirection ().getStep () * pos .getX (), pos .getZ ());
247+ case CLOCKWISE_180 -> new BlockPos (-pos .getX (), -pos .getY (), pos .getZ ());
248+ case COUNTERCLOCKWISE_90 -> new BlockPos (front .getAxisDirection ().getStep () * -pos .getY (),
249+ front .getAxisDirection ().getStep () * pos .getX (), pos .getZ ());
246250 };
247251 }
248252 return pos ;
0 commit comments