diff --git a/src/main/java/li/cil/oc2/common/block/entity/BusCableTileEntity.java b/src/main/java/li/cil/oc2/common/block/entity/BusCableTileEntity.java index 64dc15bc..e6871d20 100644 --- a/src/main/java/li/cil/oc2/common/block/entity/BusCableTileEntity.java +++ b/src/main/java/li/cil/oc2/common/block/entity/BusCableTileEntity.java @@ -69,9 +69,17 @@ public class BusCableTileEntity extends AbstractTileEntity { @Override protected boolean canConnectToSide(final Direction direction) { + return getConnectionType(direction) == BusCableBlock.ConnectionType.LINK; + } + + @Override + protected boolean hasInterfaceOnSide(final Direction direction) { + return getConnectionType(direction) == BusCableBlock.ConnectionType.PLUG; + } + + private BusCableBlock.ConnectionType getConnectionType(final Direction direction) { final EnumProperty property = BusCableBlock.FACING_TO_CONNECTION_MAP.get(direction); - final BusCableBlock.ConnectionType connectionType = getBlockState().get(property); - return connectionType == BusCableBlock.ConnectionType.PLUG; + return getBlockState().get(property); } } } diff --git a/src/main/java/li/cil/oc2/common/bus/TileEntityDeviceBusElement.java b/src/main/java/li/cil/oc2/common/bus/TileEntityDeviceBusElement.java index 21446d1d..950a42b1 100644 --- a/src/main/java/li/cil/oc2/common/bus/TileEntityDeviceBusElement.java +++ b/src/main/java/li/cil/oc2/common/bus/TileEntityDeviceBusElement.java @@ -87,7 +87,7 @@ public class TileEntityDeviceBusElement extends AbstractGroupingBlockDeviceBusEl final int index = direction.getIndex(); final HashSet newDevices = new HashSet<>(); - if (canConnectToSide(direction)) { + if (hasInterfaceOnSide(direction)) { for (final LazyOptional deviceInfo : Devices.getDevices(world, pos, direction)) { deviceInfo.ifPresent(newDevices::add); deviceInfo.addListener(unused -> handleNeighborChanged(pos)); @@ -119,6 +119,10 @@ public class TileEntityDeviceBusElement extends AbstractGroupingBlockDeviceBusEl return true; } + protected boolean hasInterfaceOnSide(final Direction direction) { + return canConnectToSide(direction); + } + /////////////////////////////////////////////////////////////////// private void scanNeighborsForDevices() {