codechicken.lib.render.CCRenderState Java Examples
The following examples show how to use
codechicken.lib.render.CCRenderState.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GuiEnderItemStorage.java From EnderStorage with MIT License | 6 votes |
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1, 1, 1, 1); CCRenderState.changeTexture(chestInv.getSize() == 0 ? "textures/gui/container/dispenser.png" : "textures/gui/container/generic_54.png"); int x = (width - xSize) / 2; int y = (height - ySize) / 2; switch(chestInv.getSize()) { case 0: case 2: drawTexturedModalRect(x, y, 0, 0, xSize, ySize); break; case 1: drawTexturedModalRect(x, y, 0, 0, xSize, 71); drawTexturedModalRect(x, y+71, 0, 126, xSize, 96); break; } }
Example #2
Source File: FluidPipeRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void handleRenderBlockDamage(IBlockAccess world, BlockPos pos, IBlockState state, TextureAtlasSprite sprite, BufferBuilder buffer) { CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.bind(buffer); renderState.setPipeline(new Vector3(new Vec3d(pos)).translation(), new IconTransformation(sprite)); BlockFluidPipe blockFluidPipe = (BlockFluidPipe) state.getBlock(); IPipeTile<FluidPipeType, FluidPipeProperties> tileEntityPipe = blockFluidPipe.getPipeTileEntity(world, pos); if (tileEntityPipe == null) { return; } FluidPipeType fluidPipeType = tileEntityPipe.getPipeType(); if (fluidPipeType == null) { return; } float thickness = fluidPipeType.getThickness(); int connectedSidesMask = blockFluidPipe.getActualConnections(tileEntityPipe, world); Cuboid6 baseBox = BlockFluidPipe.getSideBox(null, thickness); BlockRenderer.renderCuboid(renderState, baseBox, 0); for (EnumFacing renderSide : EnumFacing.VALUES) { if ((connectedSidesMask & (1 << renderSide.getIndex())) > 0) { Cuboid6 sideBox = BlockFluidPipe.getSideBox(renderSide, thickness); BlockRenderer.renderCuboid(renderState, sideBox, 0); } } }
Example #3
Source File: OptionScrollPane.java From NotEnoughItems with MIT License | 6 votes |
public static void drawOverlayGrad(int x1, int x2, int y1, int y2, float zLevel) { GlStateManager.disableTexture2D(); GlStateManager.disableCull(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.shadeModel(GL11.GL_SMOOTH); WorldRenderer r = CCRenderState.startDrawing(); r.setColorRGBA_I(0, 255); r.addVertex(x2, y1, zLevel); r.addVertex(x1, y1, zLevel); r.setColorRGBA_I(0, 0); r.addVertex(x1, y2, zLevel); r.addVertex(x2, y2, zLevel); CCRenderState.draw(); GlStateManager.disableBlend(); GlStateManager.enableCull(); GlStateManager.enableTexture2D(); }
Example #4
Source File: RenderTracker.java From WirelessRedstone with MIT License | 6 votes |
public void renderTracker(int freq) { GL11.glDisable(GL11.GL_LIGHTING); TextureUtils.bindAtlas(0); CCRenderState.reset(); CCRenderState.startDrawing(7); CCRenderState.setColour(0xFFFFFFFF); model.render(new IconTransformation(Blocks.obsidian.getIcon(0, 0))); CCRenderState.draw(); Matrix4 pearlMat = CCModelLibrary.getRenderMatrix( new Vector3(0, 0.44+RedstoneEther.getSineWave(ClientUtils.getRenderTime(), 7)*0.02, 0), new Rotation(RedstoneEther.getRotation(ClientUtils.getRenderTime(), freq), new Vector3(0, 1, 0)), 0.04); CCRenderState.changeTexture("wrcbe_core:textures/hedronmap.png"); CCRenderState.startDrawing(4); CCRenderState.setColour(freq == 0 ? 0xC0C0C0FF : 0xFFFFFFFF); CCModelLibrary.icosahedron4.render(pearlMat); CCRenderState.draw(); GL11.glEnable(GL11.GL_LIGHTING); }
Example #5
Source File: InvPipeRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void handleRenderBlockDamage(IBlockAccess world, BlockPos pos, IBlockState state, TextureAtlasSprite sprite, BufferBuilder buffer) { CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.bind(buffer); renderState.setPipeline(new Vector3(new Vec3d(pos)).translation(), new IconTransformation(sprite)); BlockInventoryPipe block = (BlockInventoryPipe) state.getBlock(); TileEntityInventoryPipe tileEntity = (TileEntityInventoryPipe) block.getPipeTileEntity(world, pos); if (tileEntity == null) { return; } InventoryPipeType pipeType = tileEntity.getPipeType(); if (pipeType == null) { return; } float thickness = pipeType.getThickness(); int connectedSidesMask = block.getActualConnections(tileEntity, world); Cuboid6 baseBox = BlockPipe.getSideBox(null, thickness); BlockRenderer.renderCuboid(renderState, baseBox, 0); for (EnumFacing renderSide : EnumFacing.VALUES) { if ((connectedSidesMask & (1 << renderSide.getIndex())) > 0) { Cuboid6 sideBox = BlockPipe.getSideBox(renderSide, thickness); BlockRenderer.renderCuboid(renderState, sideBox, 0); } } }
Example #6
Source File: FacadeItemModel.java From GregTech with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void renderItem(ItemStack rawStack, TransformType transformType) { ItemStack itemStack = ModCompatibility.getRealItemStack(rawStack); if (!(itemStack.getItem() instanceof MetaItem<?>)) { return; } ItemStack facadeStack = FacadeItem.getFacadeStack(itemStack); CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.ITEM); try { FacadeRenderer.renderItemCover(renderState, EnumFacing.NORTH.getIndex(), facadeStack, ICoverable.getCoverPlateBox(EnumFacing.NORTH, 2.0 / 16.0)); } catch (Throwable ignored) { } renderState.draw(); }
Example #7
Source File: GuiRecipe.java From NotEnoughItems with MIT License | 6 votes |
@Override protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) { GlStateManager.color(1, 1, 1, 1); CCRenderState.changeTexture("nei:textures/gui/recipebg.png"); int j = (width - xSize) / 2; int k = (height - ySize) / 2; drawTexturedModalRect(j, k, 0, 0, xSize, ySize); GlStateManager.pushMatrix(); GlStateManager.translate(j + 5, k + 16, 0); IRecipeHandler recipehandler = currenthandlers.get(recipetype); for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) { recipehandler.drawBackground(i); GlStateManager.translate(0, 65, 0); } GlStateManager.popMatrix(); }
Example #8
Source File: OptionScrollPane.java From NotEnoughItems with MIT License | 5 votes |
public static void drawOverlayTex(int x, int y, int w, int h, float zLevel) { GlStateManager.color(1, 1, 1, 1); Minecraft.getMinecraft().renderEngine.bindTexture(Gui.optionsBackground); WorldRenderer r = CCRenderState.startDrawing(); r.addVertexWithUV(x, y, zLevel, 0, 0); r.addVertexWithUV(x, y + h, zLevel, 0, h / 16D); r.addVertexWithUV(x + w, y + h, zLevel, w / 16D, h / 16D); r.addVertexWithUV(x + w, y, zLevel, w / 16D, 0); CCRenderState.draw(); }
Example #9
Source File: GuiChunkLoader.java From ChickenChunks with MIT License | 5 votes |
private void drawContainerBackground() { GL11.glColor4f(1, 1, 1, 1); CCRenderState.changeTexture("chickenchunks:textures/gui/guiSmall.png"); int posx = width / 2 - 88; int posy = height / 2 - 83; drawTexturedModalRect(posx, posy, 0, 0, 176, 166); }
Example #10
Source File: EnderTankItemRender.java From EnderStorage with MIT License | 5 votes |
@Override public void renderItem(ItemStack stack, TransformType transformType, MatrixStack mStack, IRenderTypeBuffer getter, int packedLight, int packedOverlay) { CCRenderState ccrs = CCRenderState.instance(); ccrs.reset(); ccrs.brightness = packedLight; ccrs.overlay = packedOverlay; Frequency freq = Frequency.readFromStack(stack); FluidStack fluid = TankSynchroniser.getClientLiquid(freq); Matrix4 mat = new Matrix4(mStack); RenderTileEnderTank.renderTank(ccrs, mat, getter, 2, (float) (MathHelper.torad * 90F), 0, freq, 0); mat.translate(-0.5, 0, -0.5); RenderTileEnderTank.renderFluid(ccrs, mat, getter, fluid); }
Example #11
Source File: MetaTileEntityItemBus.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { super.renderMetaTileEntity(renderState, translation, pipeline); if (shouldRenderOverlay()) { SimpleOverlayRenderer renderer = isExportHatch ? Textures.PIPE_OUT_OVERLAY : Textures.PIPE_IN_OVERLAY; renderer.renderSided(getFrontFacing(), renderState, translation, pipeline); } }
Example #12
Source File: MetaTileEntityRotorHolder.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { super.renderMetaTileEntity(renderState, translation, pipeline); Textures.ROTOR_HOLDER_OVERLAY.renderSided(getFrontFacing(), renderState, translation, pipeline); Textures.LARGE_TURBINE_ROTOR_RENDERER.renderSided(renderState, translation, pipeline, getFrontFacing(), getController() != null, isHasRotor(), isRotorLooping(), rotorColor); }
Example #13
Source File: MetaTileEntityQuantumChest.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { Textures.VOLTAGE_CASINGS[tier].render(renderState, translation, ArrayUtils.add(pipeline, new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering())))); translation.translate(0.5, 0.001, 0.5); translation.rotate(Math.toRadians(rotations[getFrontFacing().getIndex() - 2]), new Vector3(0.0, 1.0, 0.0)); translation.translate(-0.5, 0.0, -0.5); Textures.SCREEN.renderSided(EnumFacing.UP, renderState, translation, pipeline); }
Example #14
Source File: TankLayerRenderer.java From EnderStorage with MIT License | 5 votes |
@Override public void render(MatrixStack mStack, IRenderTypeBuffer getter, int packedLight, AbstractClientPlayerEntity entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { if (UUIDS.contains(entity.getUniqueID())) { CCRenderState ccrs = CCRenderState.instance(); ccrs.brightness = packedLight; ccrs.overlay = OverlayTexture.NO_OVERLAY; Matrix4 mat = new Matrix4(mStack); mat.rotate(MathHelper.torad * 180, Vector3.X_POS); mat.scale(0.5); if (entity.isShiftKeyDown()) { mat.translate(0, -0.5, 0); } if (entity.isElytraFlying()) { headPitch = -45; } mat.rotate(netHeadYaw * MathHelper.torad, Vector3.Y_NEG); mat.rotate(headPitch * MathHelper.torad, Vector3.X_POS); mat.translate(-0.5, 1, -0.5); RenderTileEnderTank.renderTank(ccrs, mat, getter, 0, (float) (MathHelper.torad * 90F), 0, BLANK, 0); FluidStack stack = FluidUtils.water.copy(); float bob = 0.45F + RenderUtils.getPearlBob(ClientUtils.getRenderTime()) * 2; stack.setAmount((int) MathHelper.map(bob, 0.2, 0.6, 1000, 14000)); mat.translate(-0.5, 0, -0.5); RenderTileEnderTank.renderFluid(ccrs, mat, getter, stack); } }
Example #15
Source File: MetaTileEntityItemCollector.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { super.renderMetaTileEntity(renderState, translation, pipeline); SimpleOverlayRenderer renderer = isWorking ? Textures.BLOWER_ACTIVE_OVERLAY : Textures.BLOWER_OVERLAY; renderer.renderSided(EnumFacing.UP, renderState, translation, pipeline); Textures.AIR_VENT_OVERLAY.renderSided(EnumFacing.DOWN, renderState, translation, pipeline); Textures.PIPE_OUT_OVERLAY.renderSided(getFrontFacing(), renderState, translation, pipeline); }
Example #16
Source File: SimpleMachineMetaTileEntity.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override @SideOnly(Side.CLIENT) public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { super.renderMetaTileEntity(renderState, translation, pipeline); if (outputFacing != null) { Textures.PIPE_OUT_OVERLAY.renderSided(outputFacing, renderState, translation, pipeline); if (autoOutputItems) { Textures.ITEM_OUTPUT_OVERLAY.renderSided(outputFacing, renderState, translation, pipeline); } if (autoOutputFluids) { Textures.FLUID_OUTPUT_OVERLAY.renderSided(outputFacing, renderState, translation, pipeline); } } }
Example #17
Source File: MetaTileEntity.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
/** * Renders this meta tile entity * Note that you shouldn't refer to world-related information in this method, because it * will be called on ItemStacks too * * @param renderState render state (either chunk batched or item) * @param pipeline default set of pipeline transformations */ @SideOnly(Side.CLIENT) public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) { TextureAtlasSprite atlasSprite = TextureUtils.getMissingSprite(); IVertexOperation[] renderPipeline = ArrayUtils.add(pipeline, new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering()))); for (EnumFacing face : EnumFacing.VALUES) { Textures.renderFace(renderState, translation, renderPipeline, face, Cuboid6.full, atlasSprite); } }
Example #18
Source File: EnderChestRenderer.java From EnderStorage with MIT License | 5 votes |
public static void renderChest(int rotation, int freq, boolean owned, double x, double y, double z, int offset, float lidAngle) { TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance; renderEndPortal.render(x, y, z, 0, info.field_147560_j, info.field_147560_j, info.field_147561_k, info.field_147553_e); GL11.glColor4f(1, 1, 1, 1); CCRenderState.changeTexture("enderstorage:textures/enderchest.png"); GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glColor4f(1, 1, 1, 1); GL11.glTranslated(x, y + 1.0, z + 1.0F); GL11.glScalef(1.0F, -1F, -1F); GL11.glTranslatef(0.5F, 0.5F, 0.5F); GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); model.chestLid.rotateAngleX = lidAngle; model.render(owned); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(x, y, z); renderButtons(freq, rotation, lidAngle); GL11.glPopMatrix(); double time = ClientUtils.getRenderTime() + offset; Matrix4 pearlMat = CCModelLibrary.getRenderMatrix( new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + EnderStorageClientProxy.getPearlBob(time), z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04); GL11.glDisable(GL11.GL_LIGHTING); CCRenderState.changeTexture("enderstorage:textures/hedronmap.png"); CCRenderState.startDrawing(4); CCModelLibrary.icosahedron4.render(pearlMat); CCRenderState.draw(); GL11.glEnable(GL11.GL_LIGHTING); }
Example #19
Source File: IconVertexRangeUVTransform.java From CodeChickenLib with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void operate(CCRenderState ccrs) { UV uv = ccrs.vert.uv; int index = ccrs.vertexIndex; TextureAtlasSprite sprite = getSpriteForVertexIndex(index); if (sprite == null) { return; } uv.u = sprite.getInterpolatedU(uv.u * 16); uv.v = sprite.getInterpolatedV(uv.v * 16); ccrs.sprite = getSpriteForVertexIndex(ccrs.vertexIndex); }
Example #20
Source File: RenderTileEnderChest.java From EnderStorage with MIT License | 5 votes |
@Override public void render(TileEnderChest enderChest, float partialTicks, MatrixStack mStack, IRenderTypeBuffer getter, int packedLight, int packedOverlay) { CCRenderState ccrs = CCRenderState.instance(); ccrs.brightness = packedLight; ccrs.overlay = packedOverlay; double yToCamera = enderChest.getPos().getY() - renderDispatcher.renderInfo.getProjectedView().y; renderChest(ccrs, mStack, getter, enderChest.rotation, yToCamera, enderChest.getFrequency(), (float) enderChest.getRadianLidAngle(partialTicks), RenderUtils.getTimeOffset(enderChest.getPos())); }
Example #21
Source File: LightingAttribute.java From CodeChickenLib with GNU Lesser General Public License v2.1 | 5 votes |
@Override public boolean load(CCRenderState ccrs) { if (!ccrs.computeLighting || !ccrs.fmt.hasColor() || !ccrs.model.hasAttribute(attributeKey)) { return false; } colourRef = ccrs.model.getAttributes(attributeKey); if (colourRef != null) { ccrs.pipeline.addDependency(ccrs.colourAttrib); return true; } return false; }
Example #22
Source File: CoverFacade.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 plateBox, BlockRenderLayer layer) { BlockRenderLayer oldLayer = MinecraftForgeClient.getRenderLayer(); ForgeHooksClient.setRenderLayer(layer); FacadeRenderer.renderBlockCover(renderState, translation, coverHolder.getWorld(), coverHolder.getPos(), attachedSide.getIndex(), facadeState, plateBox); ForgeHooksClient.setRenderLayer(oldLayer); }
Example #23
Source File: LightCoordAttribute.java From CodeChickenLib with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void operate(CCRenderState ccrs) { if (lcRef != null) { ccrs.lc.set(lcRef[ccrs.vertexIndex]); } else { ccrs.lc.compute(vec.set(ccrs.vert.vec).subtract(pos), ccrs.side); } }
Example #24
Source File: EnderTankRenderer.java From EnderStorage with MIT License | 5 votes |
@Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float f) { TileEnderTank tank = (TileEnderTank)tile; CCRenderState.reset(); CCRenderState.pullLightmap(); CCRenderState.useNormals = true; renderTank(tank.rotation, (float) MathHelper.interpolate(tank.pressure_state.b_rotate, tank.pressure_state.a_rotate, f)*0.01745F, tank.freq, !tank.owner.equals("global"), x, y, z, EnderStorageClientProxy.getTimeOffset(tile.xCoord, tile.yCoord, tile.zCoord)); renderLiquid(tank.liquid_state.c_liquid, x, y, z); }
Example #25
Source File: LightModel.java From CodeChickenLib with GNU Lesser General Public License v2.1 | 5 votes |
@Override public boolean load() { if(!CCRenderState.computeLighting) return false; CCRenderState.pipeline.addDependency(CCRenderState.normalAttrib); CCRenderState.pipeline.addDependency(CCRenderState.colourAttrib); return true; }
Example #26
Source File: ContainerEnchantmentModifier.java From NotEnoughItems with MIT License | 5 votes |
public void drawSlots(GuiEnchantmentModifier gui) { for (int slot = 0; slot < 3; slot++) { int shade = 0; String text = ""; int containerslot = slot + getScrolledSlots(); if (containerslot + 1 > slotEnchantment.size()) { shade = 1; } else { EnchantmentHash e = slotEnchantment.get(containerslot); shade = e.state; text = e.enchantment.getTranslatedName(e.level == -1 ? level : e.level); if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Projectile")) { text = text.replace("Projectile", "Proj"); } if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Protection")) { text = text.replace("Protection", "Protect"); } if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Bane of")) { text = text.replace("Bane of ", ""); } } CCRenderState.changeTexture("textures/gui/container/enchanting_table.png"); GlStateManager.color(1, 1, 1); if (hasScrollBar()) { gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth - 30, slotheight); gui.drawTexturedModalRect(relx + cwidth - 30, rely + slot * slotheight, cwidth - 23, gui.ySize + slotheight * shade, 30, slotheight); } else { gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth + 7, slotheight); } gui.getFontRenderer().drawString(text, relx + 4, rely + slot * slotheight + 5, textColourFromState(shade)); } }
Example #27
Source File: FacadeRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
private static VertexLighterFlat setupLighter(CCRenderState ccrs, Matrix4 translation, IBlockState state, IBlockAccess access, BlockPos pos, IBakedModel model) { boolean renderAO = Minecraft.isAmbientOcclusionEnabled() && state.getLightValue(access, pos) == 0 && model.isAmbientOcclusion(); VertexLighterFlat lighter = renderAO ? lighterSmooth.get() : lighterFlat.get(); AdvCCRSConsumer consumer = new AdvCCRSConsumer(ccrs); lighter.setParent(consumer); consumer.setTranslation(translation); return lighter; }
Example #28
Source File: TileEntityRendererBase.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void renderTileEntityFast(T te, double x, double y, double z, float partialTicks, int destroyStage, float partial, BufferBuilder buffer) { CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.bind(buffer); if (te.getWorld() != null) { renderState.setBrightness(te.getWorld(), te.getPos()); } Matrix4 translation = new Matrix4().translate(x, y, z); draw(te, renderState, translation, partialTicks); }
Example #29
Source File: FluidPipeRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) { CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.bind(buffer); renderState.setBrightness(world, pos); BlockFluidPipe blockPipe = ((BlockFluidPipe) state.getBlock()); TileEntityFluidPipe tileEntityPipe = (TileEntityFluidPipe) blockPipe.getPipeTileEntity(world, pos); if (tileEntityPipe == null) { return false; } FluidPipeType fluidPipeType = tileEntityPipe.getPipeType(); Material pipeMaterial = tileEntityPipe.getPipeMaterial(); int paintingColor = tileEntityPipe.getInsulationColor(); if (fluidPipeType != null && pipeMaterial != null) { BlockRenderLayer renderLayer = MinecraftForgeClient.getRenderLayer(); if (renderLayer == BlockRenderLayer.CUTOUT) { int connectedSidesMask = blockPipe.getActualConnections(tileEntityPipe, world); IVertexOperation[] pipeline = new IVertexOperation[] {new Translation(pos)}; renderPipeBlock(pipeMaterial, fluidPipeType, paintingColor, renderState, pipeline, connectedSidesMask); } ICoverable coverable = tileEntityPipe.getCoverableImplementation(); coverable.renderCovers(renderState, new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ()), renderLayer); } return true; }
Example #30
Source File: InvPipeRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void renderItem(ItemStack rawItemStack, TransformType transformType) { GlStateManager.enableBlend(); CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.ITEM); renderPipe(renderState, new IVertexOperation[0], IPipeTile.DEFAULT_INSULATION_COLOR, 12); renderState.draw(); GlStateManager.disableBlend(); }