package com.zivilon.cinder_loe.items; import cpw.mods.fml.common.network.simpleimpl.IMessage; import java.util.List; import lotr.common.LOTRCreativeTabs; import lotr.common.LOTRLevelData; import lotr.common.LOTRMod; import lotr.common.fac.LOTRFaction; import lotr.common.network.LOTRPacketHandler; import lotr.common.network.LOTRPacketWeaponFX; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.potion.Potion; import net.minecraft.server.MinecraftServer; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import com.zivilon.cinder_loe.items.WizardStaff; import com.zivilon.cinder_loe.entity.SarumanWhiteFireball; public class SarumanWhiteStaff extends WizardStaff { public SarumanWhiteStaff() { super(); } public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { entityplayer.swingItem(); itemstack.damageItem(2, (EntityLivingBase)entityplayer); world.playSoundAtEntity((Entity)entityplayer, "mob.ghast.fireball", 2.0F, (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2F + 1.0F); if (!world.isRemote) { world.spawnEntityInWorld((Entity)new SarumanWhiteFireball(world, (EntityLivingBase)entityplayer)); LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)entityplayer); LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)entityplayer, 64.0D)); } return itemstack; } }