public void renderParticle( Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { int i = (int) ((((float) field_35130_a + par2) * 15F) / (float) field_35129_ay); if (i > 15) { return; } else { field_35128_az.bindTexture(field_35128_az.getTexture("/misc/explosion.png")); float f = (float) (i % 4) / 4F; float f1 = f + 0.24975F; float f2 = (float) (i / 4) / 4F; float f3 = f2 + 0.24975F; float f4 = 2.0F * field_35131_aA; float f5 = (float) ((prevPosX + (posX - prevPosX) * (double) par2) - interpPosX); float f6 = (float) ((prevPosY + (posY - prevPosY) * (double) par2) - interpPosY); float f7 = (float) ((prevPosZ + (posZ - prevPosZ) * (double) par2) - interpPosZ); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); RenderHelper.disableStandardItemLighting(); par1Tessellator.startDrawingQuads(); par1Tessellator.setColorRGBA_F(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 1.0F); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); par1Tessellator.setBrightness(240); par1Tessellator.addVertexWithUV( f5 - par3 * f4 - par6 * f4, f6 - par4 * f4, f7 - par5 * f4 - par7 * f4, f1, f3); par1Tessellator.addVertexWithUV( (f5 - par3 * f4) + par6 * f4, f6 + par4 * f4, (f7 - par5 * f4) + par7 * f4, f1, f2); par1Tessellator.addVertexWithUV( f5 + par3 * f4 + par6 * f4, f6 + par4 * f4, f7 + par5 * f4 + par7 * f4, f, f2); par1Tessellator.addVertexWithUV( (f5 + par3 * f4) - par6 * f4, f6 - par4 * f4, (f7 + par5 * f4) - par7 * f4, f, f3); par1Tessellator.draw(); GL11.glPolygonOffset(0.0F, 0.0F); GL11.glEnable(GL11.GL_LIGHTING); return; } }
public static boolean renderDoorBlock( Block par1Block, int par2, int par3, int par4, RenderBlocks renderblocks, IBlockAccess iblockaccess) { Tessellator var5 = Tessellator.instance; BlockMTDoor var6 = (BlockMTDoor) par1Block; boolean var7 = false; float var8 = 0.5F; float var9 = 1.0F; float var10 = 0.8F; float var11 = 0.6F; int var12 = par1Block.getMixedBrightnessForBlock(renderblocks.blockAccess, par2, par3, par4); var5.setBrightness( par1Block.minY > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(renderblocks.blockAccess, par2, par3 - 1, par4)); var5.setColorOpaque_F(var8, var8, var8); renderblocks.renderBottomFace( par1Block, (double) par2, (double) par3, (double) par4, par1Block.getBlockTexture(renderblocks.blockAccess, par2, par3, par4, 0)); var7 = true; var5.setBrightness( par1Block.maxY < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(renderblocks.blockAccess, par2, par3 + 1, par4)); var5.setColorOpaque_F(var9, var9, var9); renderblocks.renderTopFace( par1Block, (double) par2, (double) par3, (double) par4, par1Block.getBlockTexture(renderblocks.blockAccess, par2, par3, par4, 1)); var7 = true; var5.setBrightness( par1Block.minZ > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(renderblocks.blockAccess, par2, par3, par4 - 1)); var5.setColorOpaque_F(var10, var10, var10); int var13 = par1Block.getBlockTexture(renderblocks.blockAccess, par2, par3, par4, 2); if (var13 < 0) { renderblocks.flipTexture = true; var13 = -var13; } renderblocks.renderEastFace(par1Block, (double) par2, (double) par3, (double) par4, var13); var7 = true; renderblocks.flipTexture = false; var5.setBrightness( par1Block.maxZ < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(renderblocks.blockAccess, par2, par3, par4 + 1)); var5.setColorOpaque_F(var10, var10, var10); var13 = par1Block.getBlockTexture(renderblocks.blockAccess, par2, par3, par4, 3); if (var13 < 0) { renderblocks.flipTexture = true; var13 = -var13; } renderblocks.renderWestFace(par1Block, (double) par2, (double) par3, (double) par4, var13); var7 = true; renderblocks.flipTexture = false; var5.setBrightness( par1Block.minX > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(renderblocks.blockAccess, par2 - 1, par3, par4)); var5.setColorOpaque_F(var11, var11, var11); var13 = par1Block.getBlockTexture(renderblocks.blockAccess, par2, par3, par4, 4); if (var13 < 0) { renderblocks.flipTexture = true; var13 = -var13; } renderblocks.renderNorthFace(par1Block, (double) par2, (double) par3, (double) par4, var13); var7 = true; renderblocks.flipTexture = false; var5.setBrightness( par1Block.maxX < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(renderblocks.blockAccess, par2 + 1, par3, par4)); var5.setColorOpaque_F(var11, var11, var11); var13 = par1Block.getBlockTexture(renderblocks.blockAccess, par2, par3, par4, 5); if (var13 < 0) { renderblocks.flipTexture = true; var13 = -var13; } renderblocks.renderSouthFace(par1Block, (double) par2, (double) par3, (double) par4, var13); var7 = true; renderblocks.flipTexture = false; return var7; }
private void func_159_a(EntityWallpaper_Kaevator entitywallpaper) { GL11.glScalef(16.0F / 256.0F, 16.0F / 256.0F, 1.0F / 16.0F); float f = -8.0F; float f1 = -8.0F; Tessellator tessellator = Tessellator.instance; float f2 = 0.0F; float f3 = 1.0F; float f4 = (float) (entitywallpaper.wallpaper / 16) / 16.0F; float f5 = (float) (entitywallpaper.wallpaper % 16) / 16.0F; float f6 = 1.0F / 16.0F; float f7 = 1.0F / 512.0F; int i = MathHelper.floor_double(entitywallpaper.posX); int j = MathHelper.floor_double(entitywallpaper.posY); int k = MathHelper.floor_double(entitywallpaper.posZ); float lRed = (float) entitywallpaper.red / 256.0F; float lGreen = (float) entitywallpaper.green / 256.0F; float lBlue = (float) entitywallpaper.blue / 256.0F; tessellator.startDrawingQuads(); if (Minecraft.isAmbientOcclusionEnabled()) { renderWithAmbientOcclusion(i, j, k, 1.0F, 1.0F, 1.0F, entitywallpaper.direction); tessellator.setNormal(0.0F, 0.0F, 1F); tessellator.setBrightness(240); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); } if (!entitywallpaper.isBlockLeft) { tessellator.setNormal(-1.0F, 0.0F, 0.0F); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); } } if (!entitywallpaper.isBlockUp) { tessellator.setNormal(0.0F, 1.0F, 0.0F); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); } } if (!entitywallpaper.isBlockRight) { tessellator.setNormal(1F, 0.0F, 0.0F); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); } } if (!entitywallpaper.isBlockDown) { tessellator.setNormal(0.0F, -1.0F, 0.0F); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); } } } else { float lLightBlock = renderManager.worldObj.getLightBrightness(i, j, k); GL11.glColor3f( lLightBlock * (float) entitywallpaper.red / 256.0F, lLightBlock * (float) entitywallpaper.green / 256.0F, lLightBlock * (float) entitywallpaper.blue / 256.0F); tessellator.setBrightness(240); tessellator.setNormal(0.0F, 0.0F, -1F); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); if (!entitywallpaper.isBlockLeft) { tessellator.setNormal(-1.0F, 0.0F, 0.0F); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); } if (!entitywallpaper.isBlockUp) { tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); } if (!entitywallpaper.isBlockRight) { tessellator.setNormal(1F, 0.0F, 0.0F); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); } if (!entitywallpaper.isBlockDown) { tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); } } tessellator.draw(); }
public static boolean renderBlockRedstoneWire( RenderBlocks r, IBlockAccess blockAccess, Block par1Block, int par2, int par3, int par4, Icon override) { Tessellator tessellator = Tessellator.instance; int i = blockAccess.getBlockMetadata(par2, par3, par4); Icon icon = BlockRedstoneWire.func_94409_b("cross"); Icon icon1 = BlockRedstoneWire.func_94409_b("line"); Icon icon2 = BlockRedstoneWire.func_94409_b("cross_overlay"); Icon icon3 = BlockRedstoneWire.func_94409_b("line_overlay"); if (!Minecraft.oldlighting) { tessellator.setBrightness( par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); } float f = Minecraft.oldlighting ? par1Block.getBlockBrightness(blockAccess, par2, par3, par4) : 1.0F; float f1 = (float) i / 15F; float f2 = f1 * 0.6F + 0.4F; if (i == 0) { f2 = 0.3F; } float f3 = f1 * f1 * 0.7F - 0.5F; float f4 = f1 * f1 * 0.6F - 0.7F; if (f3 < 0.0F) { f3 = 0.0F; } if (f4 < 0.0F) { f4 = 0.0F; } tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); boolean flag = BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2 - 1, par3, par4, 1) || !blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire( blockAccess, par2 - 1, par3 - 1, par4, -1); boolean flag1 = BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2 + 1, par3, par4, 3) || !blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire( blockAccess, par2 + 1, par3 - 1, par4, -1); boolean flag2 = BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2, par3, par4 - 1, 2) || !blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire( blockAccess, par2, par3 - 1, par4 - 1, -1); boolean flag3 = BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2, par3, par4 + 1, 0) || !blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire( blockAccess, par2, par3 - 1, par4 + 1, -1); if (!blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { if (blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2 - 1, par3 + 1, par4, -1)) { flag = true; } if (blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2 + 1, par3 + 1, par4, -1)) { flag1 = true; } if (blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2, par3 + 1, par4 - 1, -1)) { flag2 = true; } if (blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2, par3 + 1, par4 + 1, -1)) { flag3 = true; } } float f5 = par2 + 0; float f6 = par2 + 1; float f7 = par4 + 0; float f8 = par4 + 1; byte byte0 = 0; if ((flag || flag1) && !flag2 && !flag3) { byte0 = 1; } if ((flag2 || flag3) && !flag1 && !flag) { byte0 = 2; } if (byte0 == 0) { int j = 0; int k = 0; int l = 16; int i1 = 16; if (flag1 || flag2 || flag3 || flag) { if (!flag) { f5 += 0.3125F; } if (!flag) { j += 5; } if (!flag1) { f6 -= 0.3125F; } if (!flag1) { l -= 5; } if (!flag2) { f7 += 0.3125F; } if (!flag2) { k += 5; } if (!flag3) { f8 -= 0.3125F; } if (!flag3) { i1 -= 5; } } tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f8, icon.getInterpolatedU(l), icon.getInterpolatedV(i1)); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f7, icon.getInterpolatedU(l), icon.getInterpolatedV(k)); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f7, icon.getInterpolatedU(j), icon.getInterpolatedV(k)); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f8, icon.getInterpolatedU(j), icon.getInterpolatedV(i1)); tessellator.setColorOpaque_F(f, f, f); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f8, icon2.getInterpolatedU(l), icon2.getInterpolatedV(i1)); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f7, icon2.getInterpolatedU(l), icon2.getInterpolatedV(k)); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f7, icon2.getInterpolatedU(j), icon2.getInterpolatedV(k)); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f8, icon2.getInterpolatedU(j), icon2.getInterpolatedV(i1)); } else if (byte0 == 1) { tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f8, icon1.getMaxU(), icon1.getMaxV()); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f7, icon1.getMaxU(), icon1.getMinV()); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f7, icon1.getMinU(), icon1.getMinV()); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f8, icon1.getMinU(), icon1.getMaxV()); tessellator.setColorOpaque_F(f, f, f); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f8, icon3.getMaxU(), icon3.getMaxV()); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f7, icon3.getMaxU(), icon3.getMinV()); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f7, icon3.getMinU(), icon3.getMinV()); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f8, icon3.getMinU(), icon3.getMaxV()); } else { tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f8, icon1.getMaxU(), icon1.getMaxV()); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f7, icon1.getMinU(), icon1.getMaxV()); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f7, icon1.getMinU(), icon1.getMinV()); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f8, icon1.getMaxU(), icon1.getMinV()); tessellator.setColorOpaque_F(f, f, f); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f8, icon3.getMaxU(), icon3.getMaxV()); tessellator.addVertexWithUV( f6, (double) par3 + 0.015625D, f7, icon3.getMinU(), icon3.getMaxV()); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f7, icon3.getMinU(), icon3.getMinV()); tessellator.addVertexWithUV( f5, (double) par3 + 0.015625D, f8, icon3.getMaxU(), icon3.getMinV()); } if (!blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { if (blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && blockAccess.getBlockId(par2 - 1, par3 + 1, par4) == Block.redstoneWire.blockID) { tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); tessellator.addVertexWithUV( (double) par2 + 0.015625D, (float) (par3 + 1) + 0.021875F, par4 + 1, icon1.getMaxU(), icon1.getMinV()); tessellator.addVertexWithUV( (double) par2 + 0.015625D, par3 + 0, par4 + 1, icon1.getMinU(), icon1.getMinV()); tessellator.addVertexWithUV( (double) par2 + 0.015625D, par3 + 0, par4 + 0, icon1.getMinU(), icon1.getMaxV()); tessellator.addVertexWithUV( (double) par2 + 0.015625D, (float) (par3 + 1) + 0.021875F, par4 + 0, icon1.getMaxU(), icon1.getMaxV()); tessellator.setColorOpaque_F(f, f, f); tessellator.addVertexWithUV( (double) par2 + 0.015625D, (float) (par3 + 1) + 0.021875F, par4 + 1, icon3.getMaxU(), icon3.getMinV()); tessellator.addVertexWithUV( (double) par2 + 0.015625D, par3 + 0, par4 + 1, icon3.getMinU(), icon3.getMinV()); tessellator.addVertexWithUV( (double) par2 + 0.015625D, par3 + 0, par4 + 0, icon3.getMinU(), icon3.getMaxV()); tessellator.addVertexWithUV( (double) par2 + 0.015625D, (float) (par3 + 1) + 0.021875F, par4 + 0, icon3.getMaxU(), icon3.getMaxV()); } if (blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && blockAccess.getBlockId(par2 + 1, par3 + 1, par4) == Block.redstoneWire.blockID) { tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); tessellator.addVertexWithUV( (double) (par2 + 1) - 0.015625D, par3 + 0, par4 + 1, icon1.getMinU(), icon1.getMaxV()); tessellator.addVertexWithUV( (double) (par2 + 1) - 0.015625D, (float) (par3 + 1) + 0.021875F, par4 + 1, icon1.getMaxU(), icon1.getMaxV()); tessellator.addVertexWithUV( (double) (par2 + 1) - 0.015625D, (float) (par3 + 1) + 0.021875F, par4 + 0, icon1.getMaxU(), icon1.getMinV()); tessellator.addVertexWithUV( (double) (par2 + 1) - 0.015625D, par3 + 0, par4 + 0, icon1.getMinU(), icon1.getMinV()); tessellator.setColorOpaque_F(f, f, f); tessellator.addVertexWithUV( (double) (par2 + 1) - 0.015625D, par3 + 0, par4 + 1, icon3.getMinU(), icon3.getMaxV()); tessellator.addVertexWithUV( (double) (par2 + 1) - 0.015625D, (float) (par3 + 1) + 0.021875F, par4 + 1, icon3.getMaxU(), icon3.getMaxV()); tessellator.addVertexWithUV( (double) (par2 + 1) - 0.015625D, (float) (par3 + 1) + 0.021875F, par4 + 0, icon3.getMaxU(), icon3.getMinV()); tessellator.addVertexWithUV( (double) (par2 + 1) - 0.015625D, par3 + 0, par4 + 0, icon3.getMinU(), icon3.getMinV()); } if (blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && blockAccess.getBlockId(par2, par3 + 1, par4 - 1) == Block.redstoneWire.blockID) { tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); tessellator.addVertexWithUV( par2 + 1, par3 + 0, (double) par4 + 0.015625D, icon1.getMinU(), icon1.getMaxV()); tessellator.addVertexWithUV( par2 + 1, (float) (par3 + 1) + 0.021875F, (double) par4 + 0.015625D, icon1.getMaxU(), icon1.getMaxV()); tessellator.addVertexWithUV( par2 + 0, (float) (par3 + 1) + 0.021875F, (double) par4 + 0.015625D, icon1.getMaxU(), icon1.getMinV()); tessellator.addVertexWithUV( par2 + 0, par3 + 0, (double) par4 + 0.015625D, icon1.getMinU(), icon1.getMinV()); tessellator.setColorOpaque_F(f, f, f); tessellator.addVertexWithUV( par2 + 1, par3 + 0, (double) par4 + 0.015625D, icon3.getMinU(), icon3.getMaxV()); tessellator.addVertexWithUV( par2 + 1, (float) (par3 + 1) + 0.021875F, (double) par4 + 0.015625D, icon3.getMaxU(), icon3.getMaxV()); tessellator.addVertexWithUV( par2 + 0, (float) (par3 + 1) + 0.021875F, (double) par4 + 0.015625D, icon3.getMaxU(), icon3.getMinV()); tessellator.addVertexWithUV( par2 + 0, par3 + 0, (double) par4 + 0.015625D, icon3.getMinU(), icon3.getMinV()); } if (blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && blockAccess.getBlockId(par2, par3 + 1, par4 + 1) == Block.redstoneWire.blockID) { tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); tessellator.addVertexWithUV( par2 + 1, (float) (par3 + 1) + 0.021875F, (double) (par4 + 1) - 0.015625D, icon1.getMaxU(), icon1.getMinV()); tessellator.addVertexWithUV( par2 + 1, par3 + 0, (double) (par4 + 1) - 0.015625D, icon1.getMinU(), icon1.getMinV()); tessellator.addVertexWithUV( par2 + 0, par3 + 0, (double) (par4 + 1) - 0.015625D, icon1.getMinU(), icon1.getMaxV()); tessellator.addVertexWithUV( par2 + 0, (float) (par3 + 1) + 0.021875F, (double) (par4 + 1) - 0.015625D, icon1.getMaxU(), icon1.getMaxV()); tessellator.setColorOpaque_F(f, f, f); tessellator.addVertexWithUV( par2 + 1, (float) (par3 + 1) + 0.021875F, (double) (par4 + 1) - 0.015625D, icon3.getMaxU(), icon3.getMinV()); tessellator.addVertexWithUV( par2 + 1, par3 + 0, (double) (par4 + 1) - 0.015625D, icon3.getMinU(), icon3.getMinV()); tessellator.addVertexWithUV( par2 + 0, par3 + 0, (double) (par4 + 1) - 0.015625D, icon3.getMinU(), icon3.getMaxV()); tessellator.addVertexWithUV( par2 + 0, (float) (par3 + 1) + 0.021875F, (double) (par4 + 1) - 0.015625D, icon3.getMaxU(), icon3.getMaxV()); } } return true; }
private void func_159_a(EntityBeams_Kaevator entitybeams, EnumBeams_Kaevator enumbeams) { GL11.glScalef( enumbeams.sizeX / 256.0F + 0.001F, enumbeams.sizeY / 256.0F + 0.001F, 1.0F / 16.0F); float f = -8.0F; float f1 = -8.0F; EnumPlanks_Kaevator lPlanks[] = EnumPlanks_Kaevator.values(); Tessellator tessellator = Tessellator.instance; for (int iPlank = 0; iPlank < enumbeams.planks.length; iPlank++) { int lCurPlank = enumbeams.planks[iPlank]; float f2 = lPlanks[lCurPlank].Zfront; float f3 = lPlanks[lCurPlank].Zback; float f4 = 0.5F * entitybeams.material; float f5 = 0.5F * (entitybeams.material + lPlanks[lCurPlank].TexSize); float f5_2 = 0.5F * (entitybeams.material + 0.5F); if (!enumbeams.isCollidable) { f5_2 = 0.5F * (entitybeams.material + 1.0F); } float lFactorX = (float) enumbeams.sizeX / 16.0F; float lFactorY = (float) enumbeams.sizeY / 16.0F; float lSide1 = (float) Math.sqrt( Math.pow( ((float) lPlanks[lCurPlank].X2 - (float) lPlanks[lCurPlank].X1) * lFactorX, 2) + Math.pow( ((float) lPlanks[lCurPlank].Y2 - (float) lPlanks[lCurPlank].Y1) * lFactorY, 2)); float lSide2 = (float) Math.sqrt( Math.pow( ((float) lPlanks[lCurPlank].X4 - (float) lPlanks[lCurPlank].X3) * lFactorX, 2) + Math.pow( ((float) lPlanks[lCurPlank].Y4 - (float) lPlanks[lCurPlank].Y3) * lFactorY, 2)); float lTexWrap = (lSide2 - lSide1) / (lSide2 * 2.0F); float lTexHeight = lSide2 / 32.0F; float f6 = lTexWrap * lTexHeight; float f7 = (1.0F - lTexWrap) * lTexHeight; float f8 = lTexHeight; float f9 = 0.0F; tessellator.startDrawingQuads(); func_160_a(entitybeams, entitybeams.red, entitybeams.green, entitybeams.blue); tessellator.setBrightness(240); tessellator.setNormal(0.0F, 0.0F, -1.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f2, f4, f6); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f2, f4, f7); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f2, f5, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f2, f5, f9); tessellator.setNormal(0.0F, 0.0F, 1.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f3, f5, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f3, f5, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f3, f4, f7); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f3, f4, f6); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f2, f5_2, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f2, f5_2, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f3, f4, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f3, f4, f9); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f2, f5_2, f8 / 3.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f2, f5_2, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f3, f4, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f3, f4, f8 / 3.0F); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f2, f5_2, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f2, f5_2, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f3, f4, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f3, f4, f9); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f2, f5_2, f8 / 3.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f2, f5_2, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f3, f4, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f3, f4, f8 / 3.0F); tessellator.draw(); } }