private boolean isCorrectBlock(BlockPos pos) { Block block = WBlock.getBlock(pos); if(!(block instanceof IGrowable) || block instanceof BlockGrass || !((IGrowable)block).canGrow(WMinecraft.getWorld(), pos, WBlock.getState(pos), false)) return false; if(block instanceof BlockSapling) return saplings.isChecked(); else if(block instanceof BlockCrops) return crops.isChecked(); else if(block instanceof BlockStem) return stems.isChecked(); else if(block instanceof BlockCocoa) return cocoa.isChecked(); else return other.isChecked(); }
public static boolean isNormalCrop(World world, BlockPos pos) { if (world.isAirBlock(pos)) { return false; } boolean found = false; IBlockState state = world.getBlockState(pos); Block bi = state.getBlock(); for (int a = 0; a < 16; a++) { if ((getCrops(CropType.NORMAL).contains(bi.getUnlocalizedName() + a))) { found = true; break; } } int md = bi.getMetaFromState(state); if ((((bi instanceof IGrowable)) && (!(bi instanceof BlockStem))) || (((bi instanceof BlockCrops)) && (!found)) || ((bi == Blocks.NETHER_WART)) || ((bi == Blocks.COCOA)) || (getCrops(CropType.NORMAL).contains(bi.getUnlocalizedName() + md))) { return true; } return false; }
public static int getStemColorMultiplier(BlockStem blockStem, IBlockAccess blockAccess, int x, int y, int z) { if (stemColors == null) { return blockStem.colorMultiplier(blockAccess, x, y, z); } else { int level = blockAccess.getBlockMetadata(x, y, z); if (level < 0) { level = 0; } if (level >= stemColors.length) { level = stemColors.length - 1; } return stemColors[level]; } }
@Override public boolean isGrown(Point3I plantPoint, Block plantBlock, IBlockState state, World worldObj) { int metadata = plantBlock.getMetaFromState(state); //check pumpkins and mellons first if (plantBlock instanceof BlockStem) { for (EnumFacing facing : EnumFacing.Plane.HORIZONTAL) { Block testBlock = worldObj.getBlockState(plantPoint.toPosition().offset(facing)).getBlock(); if ( (testBlock == Blocks.MELON_BLOCK) || (testBlock == Blocks.PUMPKIN) ) return true; } } else if (plantBlock instanceof IGrowable) { return !((IGrowable)plantBlock).canGrow(worldObj, plantPoint.toPosition(), state, true); } else if (plantBlock instanceof BlockNetherWart) { //nether wart return (metadata >= 3); } else if (plantBlock == Blocks.REEDS) { // sugar cane return (worldObj.getBlockState(plantPoint.toPosition().up()).getBlock() == Blocks.REEDS); } else if (plantBlock == Blocks.CACTUS) { //cactus return (worldObj.getBlockState(plantPoint.toPosition().up()).getBlock() == Blocks.CACTUS); } return false; }
@Override public List<ItemStack> harvestPlant(Point3I plantPoint, Block plantBlock, IBlockState state, World worldObj) { if (plantBlock instanceof BlockStem) { for (EnumFacing facing : EnumFacing.Plane.HORIZONTAL) { IBlockState testState = worldObj.getBlockState(plantPoint.toPosition().offset(facing)); Block testBlock = testState.getBlock(); if ( (testBlock == Blocks.MELON_BLOCK) || (testBlock == Blocks.PUMPKIN) ) { plantPoint.fromPosition(plantPoint.toPosition().offset(facing)); return super.harvestPlant(plantPoint, testBlock, testState, worldObj); } } } if ( (plantBlock == Blocks.REEDS) || (plantBlock == Blocks.CACTUS) ) { plantPoint.setY(plantPoint.getY() + 1); state = worldObj.getBlockState(plantPoint.toPosition()); plantBlock = state.getBlock(); } return super.harvestPlant(plantPoint, plantBlock, state, worldObj); }
public static boolean isGrownCrop(World world, BlockPos pos) { if (world.isAirBlock(pos)) { return false; } boolean found = false; IBlockState state = world.getBlockState(pos); Block bi = state.getBlock(); for (int a = 0; a < 16; a++) { if ((getCrops(CropType.NORMAL).contains(bi.getUnlocalizedName() + a)) || (getCrops(CropType.STACKED).contains(bi.getUnlocalizedName() + a)) || (getCrops(CropType.CLICKABLE).contains(bi.getUnlocalizedName() + a))) { found = true; break; } } Block biB = world.getBlockState(pos.down()).getBlock(); int md = bi.getMetaFromState(state); if ((((bi instanceof IGrowable)) && (!((IGrowable)bi).canGrow(world, pos, state, world.isRemote)) && (!(bi instanceof BlockStem))) || (((bi instanceof BlockCrops)) && ((BlockCrops)bi).isMaxAge(state) && (!found)) || ((bi == Blocks.NETHER_WART) && (state.getValue(BlockNetherWart.AGE).intValue() >= 3)) || ((bi == Blocks.COCOA) && (state.getValue(BlockCocoa.AGE).intValue() >= 2)) || (getCrops(CropType.NORMAL).contains(bi.getUnlocalizedName() + md)) || (getCrops(CropType.STACKED).contains(bi.getUnlocalizedName() + md)) || ((getCrops(CropType.CLICKABLE).contains(bi.getUnlocalizedName() + md)) && (biB == bi))) { return true; } return false; }
@Override protected void scanBlockPosition(BlockPos position) { IBlockState state = getWorld().getBlockState(position); if (getWorld().isAirBlock(position)) { state = getWorld().getBlockState(position.down()); if (state.getBlock() == Blocks.DIRT || state.getBlock() == Blocks.GRASS) { blocksToTill.add(position.down()); } else if (state.getBlock() == Blocks.FARMLAND || !getWorld().isAirBlock(position.down())) { blocksToPlant.add(position); } } else if (FarmUtil.isCrop(getWorld(), position)) { if (FarmUtil.isGrownCrop(getWorld(), position)) { blocksToHarvest.add(position); } else { blocksToFertilize.add(position); } } else if (state.getBlock() instanceof BlockStem) { if (state.getValue(BlockStem.AGE) >= 7) { stem : for(EnumFacing face : EnumFacing.HORIZONTALS){ IBlockState state2 = getWorld().getBlockState(position.offset(face)); if(state2.getBlock() == Blocks.MELON_BLOCK || state2.getBlock() == Blocks.PUMPKIN){ blocksToHarvest.add(position.offset(face)); break stem; } } } else { blocksToFertilize.add(position); } } }
public boolean renderBlockStem(Block p_147724_1_, int p_147724_2_, int p_147724_3_, int p_147724_4_) { BlockStem var5 = (BlockStem)p_147724_1_; Tessellator var6 = Tessellator.instance; var6.setBrightness(var5.getBlockBrightness(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_)); int var7 = CustomColorizer.getStemColorMultiplier(var5, this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); float var8 = (float)(var7 >> 16 & 255) / 255.0F; float var9 = (float)(var7 >> 8 & 255) / 255.0F; float var10 = (float)(var7 & 255) / 255.0F; if (EntityRenderer.anaglyphEnable) { float var14 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; var8 = var14; var9 = var12; var10 = var13; } var6.setColorOpaque_F(var8, var9, var10); var5.setBlockBoundsBasedOnState(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); int var141 = var5.func_149873_e(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); if (var141 < 0) { this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), this.renderMaxY, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); } else { this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), 0.5D, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); this.renderBlockStemBig(var5, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), var141, this.renderMaxY, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); } return true; }
public boolean renderBlockStem(Block p_147724_1_, int p_147724_2_, int p_147724_3_, int p_147724_4_) { BlockStem blockstem = (BlockStem)p_147724_1_; Tessellator tessellator = Tessellator.instance; tessellator.setBrightness(blockstem.getMixedBrightnessForBlock(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_)); int l = blockstem.colorMultiplier(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); float f = (float)(l >> 16 & 255) / 255.0F; float f1 = (float)(l >> 8 & 255) / 255.0F; float f2 = (float)(l & 255) / 255.0F; if (EntityRenderer.anaglyphEnable) { float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; f = f3; f1 = f4; f2 = f5; } tessellator.setColorOpaque_F(f, f1, f2); blockstem.setBlockBoundsBasedOnState(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); int i1 = blockstem.getState(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); if (i1 < 0) { this.renderBlockStemSmall(blockstem, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), this.renderMaxY, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); } else { this.renderBlockStemSmall(blockstem, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), 0.5D, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); this.renderBlockStemBig(blockstem, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), i1, this.renderMaxY, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); } return true; }
public boolean func_78603_m(Block p_78603_1_, int p_78603_2_, int p_78603_3_, int p_78603_4_) { BlockStem var5 = (BlockStem)p_78603_1_; Tessellator var6 = Tessellator.field_78398_a; var6.func_78380_c(var5.func_71874_e(this.field_78669_a, p_78603_2_, p_78603_3_, p_78603_4_)); float var7 = 1.0F; int var8 = var5.func_71920_b(this.field_78669_a, p_78603_2_, p_78603_3_, p_78603_4_); float var9 = (float)(var8 >> 16 & 255) / 255.0F; float var10 = (float)(var8 >> 8 & 255) / 255.0F; float var11 = (float)(var8 & 255) / 255.0F; if(EntityRenderer.field_78517_a) { float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; var9 = var12; var10 = var13; var11 = var14; } var6.func_78386_a(var7 * var9, var7 * var10, var7 * var11); var5.func_71902_a(this.field_78669_a, p_78603_2_, p_78603_3_, p_78603_4_); int var15 = var5.func_72265_d(this.field_78669_a, p_78603_2_, p_78603_3_, p_78603_4_); if(var15 < 0) { this.func_78575_a(var5, this.field_78669_a.func_72805_g(p_78603_2_, p_78603_3_, p_78603_4_), this.field_83024_j, (double)p_78603_2_, (double)((float)p_78603_3_ - 0.0625F), (double)p_78603_4_); } else { this.func_78575_a(var5, this.field_78669_a.func_72805_g(p_78603_2_, p_78603_3_, p_78603_4_), 0.5D, (double)p_78603_2_, (double)((float)p_78603_3_ - 0.0625F), (double)p_78603_4_); this.func_78606_a(var5, this.field_78669_a.func_72805_g(p_78603_2_, p_78603_3_, p_78603_4_), var15, this.field_83024_j, (double)p_78603_2_, (double)((float)p_78603_3_ - 0.0625F), (double)p_78603_4_); } return true; }
/** * Render block stem */ public boolean renderBlockStem(Block par1Block, int par2, int par3, int par4) { BlockStem blockstem = (BlockStem)par1Block; Tessellator tessellator = Tessellator.instance; tessellator.setBrightness(blockstem.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); float f = 1.0F; int l = blockstem.colorMultiplier(this.blockAccess, par2, par3, par4); float f1 = (float)(l >> 16 & 255) / 255.0F; float f2 = (float)(l >> 8 & 255) / 255.0F; float f3 = (float)(l & 255) / 255.0F; if (EntityRenderer.anaglyphEnable) { float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; f1 = f4; f2 = f5; f3 = f6; } tessellator.setColorOpaque_F(f * f1, f * f2, f * f3); blockstem.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); int i1 = blockstem.getState(this.blockAccess, par2, par3, par4); if (i1 < 0) { this.renderBlockStemSmall(blockstem, this.blockAccess.getBlockMetadata(par2, par3, par4), this.renderMaxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); } else { this.renderBlockStemSmall(blockstem, this.blockAccess.getBlockMetadata(par2, par3, par4), 0.5D, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); this.renderBlockStemBig(blockstem, this.blockAccess.getBlockMetadata(par2, par3, par4), i1, this.renderMaxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); } return true; }
public void initBlocks() { PumpkinCarvier.block_pumpkin = (BlockPumpkin) new BlockPumpkin(false).setHardness(1.0F).setStepSound(Block.soundTypeWood).setBlockName("pumpkin").setBlockTextureName(PumpkinCarvier.MODID + ":pumpkin_transparent"); PumpkinCarvier.block_lit_pumpkin = (BlockPumpkin) new BlockPumpkin(true).setHardness(1.0F).setStepSound(Block.soundTypeWood).setLightLevel(1.0F).setBlockName("litpumpkin").setBlockTextureName(PumpkinCarvier.MODID + ":pumpkin_transparent"); PumpkinCarvier.item_pumpkin = new ItemPumpkin(PumpkinCarvier.block_pumpkin); PumpkinCarvier.item_lit_pumpkin = new ItemPumpkin(PumpkinCarvier.block_lit_pumpkin); replaceBlock(Blocks.pumpkin, PumpkinCarvier.block_pumpkin, PumpkinCarvier.item_pumpkin, true); replaceBlock(Blocks.lit_pumpkin, PumpkinCarvier.block_lit_pumpkin, PumpkinCarvier.item_lit_pumpkin, true); Reflection.setValue(BlockStem.class, (BlockStem) Blocks.pumpkin_stem, Blocks.pumpkin, PumpkinCarvier.F_STEM_PLANT); }
@Override public boolean canHarvest(@Nonnull IFarmer farm, @Nonnull BlockPos bc, @Nonnull Block block, @Nonnull IBlockState meta) { if (!harvestExcludes.contains(block) && block instanceof IGrowable && !(block instanceof BlockStem)) { return !((IGrowable) block).canGrow(farm.getWorld(), bc, meta, true); } return false; }
public static boolean isCrop(Block block) { return block instanceof BlockCrops || block instanceof BlockStem; }
public void renderBlockStemBig(BlockStem p_147740_1_, int p_147740_2_, int p_147740_3_, double p_147740_4_, double p_147740_6_, double p_147740_8_, double p_147740_10_) { Tessellator var12 = Tessellator.instance; IIcon var13 = p_147740_1_.func_149872_i(); if (this.hasOverrideBlockTexture()) { var13 = this.overrideBlockTexture; } double var14 = (double)var13.getMinU(); double var16 = (double)var13.getMinV(); double var18 = (double)var13.getMaxU(); double var20 = (double)var13.getMaxV(); double var22 = p_147740_6_ + 0.5D - 0.5D; double var24 = p_147740_6_ + 0.5D + 0.5D; double var26 = p_147740_10_ + 0.5D - 0.5D; double var28 = p_147740_10_ + 0.5D + 0.5D; double var30 = p_147740_6_ + 0.5D; double var32 = p_147740_10_ + 0.5D; if ((p_147740_3_ + 1) / 2 % 2 == 1) { double var34 = var18; var18 = var14; var14 = var34; } if (p_147740_3_ < 2) { var12.addVertexWithUV(var22, p_147740_8_ + p_147740_4_, var32, var14, var16); var12.addVertexWithUV(var22, p_147740_8_ + 0.0D, var32, var14, var20); var12.addVertexWithUV(var24, p_147740_8_ + 0.0D, var32, var18, var20); var12.addVertexWithUV(var24, p_147740_8_ + p_147740_4_, var32, var18, var16); var12.addVertexWithUV(var24, p_147740_8_ + p_147740_4_, var32, var18, var16); var12.addVertexWithUV(var24, p_147740_8_ + 0.0D, var32, var18, var20); var12.addVertexWithUV(var22, p_147740_8_ + 0.0D, var32, var14, var20); var12.addVertexWithUV(var22, p_147740_8_ + p_147740_4_, var32, var14, var16); } else { var12.addVertexWithUV(var30, p_147740_8_ + p_147740_4_, var28, var14, var16); var12.addVertexWithUV(var30, p_147740_8_ + 0.0D, var28, var14, var20); var12.addVertexWithUV(var30, p_147740_8_ + 0.0D, var26, var18, var20); var12.addVertexWithUV(var30, p_147740_8_ + p_147740_4_, var26, var18, var16); var12.addVertexWithUV(var30, p_147740_8_ + p_147740_4_, var26, var18, var16); var12.addVertexWithUV(var30, p_147740_8_ + 0.0D, var26, var18, var20); var12.addVertexWithUV(var30, p_147740_8_ + 0.0D, var28, var14, var20); var12.addVertexWithUV(var30, p_147740_8_ + p_147740_4_, var28, var14, var16); } }
public void renderBlockStemBig(BlockStem p_147740_1_, int p_147740_2_, int p_147740_3_, double p_147740_4_, double p_147740_6_, double p_147740_8_, double p_147740_10_) { Tessellator tessellator = Tessellator.instance; IIcon iicon = p_147740_1_.getStemIcon(); if (this.hasOverrideBlockTexture()) { iicon = this.overrideBlockTexture; } double d4 = (double)iicon.getMinU(); double d5 = (double)iicon.getMinV(); double d6 = (double)iicon.getMaxU(); double d7 = (double)iicon.getMaxV(); double d8 = p_147740_6_ + 0.5D - 0.5D; double d9 = p_147740_6_ + 0.5D + 0.5D; double d10 = p_147740_10_ + 0.5D - 0.5D; double d11 = p_147740_10_ + 0.5D + 0.5D; double d12 = p_147740_6_ + 0.5D; double d13 = p_147740_10_ + 0.5D; if ((p_147740_3_ + 1) / 2 % 2 == 1) { double d14 = d6; d6 = d4; d4 = d14; } if (p_147740_3_ < 2) { tessellator.addVertexWithUV(d8, p_147740_8_ + p_147740_4_, d13, d4, d5); tessellator.addVertexWithUV(d8, p_147740_8_ + 0.0D, d13, d4, d7); tessellator.addVertexWithUV(d9, p_147740_8_ + 0.0D, d13, d6, d7); tessellator.addVertexWithUV(d9, p_147740_8_ + p_147740_4_, d13, d6, d5); tessellator.addVertexWithUV(d9, p_147740_8_ + p_147740_4_, d13, d6, d5); tessellator.addVertexWithUV(d9, p_147740_8_ + 0.0D, d13, d6, d7); tessellator.addVertexWithUV(d8, p_147740_8_ + 0.0D, d13, d4, d7); tessellator.addVertexWithUV(d8, p_147740_8_ + p_147740_4_, d13, d4, d5); } else { tessellator.addVertexWithUV(d12, p_147740_8_ + p_147740_4_, d11, d4, d5); tessellator.addVertexWithUV(d12, p_147740_8_ + 0.0D, d11, d4, d7); tessellator.addVertexWithUV(d12, p_147740_8_ + 0.0D, d10, d6, d7); tessellator.addVertexWithUV(d12, p_147740_8_ + p_147740_4_, d10, d6, d5); tessellator.addVertexWithUV(d12, p_147740_8_ + p_147740_4_, d10, d6, d5); tessellator.addVertexWithUV(d12, p_147740_8_ + 0.0D, d10, d6, d7); tessellator.addVertexWithUV(d12, p_147740_8_ + 0.0D, d11, d4, d7); tessellator.addVertexWithUV(d12, p_147740_8_ + p_147740_4_, d11, d4, d5); } }
public void func_78606_a(BlockStem p_78606_1_, int p_78606_2_, int p_78606_3_, double p_78606_4_, double p_78606_6_, double p_78606_8_, double p_78606_10_) { Tessellator var12 = Tessellator.field_78398_a; Icon var13 = p_78606_1_.func_94368_p(); if(this.func_94167_b()) { var13 = this.field_78664_d; } double var14 = (double)var13.func_94209_e(); double var16 = (double)var13.func_94206_g(); double var18 = (double)var13.func_94212_f(); double var20 = (double)var13.func_94210_h(); double var22 = p_78606_6_ + 0.5D - 0.5D; double var24 = p_78606_6_ + 0.5D + 0.5D; double var26 = p_78606_10_ + 0.5D - 0.5D; double var28 = p_78606_10_ + 0.5D + 0.5D; double var30 = p_78606_6_ + 0.5D; double var32 = p_78606_10_ + 0.5D; if((p_78606_3_ + 1) / 2 % 2 == 1) { double var34 = var18; var18 = var14; var14 = var34; } if(p_78606_3_ < 2) { var12.func_78374_a(var22, p_78606_8_ + p_78606_4_, var32, var14, var16); var12.func_78374_a(var22, p_78606_8_ + 0.0D, var32, var14, var20); var12.func_78374_a(var24, p_78606_8_ + 0.0D, var32, var18, var20); var12.func_78374_a(var24, p_78606_8_ + p_78606_4_, var32, var18, var16); var12.func_78374_a(var24, p_78606_8_ + p_78606_4_, var32, var18, var16); var12.func_78374_a(var24, p_78606_8_ + 0.0D, var32, var18, var20); var12.func_78374_a(var22, p_78606_8_ + 0.0D, var32, var14, var20); var12.func_78374_a(var22, p_78606_8_ + p_78606_4_, var32, var14, var16); } else { var12.func_78374_a(var30, p_78606_8_ + p_78606_4_, var28, var14, var16); var12.func_78374_a(var30, p_78606_8_ + 0.0D, var28, var14, var20); var12.func_78374_a(var30, p_78606_8_ + 0.0D, var26, var18, var20); var12.func_78374_a(var30, p_78606_8_ + p_78606_4_, var26, var18, var16); var12.func_78374_a(var30, p_78606_8_ + p_78606_4_, var26, var18, var16); var12.func_78374_a(var30, p_78606_8_ + 0.0D, var26, var18, var20); var12.func_78374_a(var30, p_78606_8_ + 0.0D, var28, var14, var20); var12.func_78374_a(var30, p_78606_8_ + p_78606_4_, var28, var14, var16); } }
/** * Render block stem big */ public void renderBlockStemBig(BlockStem par1BlockStem, int par2, int par3, double par4, double par6, double par8, double par10) { Tessellator tessellator = Tessellator.instance; Icon icon = par1BlockStem.getStemIcon(); if (this.hasOverrideBlockTexture()) { icon = this.overrideBlockTexture; } double d4 = (double)icon.getMinU(); double d5 = (double)icon.getMinV(); double d6 = (double)icon.getMaxU(); double d7 = (double)icon.getMaxV(); double d8 = par6 + 0.5D - 0.5D; double d9 = par6 + 0.5D + 0.5D; double d10 = par10 + 0.5D - 0.5D; double d11 = par10 + 0.5D + 0.5D; double d12 = par6 + 0.5D; double d13 = par10 + 0.5D; if ((par3 + 1) / 2 % 2 == 1) { double d14 = d6; d6 = d4; d4 = d14; } if (par3 < 2) { tessellator.addVertexWithUV(d8, par8 + par4, d13, d4, d5); tessellator.addVertexWithUV(d8, par8 + 0.0D, d13, d4, d7); tessellator.addVertexWithUV(d9, par8 + 0.0D, d13, d6, d7); tessellator.addVertexWithUV(d9, par8 + par4, d13, d6, d5); tessellator.addVertexWithUV(d9, par8 + par4, d13, d6, d5); tessellator.addVertexWithUV(d9, par8 + 0.0D, d13, d6, d7); tessellator.addVertexWithUV(d8, par8 + 0.0D, d13, d4, d7); tessellator.addVertexWithUV(d8, par8 + par4, d13, d4, d5); } else { tessellator.addVertexWithUV(d12, par8 + par4, d11, d4, d5); tessellator.addVertexWithUV(d12, par8 + 0.0D, d11, d4, d7); tessellator.addVertexWithUV(d12, par8 + 0.0D, d10, d6, d7); tessellator.addVertexWithUV(d12, par8 + par4, d10, d6, d5); tessellator.addVertexWithUV(d12, par8 + par4, d10, d6, d5); tessellator.addVertexWithUV(d12, par8 + 0.0D, d10, d6, d7); tessellator.addVertexWithUV(d12, par8 + 0.0D, d11, d4, d7); tessellator.addVertexWithUV(d12, par8 + par4, d11, d4, d5); } }