Merge branch 'master' into feat/facade-ctm-rendering

This commit is contained in:
Martin Robertz authored and GitHub committed 2026-10-17 16:12:31 +02:00
commit fb1ef7db0b
1 file changed
+15 -6
@@ -18,9 +18,10 @@ import appeng.api.parts.IPartHost;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.me.helpers.AENetworkProxy;
import appeng.me.helpers.IGridProxyable;
import appeng.parts.networking.PartCable;
import appeng.tile.grid.AENetworkInvTile;
import appeng.tile.grid.AENetworkPowerTile;
import appeng.tile.crafting.TileCraftingTile;
import appeng.tile.spatial.TileSpatialPylon;
public class RendererCable extends AbstractRendererPreview implements IRenderPreview {
@@ -233,12 +234,20 @@ public class RendererCable extends AbstractRendererPreview implements IRenderPre
AEColor gridHostColor = gridHost instanceof IColorableTile ? ((IColorableTile) gridHost).getColor()
: AEColor.Transparent;
if (gridHost instanceof AENetworkInvTile) {
return hasConnectableSide(((AENetworkInvTile) gridHost)::getProxy, side, cableColor, gridHostColor);
if (gridHost instanceof TileCraftingTile craftingTile) {
return craftingTile.isFormed() && connectionType != null
&& connectionType != AECableType.NONE
&& isColorCompatible(cableColor, gridHostColor);
}
if (gridHost instanceof AENetworkPowerTile) {
return hasConnectableSide(((AENetworkPowerTile) gridHost)::getProxy, side, cableColor, gridHostColor);
if (gridHost instanceof TileSpatialPylon spatialPylon) {
return (spatialPylon.getDisplayBits() & TileSpatialPylon.MB_STATUS) != 0 && connectionType != null
&& connectionType != AECableType.NONE
&& isColorCompatible(cableColor, gridHostColor);
}
if (gridHost instanceof IGridProxyable proxyable && proxyable.getProxy() != null) {
return hasConnectableSide(proxyable::getProxy, side, cableColor, gridHostColor);
}
return connectionType != null && connectionType != AECableType.NONE