Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package avidpenguin.bettercraft.block;
- import avidpenguin.bettercraft.BetterCraft;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import java.util.Random;
- 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.item.Item;
- import net.minecraft.util.Icon;
- public class BlockTomato extends Block
- {
- @SideOnly(Side.CLIENT)
- private Icon theIcon;
- protected BlockTomato(int par1)
- {
- super(par1, Material.pumpkin);
- }
- @SideOnly(Side.CLIENT)
- /**
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
- */
- public Icon getIcon(int par1, int par2)
- {
- return par1 != 1 && par1 != 0 ? this.blockIcon : this.theIcon;
- }
- /**
- * Returns the ID of the items to drop on destruction.
- */
- public int idDropped(int par1, Random par2Random, int par3)
- {
- return BetterCraft.tomato.itemID;
- }
- /**
- * Returns the quantity of items to drop on block destruction.
- */
- public int quantityDropped(Random par1Random)
- {
- return 3 + par1Random.nextInt(5);
- }
- /**
- * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive).
- */
- public int quantityDroppedWithBonus(int par1, Random par2Random)
- {
- int j = this.quantityDropped(par2Random) + par2Random.nextInt(1 + par1);
- if (j > 9)
- {
- j = 9;
- }
- return j;
- }
- @SideOnly(Side.CLIENT)
- /**
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
- * is the only chance you get to register icons.
- */
- public void registerIcons(IconRegister par1IconRegister)
- {
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
- this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement