@Override @SideOnly(Side.CLIENT) public void renderDynamic(Vector3 pos, float frame, int pass) { if (pass == 0) { TextureUtils.bindAtlas(0); CCRenderState.reset(); CCRenderState.setBrightness(world(), x(), y(), z()); CCRenderState.useModelColours(true); // TODO add Tube Item rendering here CCRenderState.setColour(-1); } }
@Override @SideOnly(Side.CLIENT) public void renderStatic(Vector3 pos, LazyLightMatrix olm, int pass) { if (pass == 0) { TextureUtils.bindAtlas(0); CCRenderState.reset(); CCRenderState.setBrightness(world(), x(), y(), z()); CCRenderState.useModelColours(true); /** temporary render start * */ int key = RenderFramedWire.modelKey(0, connMap); Translation t = new Translation(x(), y(), z()); IconTransformation uvt = new IconTransformation(EnumWire.RED_ALLOY.wireSprites[0]); RenderFramedWire.frameModels[6].render(t, uvt); for (int s = 0; s < 6; s++) if ((key & 1 << s) != 0) RenderFramedWire.frameModels[s].render(t, uvt); /** temporary render end * */ CCRenderState.setColour(-1); } }
@Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { CCRenderState.reset(); CCRenderState.useNormals(true); CCRenderState.useModelColours(true); TileEntityRedNetCable _cable = (TileEntityRedNetCable)world.getBlockTileEntity(x, y, z); TileEntityRedNetEnergy _cond = null; int brightness = block.getMixedBrightnessForBlock(world, x, y, z); int bandBrightness = brightBand ? 0xd00070 : brightness; Tessellator tess = Tessellator.instance; tess.setColorOpaque_F(1,1,1); tess.setBrightness(brightness); Translation tlate = new Translation(new Vector3(x, y, z)); base.render(tlate, uvt); if (_cable instanceof TileEntityRedNetEnergy) { cage.render(tlate, uvt); _cond = (TileEntityRedNetEnergy)_cable; } for (ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) { int side = f.ordinal(); RedNetConnectionType state = _cable.getConnectionState(f); switch (state.flags & 31) { case 11: // isCable, isSingleSubnet tess.setBrightness(bandBrightness); band[side].setColour(_cable.getSideColorValue(f)); band[side].render(tlate, uvt); tess.setColorOpaque_F(1,1,1); tess.setBrightness(brightness); case 19: // isCable, isAllSubnets if (state.isSingleSubnet) { iface[side].render(tlate, uvt); grip[side].render(tlate, uvt); } else cable[side].render(tlate, uvt); break; case 13: // isPlate, isSingleSubnet tess.setBrightness(bandBrightness); band[side].setColour(_cable.getSideColorValue(f)); band[side].render(tlate, uvt); platef[side].setColour(_cable.getSideColorValue(f)); platef[side].render(tlate, uvt); tess.setColorOpaque_F(1,1,1); tess.setBrightness(brightness); case 21: // isPlate, isAllSubnets iface[side].render(tlate, uvt); plate[side].render(tlate, uvt); if (state.isAllSubnets) { platef[side].setColour(-1); platef[side].render(tlate, uvt); } default: break; } if (_cond != null && _cond.isInterfacing(f)) { wire[side].render(tlate, uvt); if (_cond.interfaceMode(f) != 4) caps[side].render(tlate, uvt); } } return true; }