commit 9bd2c6ccb6f9184baa09ff6371f5e412f63b5b91
parent 8d28771fef2f80340185d5487597dc0946cf2d00
Author: Amb0s <ambos@disroot.org>
Date: Mon, 5 Feb 2024 00:29:39 +0100
Fixed redstone logic in all directions
Diffstat:
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/src/main/java/turniplabs/simpletech/block/BlockRedstoneNotGate.java b/src/main/java/turniplabs/simpletech/block/BlockRedstoneNotGate.java
@@ -92,20 +92,38 @@ public class BlockRedstoneNotGate extends Block {
@Override
public boolean isPoweringTo(WorldSource blockAccess, int x, int y, int z, int side) {
- if (!this.isPowered && side != 5) {
- return true;
+ int direction = blockAccess.getBlockMetadata(x, y, z) & 3;
+ if (!this.isPowered) {
+ if (direction == 1 && side == 5) {
+ return false;
+ } else if (direction == 0 && side == 2) {
+ return false;
+ } else if (direction == 2 && side == 3) {
+ return false;
+ } else if (direction == 3 && side == 4) {
+ return false;
+ } else {
+ return true;
+ }
} else {
- int direction = blockAccess.getBlockMetadata(x, y, z) & 3;
if (direction == 0 && side == 3) {
return false;
+ } else if (direction == 0 && side == 2) {
+ return false;
} else if (direction == 1 && side == 4) {
return false;
} else if (direction == 1 && side == 5) {
return false;
} else if (direction == 2 && side == 2) {
return false;
+ } else if (direction == 2 && side == 3) {
+ return false;
+ } else if (direction == 3 && side == 4) {
+ return false;
+ } else if (direction == 3 && side == 5) {
+ return false;
} else {
- return !(direction == 3 && side == 5);
+ return false;
}
}
}