2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty.items;
|
|
|
|
|
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import biomesoplenty.BiomesOPlenty;
|
|
|
|
import biomesoplenty.items.projectiles.EntityMudball;
|
|
|
|
|
|
|
|
public class ItemBOPMudball extends Item
|
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
public ItemBOPMudball(int par1)
|
|
|
|
{
|
|
|
|
super(par1);
|
|
|
|
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void registerIcons(IconRegister iconRegister)
|
|
|
|
{
|
|
|
|
itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
|
|
{
|
|
|
|
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
|
|
--itemStack.stackSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
|
|
|
|
|
|
|
if (!par2World.isRemote) {
|
2013-07-02 03:57:49 +00:00
|
|
|
par2World.spawnEntityInWorld(new EntityMudball(par2World));
|
2013-05-31 10:34:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return itemStack;
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|