From 7bd52ee29cacf022bf08763d7f1a77d4c28f5a8c Mon Sep 17 00:00:00 2001 From: allstar69 Date: Tue, 2 Jul 2013 00:35:02 -0700 Subject: [PATCH] Fixed earth, fire, and energy staves. They now shoot entities. --- common/MysticWorld/Items/ItemStaffEarth.java | 22 ++++++++------- common/MysticWorld/Items/ItemStaffEnegy.java | 28 +++++++++++--------- common/MysticWorld/Items/ItemStaffFire.java | 28 +++++++++++--------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/common/MysticWorld/Items/ItemStaffEarth.java b/common/MysticWorld/Items/ItemStaffEarth.java index 14c26fc..66ca166 100644 --- a/common/MysticWorld/Items/ItemStaffEarth.java +++ b/common/MysticWorld/Items/ItemStaffEarth.java @@ -61,19 +61,21 @@ public class ItemStaffEarth extends Item { return false; } } - else - { - world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)entityPlayer.posX, (int)entityPlayer.posY, (int)entityPlayer.posZ, 0); + return true; + } - if (!world.isRemote) - { - world.spawnEntityInWorld(new EntityChargeEarth(world, entityPlayer)); - - itemStack.damageItem(1, entityPlayer); - } + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) + { + world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)entityPlayer.posX, (int)entityPlayer.posY, (int)entityPlayer.posZ, 0); + + if (!world.isRemote) + { + world.spawnEntityInWorld(new EntityChargeEarth(world, entityPlayer)); - return true; + itemStack.damageItem(1, entityPlayer); } + + return itemStack; } public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) diff --git a/common/MysticWorld/Items/ItemStaffEnegy.java b/common/MysticWorld/Items/ItemStaffEnegy.java index 02ace8a..c5bdcb8 100644 --- a/common/MysticWorld/Items/ItemStaffEnegy.java +++ b/common/MysticWorld/Items/ItemStaffEnegy.java @@ -79,19 +79,21 @@ public class ItemStaffEnegy extends Item{ return true; } } - else - { - world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)entityPlayer.posX, (int)entityPlayer.posY, (int)entityPlayer.posZ, 0); - - if (!world.isRemote) - { - world.spawnEntityInWorld(new EntityChargeEnergy(world, entityPlayer)); - - itemStack.damageItem(1, entityPlayer); - } - - return true; - } + return true; + } + + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) + { + world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)entityPlayer.posX, (int)entityPlayer.posY, (int)entityPlayer.posZ, 0); + + if (!world.isRemote) + { + world.spawnEntityInWorld(new EntityChargeEnergy(world, entityPlayer)); + + itemStack.damageItem(1, entityPlayer); + } + + return itemStack; } } diff --git a/common/MysticWorld/Items/ItemStaffFire.java b/common/MysticWorld/Items/ItemStaffFire.java index 3beab17..dee70c1 100644 --- a/common/MysticWorld/Items/ItemStaffFire.java +++ b/common/MysticWorld/Items/ItemStaffFire.java @@ -106,19 +106,21 @@ public class ItemStaffFire extends Item { return true; } } - else - { - world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)entityPlayer.posX, (int)entityPlayer.posY, (int)entityPlayer.posZ, 0); - - if (!world.isRemote) - { - world.spawnEntityInWorld(new EntityChargeFire(world, entityPlayer)); - - itemStack.damageItem(1, entityPlayer); - } - - return true; - } + return true; + } + + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) + { + world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)entityPlayer.posX, (int)entityPlayer.posY, (int)entityPlayer.posZ, 0); + + if (!world.isRemote) + { + world.spawnEntityInWorld(new EntityChargeFire(world, entityPlayer)); + + itemStack.damageItem(1, entityPlayer); + } + + return itemStack; } }