bcRenderState.gateMatrix.setIsGateLit(gate != null && gate.isGateActive(), direction);
bcRenderState.gateMatrix.setIsGatePulsing(gate != null && gate.isGatePulsing(), direction);
}
// Facades
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
IPipePluggable pluggable = sideProperties.pluggables[direction.ordinal()];
if (!(pluggable instanceof ItemFacade.FacadePluggable)) {
bcRenderState.facadeMatrix.setFacade(direction, null, 0, true);
continue;
}
ItemFacade.FacadeState[] states = ((ItemFacade.FacadePluggable) pluggable).states;
if (states == null) {
bcRenderState.facadeMatrix.setFacade(direction, null, 0, true);
continue;
}
// Iterate over all states and activate first proper
ItemFacade.FacadeState defaultState = null, activeState = null;
for (ItemFacade.FacadeState state : states) {
if (state.wire == null) {
defaultState = state;
continue;
}
if (getBCPipePart().isWireActive(state.wire)) {
activeState = state;
break;
}
}
if (activeState == null) {
activeState = defaultState;
}
Block block = activeState != null ? activeState.block : null;
int metadata = activeState != null ? activeState.metadata : 0;
boolean transparent = activeState == null || block == null;
bcRenderState.facadeMatrix.setFacade(direction, block, metadata, transparent);
}
//Plugs
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
IPipePluggable pluggable = sideProperties.pluggables[direction.ordinal()];
bcRenderState.plugMatrix.setConnected(direction, pluggable instanceof ItemPlug.PlugPluggable);
if (pluggable instanceof ItemRobotStation.RobotStationPluggable) {
DockingStation station = ((ItemRobotStation.RobotStationPluggable) pluggable).getStation();