aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/blocks
diff options
context:
space:
mode:
authorRyan Nasers <42074409+Cardinalstars@users.noreply.github.com>2023-11-20 11:25:46 -0600
committerGitHub <noreply@github.com>2023-11-20 18:25:46 +0100
commitbaf93d68e40f8a09ff507d116ecb90ba41e9f6bc (patch)
tree550b6a492fd11c142c78fe0dfc71848868d7b91b /src/main/java/gregtech/common/blocks
parent521f73aa54546c65d1bee90ad5984c2db97ecb25 (diff)
downloadGT5-Unofficial-baf93d68e40f8a09ff507d116ecb90ba41e9f6bc.tar.gz
GT5-Unofficial-baf93d68e40f8a09ff507d116ecb90ba41e9f6bc.tar.bz2
GT5-Unofficial-baf93d68e40f8a09ff507d116ecb90ba41e9f6bc.zip
Change to only allow connections when Redstone is needed (#2374)
* Change to only allow connections when Redstone is needed * Forgot spotless copium * Applying oneeyemaker changes
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Machines.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java
index 16fe7c49ff..af41710054 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java
@@ -159,7 +159,18 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo
@Override
public boolean canConnectRedstone(IBlockAccess aWorld, int aX, int aY, int aZ, int ordinalSide) {
- return true;
+ ForgeDirection forgeSide = switch (ordinalSide) {
+ case (-2) -> ForgeDirection.DOWN;
+ case (-1) -> ForgeDirection.UP;
+ case (0) -> ForgeDirection.NORTH;
+ case (2) -> ForgeDirection.SOUTH;
+ case (3) -> ForgeDirection.WEST;
+ case (1) -> ForgeDirection.EAST;
+ default -> ForgeDirection.UNKNOWN;
+ };
+ final TileEntity machineEntity = aWorld.getTileEntity(aX, aY, aZ);
+ return machineEntity instanceof CoverableTileEntity cte && cte.getCoverInfoAtSide(forgeSide)
+ .getCoverID() != 0;
}
@Override