Fix wrong rotation along y axis of energy counter

This commit is contained in:
DBotThePony 2022-01-09 15:12:27 +07:00
parent 4b4e219a51
commit 90d6e85207
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 17 additions and 1 deletions

View File

@ -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();

View File

@ -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)