diff --git a/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShape.java b/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShape.java index 6f84be096..9c9c168f6 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShape.java +++ b/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShape.java @@ -54,6 +54,22 @@ public record BlockShape(SimpleCuboid ...shapes) { return this; } + public BlockShape rotateInv(Direction dir) { + if (dir == Direction.SOUTH) + return rotateAroundY(Math.PI); + + if (dir == Direction.NORTH) + return this; + + if (dir == Direction.WEST) + return rotateAroundY(-Math.PI / 2d); + + if (dir == Direction.EAST) + return rotateAroundY(Math.PI / 2d); + + return this; + } + public VoxelShape computeShape() { VoxelShape final_shape = shapes[0].getShape(); diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt index 8bd2eb590..798787de6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt @@ -89,7 +89,7 @@ class BlockEnergyCounter : BlockMattery(), EntityBlock { } if (input === Direction.UP || input === Direction.DOWN) { - shape = shape.rotate(iface) + shape = shape.rotateInv(iface) } else if (input === Direction.EAST || input === Direction.WEST) { when (iface) { Direction.DOWN -> shape = shape.rotateAroundX(-Math.PI / 2)