Updated method
This commit is contained in:
parent
b3796c4a3f
commit
75a25c7415
2 changed files with 12 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ package mysticworld.items;
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
|
|
@ -15,6 +16,14 @@ public class ItemOrbFire extends ItemOrb {
|
||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityPlayer, EntityLivingBase entity) {
|
||||||
|
entity.setFire(5);
|
||||||
|
entity.attackEntityFrom(DamageSource.magic, 7);
|
||||||
|
itemStack.damageItem(1, entityPlayer);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||||
if (par7 == 0) {
|
if (par7 == 0) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package mysticworld.items;
|
||||||
import mysticworld.MysticWorld;
|
import mysticworld.MysticWorld;
|
||||||
import mysticworld.entity.EntityChargeFire;
|
import mysticworld.entity.EntityChargeFire;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
@ -22,7 +22,8 @@ public class ItemStaffFire extends ItemStaff {
|
||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) {
|
@Override
|
||||||
|
public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityPlayer, EntityLivingBase entityLiving) {
|
||||||
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||||
entityLiving.setFire(5);
|
entityLiving.setFire(5);
|
||||||
entityLiving.attackEntityFrom(DamageSource.magic, 7);
|
entityLiving.attackEntityFrom(DamageSource.magic, 7);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue