Advertisement
Guest User

Flame Staff Class

a guest
Jul 1st, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. package swords.weapon;
  2.  
  3. import net.minecraft.client.renderer.texture.IconRegister;
  4. import net.minecraft.entity.player.EntityPlayer;
  5. import net.minecraft.entity.projectile.EntitySmallFireball;
  6. import net.minecraft.item.EnumToolMaterial;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.item.ItemSword;
  9. import net.minecraft.world.World;
  10. import swords.entity.EntityFlames;
  11. import swords.main.SwordMain;
  12.  
  13. public class ItemflameStaff extends ItemSword
  14. {
  15. public ItemflameStaff(int par1, EnumToolMaterial par2EnumToolMaterial)
  16. {
  17. super(par1, par2EnumToolMaterial);
  18. this.setCreativeTab(SwordMain.SwordTab);
  19. }
  20.  
  21. public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
  22. {
  23. if (!par3EntityPlayer.capabilities.isCreativeMode)
  24. {
  25. --par1ItemStack.stackSize;
  26. }
  27.  
  28. par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
  29.  
  30. if (!par2World.isRemote)
  31. {
  32. par2World.spawnEntityInWorld(new EntityFlames(par2World, 0.0, 0.0, 0.0));
  33. }
  34.  
  35. return par1ItemStack;
  36. }
  37.  
  38. public void registerIcons(IconRegister iconRegister)
  39. {
  40. itemIcon = iconRegister.registerIcon("swordsmod:staff_Flames");
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement