private void renderLiquidPart( IBlockAccess world, int x, int y, int z, Block block, RenderBlocks renderer, CastingChannelLogic logic) { FluidStack liquid = logic.liquid; int color = block.colorMultiplier(world, x, y, z); float red = (color >> 16 & 0xFF) / 255.0F; float green = (color >> 8 & 0xFF) / 255.0F; float blue = (color & 0xFF) / 255.0F; Fluid fluid = liquid.getFluid(); if (fluid.canBePlacedInWorld()) BlockSkinRenderHelper.renderMetadataBlock( Block.blocksList[fluid.getBlockID()], 0, x, y, z, renderer, world); else BlockSkinRenderHelper.renderLiquidBlock( fluid.getStillIcon(), fluid.getFlowingIcon(), x, y, z, renderer, world); }
private DisplayInteger getValveDisplay(ValveRenderData data, Fluid fluid, World world) { if (cachedValveFluids.containsKey(data) && cachedValveFluids.get(data).containsKey(fluid)) { return cachedValveFluids.get(data).get(fluid); } Model3D toReturn = new Model3D(); toReturn.baseBlock = Blocks.water; toReturn.setTexture(fluid.getFlowingIcon()); DisplayInteger display = DisplayInteger.createAndStart(); if (cachedValveFluids.containsKey(data)) { cachedValveFluids.get(data).put(fluid, display); } else { HashMap<Fluid, DisplayInteger> map = new HashMap<Fluid, DisplayInteger>(); map.put(fluid, display); cachedValveFluids.put(data, map); } switch (data.side) { case DOWN: { toReturn.minX = .3; toReturn.minY = 1 + .01; toReturn.minZ = .3; toReturn.maxX = .7; toReturn.maxY = 1.4 + .1; toReturn.maxZ = .7; break; } case UP: { toReturn.minX = .3; toReturn.minY = -(data.height - 2) - .01; toReturn.minZ = .3; toReturn.maxX = .7; toReturn.maxY = -.01; toReturn.maxZ = .7; break; } case NORTH: { toReturn.minX = .3; toReturn.minY = -(getValveFluidHeight(data)) + .01; toReturn.minZ = 1 + .02; toReturn.maxX = .7; toReturn.maxY = .7; toReturn.maxZ = 1.4; break; } case SOUTH: { toReturn.minX = .3; toReturn.minY = -(getValveFluidHeight(data)) + .01; toReturn.minZ = -.4; toReturn.maxX = .7; toReturn.maxY = .7; toReturn.maxZ = -.02; break; } case WEST: { toReturn.minX = 1 + .02; toReturn.minY = -(getValveFluidHeight(data)) + .01; toReturn.minZ = .3; toReturn.maxX = 1.4; toReturn.maxY = .7; toReturn.maxZ = .7; break; } case EAST: { toReturn.minX = -.4; toReturn.minY = -(getValveFluidHeight(data)) + .01; toReturn.minZ = .3; toReturn.maxX = -.02; toReturn.maxY = .7; toReturn.maxZ = .7; break; } default: { break; } } if (fluid.getFlowingIcon() != null) { MekanismRenderer.renderObject(toReturn); } display.endList(); return display; }