Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package EmeraldsPlus.common.Items;
- import java.util.Random;
- import EmeraldsPlus.common.Blocks.EmeraldsPlusBlocks;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.StringTranslate;
- import net.minecraft.world.World;
- public class ItemCarrotPlacer extends Item
- {
- public ItemCarrotPlacer(int i)
- {
- super(i);
- maxStackSize = 1;
- setMaxDamage(19);
- }
- public String getItemDisplayName(ItemStack par1ItemStack)
- {
- String var2 = ("\u00a76" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim();
- return var2;
- }
- @Override
- 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 == 0)
- {
- --par5;
- }
- if (par7 == 1)
- {
- ++par5;
- }
- if (par7 == 2)
- {
- --par6;
- }
- if (par7 == 3)
- {
- ++par6;
- }
- if (par7 == 4)
- {
- --par4;
- }
- if (par7 == 5)
- {
- ++par4;
- }
- if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
- {
- return false;
- }
- else
- {
- int var11 = par3World.getBlockId(par4, par5, par6);
- if (var11 == 0)
- {
- par3World.playSoundEffect(par4, par5, par6, "EmeraldsPlusF.ccp", 0.2F, 1.0F);
- par3World.setBlockWithNotify(par4, par5, par6, EmeraldsPlusBlocks.CarrotCake.blockID);
- }
- else
- {
- par3World.playSoundEffect(par4, par5, par6, "mob.wolf.bark", 0.8F, 5.0F);
- }
- par1ItemStack.damageItem(1, par2EntityPlayer);
- return true;
- }
- }
- public String getTextureFile()
- {
- return "/EmeraldsPlusF/EmeraldsPlus_Items.png";
- }
- public String Version()
- {
- return "1.4.7";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment