@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 void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { CCRenderState.reset(); CCRenderState.useNormals(true); Tessellator tess = Tessellator.instance; GL11.glTranslatef(-.5f, -.5f, -.5f); tess.startDrawingQuads(); base.render(null, uvt); cable[2].render(null, uvt); cable[3].render(null, uvt); if (metadata == 3 | metadata == 2) { cage.render(null, uvt); wire[2].render(null, uvt); wire[3].render(null, uvt); caps[2].render(null, uvt); caps[3].render(null, uvt); } tess.draw(); }
@Override public void drawBackground() { BasicGuiUtils.drawGuiBox(0, 0, xSize, ySize, zLevel); BasicGuiUtils.drawPlayerInventoryBackground(mc, 8, 84); fontRenderer.drawString("Extension ID:", 10, 10, 0xff000000); int i = 0; for (String s : id.split("-")) fontRenderer.drawString(s, 10, 25 + 10 * i++, 0xff000000); BasicGuiUtils.drawSlotBackground(mc, 133, 19); BasicGuiUtils.drawSlotBackground(mc, 133, 49); CCRenderState.changeTexture(RL_extras); drawTexturedModalRect(134, 20, 1, 11, 16, 16); }
@Override public void renderDynamic( TubeDefinition type, ITube tube, World world, int x, int y, int z, float frameTime) { FluidStack fluid = ((TankTube) tube).getFluid(); if (fluid != null) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1, 1, 1, 1); GL11.glDisable(GL11.GL_LIGHTING); mRender.resetTransform(); mRender.enableNormals = false; mRender.setLightingFromBlock(world, x, y, z); mRender.resetTextureFlip(); mRender.resetTextureRotation(); mRender.setLocalLights(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f); GL11.glPushMatrix(); GL11.glTranslatef(x, y, z); CCRenderState.changeTexture( Minecraft.getMinecraft() .renderEngine .getResourceLocation(fluid.getFluid().getSpriteNumber())); mRender.setIcon(fluid.getFluid().getIcon(fluid)); float amount = fluid.amount / 1000f; if (amount > 1) amount = 1; Tessellator tes = Tessellator.instance; tes.startDrawingQuads(); mRender.drawBox(63, 0.188f, 0.188f, 0.188f, 0.812f, 0.188f + (0.624f * amount), 0.812f); tes.draw(); GL11.glPopMatrix(); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); } super.renderDynamic(type, tube, world, x, y, z, frameTime); }
@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; }
public static void changeTexture(ResourceLocation r) { CCRenderState.changeTexture(r); }
public static void changeTexture(String s) { CCRenderState.changeTexture(s); }