package tdwp_ftw.biomesop.blocks; import java.util.Random; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockSmolderingGrass extends Block { private Icon[] blockIcon = new Icon[6]; public BlockSmolderingGrass(int par1) { super(par1, Material.grass); this.setTickRandomly(true); this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); } @Override public void registerIcons(IconRegister par1IconRegister) { this.blockIcon[0] = par1IconRegister.registerIcon("BiomesOPlenty:smolderinggrass3"); this.blockIcon[1] = par1IconRegister.registerIcon("BiomesOPlenty:smolderinggrass1"); this.blockIcon[2] = par1IconRegister.registerIcon("BiomesOPlenty:smolderinggrass2"); this.blockIcon[3] = par1IconRegister.registerIcon("BiomesOPlenty:smolderinggrass2"); this.blockIcon[4] = par1IconRegister.registerIcon("BiomesOPlenty:smolderinggrass2"); this.blockIcon[5] = par1IconRegister.registerIcon("BiomesOPlenty:smolderinggrass2"); } public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) { return blockIcon[par1]; } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ /*public int getBlockTextureFromSideAndMetadata(int par1, int par2) { return par1 == 1 ? 122 : (par1 == 0 ? 124 : 123); }*/ /** * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side */ /*public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { if (par5 == 1) { return 122; } else if (par5 == 0) { return 124; } else { Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4); return var6 != Material.snow && var6 != Material.craftedSnow ? 123 : 123; } }*/ /** * A randomly called display update to be able to add particles or other items for display */ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { super.randomDisplayTick(par1World, par2, par3, par4, par5Random); if (par5Random.nextInt(4) == 0) { par1World.spawnParticle("smoke", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + 1.1F), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D); } if (par5Random.nextInt(6) == 0) { par1World.spawnParticle("flame", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + 1.1F), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D); } } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { return 0; } }