Advertisement
Guest User

Untitled

a guest
Dec 10th, 2014
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. package DSFoFG.items;
  2.  
  3. import net.minecraft.client.renderer.texture.IIconRegister;
  4. import net.minecraft.entity.player.EntityPlayer;
  5. import net.minecraft.item.Item;
  6. import net.minecraft.item.ItemStack;
  7. import net.minecraft.world.World;
  8. import DSFoFG.Main;
  9. import DSFoFG.entities.powerPack;
  10. import cpw.mods.fml.relauncher.Side;
  11. import cpw.mods.fml.relauncher.SideOnly;
  12.  
  13.  
  14. public class blaster extends Item {
  15.  
  16. private String texturePath = "dsfofg:";
  17.  
  18. public blaster(int ItemID, String textureName)
  19. {
  20. super();
  21. this.setUnlocalizedName(textureName);
  22. this.setCreativeTab(Main.dsfofgWeapons);
  23. texturePath += textureName;
  24. }
  25.  
  26. @Override
  27. @SideOnly(Side.CLIENT)
  28.  
  29. public void registerIcons(IIconRegister iconRegister)
  30. {
  31. this.itemIcon = iconRegister.registerIcon(texturePath);
  32. }
  33.  
  34.  
  35.  
  36. @Override
  37. public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) {
  38. if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(null))
  39. {
  40. par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
  41. if (!par2World.isRemote)
  42. {
  43. par2World.spawnEntityInWorld(new powerPack(par2World, par3EntityPlayer));
  44. }
  45. }
  46. return par1ItemStack;
  47. }
  48.  
  49. /**
  50. * Returns True is the item is renderer in full 3D when hold.
  51. */
  52. @SideOnly(Side.CLIENT)
  53. public boolean isFull3D()
  54. {
  55. return true;
  56. }
  57.  
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement