Added cover cable connectivity
package com.refinedmods.refinedstorage.block;
import com.refinedmods.refinedstorage.api.network.node.ICoverable;
+import com.refinedmods.refinedstorage.api.network.node.INetworkNodeProxy;
import com.refinedmods.refinedstorage.apiimpl.network.node.cover.Cover;
import com.refinedmods.refinedstorage.apiimpl.network.node.cover.CoverManager;
import com.refinedmods.refinedstorage.apiimpl.network.node.cover.CoverType;
@@ -155,7 +156,14 @@ public class CableBlock extends NetworkNodeBlock implements IWaterLoggable {
return false;
}
- return tile.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).isPresent();
+ return tile.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).isPresent() && isSideNotCoveredOrHollow(tile, direction) && isSideNotCoveredOrHollow(world.getTileEntity(pos.offset(direction)), direction.getOpposite());
+ }
+
+ private boolean isSideNotCoveredOrHollow(TileEntity tile, Direction direction){
+ if (tile == null){
+ return false;
+ }
+ return tile.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).map(INetworkNodeProxy::getNode).map(iNetworkNode -> iNetworkNode instanceof ICoverable && (!((ICoverable) iNetworkNode).getCoverManager().hasCover(direction) || ((ICoverable) iNetworkNode).getCoverManager().getCover(direction).getType() == CoverType.HOLLOW)).orElse(false);
}
private BlockState getState(BlockState currentState, IWorld world, BlockPos pos) {
