Added functionality to the Fire Orb
This commit is contained in:
parent
f07b7cca04
commit
3153517c72
1 changed files with 14 additions and 13 deletions
|
|
@ -2,31 +2,32 @@ package MysticWorld.Items;
|
|||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Entity.EntityChargeAir;
|
||||
import net.minecraft.block.BlockCloth;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFlintAndSteel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemOrbFire extends Item {
|
||||
public class ItemOrbFire extends ItemFlintAndSteel {
|
||||
|
||||
public ItemOrbFire(int par1)
|
||||
{
|
||||
super(par1);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(64);
|
||||
this.setMaxDamage(500);
|
||||
this.setCreativeTab(MysticWorld.MysticWorldTab);
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
|
||||
{
|
||||
world.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving)
|
||||
{
|
||||
entityLiving.setFire(5);
|
||||
|
||||
itemStack.damageItem(1, entityLiving);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue