Fix wrong rotation along y axis of energy counter
This commit is contained in:
parent
4b4e219a51
commit
90d6e85207
@ -54,6 +54,22 @@ public record BlockShape(SimpleCuboid ...shapes) {
|
|||||||
return this;
|
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() {
|
public VoxelShape computeShape() {
|
||||||
VoxelShape final_shape = shapes[0].getShape();
|
VoxelShape final_shape = shapes[0].getShape();
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ class BlockEnergyCounter : BlockMattery(), EntityBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (input === Direction.UP || input === Direction.DOWN) {
|
if (input === Direction.UP || input === Direction.DOWN) {
|
||||||
shape = shape.rotate(iface)
|
shape = shape.rotateInv(iface)
|
||||||
} else if (input === Direction.EAST || input === Direction.WEST) {
|
} else if (input === Direction.EAST || input === Direction.WEST) {
|
||||||
when (iface) {
|
when (iface) {
|
||||||
Direction.DOWN -> shape = shape.rotateAroundX(-Math.PI / 2)
|
Direction.DOWN -> shape = shape.rotateAroundX(-Math.PI / 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user