Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.bplaced.spenk.drugmod.items;
- import net.bplaced.spenk.drugmod.DrugsMod;
- import net.minecraft.block.Block;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.world.World;
- import net.minecraftforge.common.EnumPlantType;
- import net.minecraftforge.common.ForgeDirection;
- import net.minecraftforge.common.IPlantable;
- public class ItemCanabisSeed extends Item implements IPlantable
- {
- public ItemCanabisSeed(int par1)
- {
- super(par1);
- setItemConfigurations();
- }
- private void setItemConfigurations(){
- setUnlocalizedName("Canabis seed");
- setCreativeTab(DrugsMod.customTab);
- func_111206_d("drugmod:canabis_seed");
- }
- /**
- * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
- * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
- */
- public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
- {
- if (par7 != 1)
- {
- return false;
- }
- else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack))
- {
- int i1 = par3World.getBlockId(par4, par5, par6);
- if (i1 == DrugsMod.blockSeedpot.blockID){
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- }
- @Override
- public EnumPlantType getPlantType(World world, int x, int y, int z)
- {
- return EnumPlantType.Crop;
- }
- @Override
- public int getPlantID(World world, int x, int y, int z)
- {
- return DrugsMod.blockPotCanabis.blockID;
- }
- @Override
- public int getPlantMetadata(World world, int x, int y, int z)
- {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment