Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DSFoFG.items;
- import net.minecraft.client.renderer.texture.IIconRegister;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.world.World;
- import DSFoFG.Main;
- import DSFoFG.entities.powerPack;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- public class blaster extends Item {
- private String texturePath = "dsfofg:";
- public blaster(int ItemID, String textureName)
- {
- super();
- this.setUnlocalizedName(textureName);
- this.setCreativeTab(Main.dsfofgWeapons);
- texturePath += textureName;
- }
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister iconRegister)
- {
- this.itemIcon = iconRegister.registerIcon(texturePath);
- }
- @Override
- public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) {
- if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(null))
- {
- par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
- if (!par2World.isRemote)
- {
- par2World.spawnEntityInWorld(new powerPack(par2World, par3EntityPlayer));
- }
- }
- return par1ItemStack;
- }
- /**
- * Returns True is the item is renderer in full 3D when hold.
- */
- @SideOnly(Side.CLIENT)
- public boolean isFull3D()
- {
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement