From d1a51bb691c8f9d369f5e6757fd1f1d0b4b932c5 Mon Sep 17 00:00:00 2001 From: allstar69 Date: Sat, 20 Jul 2013 14:03:16 -0700 Subject: [PATCH] Improved efficiency with staff and orb effects. --- common/MysticWorld/Items/ItemOrb.java | 20 +++++ common/MysticWorld/Items/ItemOrbAir.java | 40 ++++++--- common/MysticWorld/Items/ItemOrbEarth.java | 31 ++++--- common/MysticWorld/Items/ItemOrbEnergy.java | 38 ++++++--- common/MysticWorld/Items/ItemOrbFire.java | 85 ++++++++++++++++++-- common/MysticWorld/Items/ItemOrbWater.java | 31 ++++--- common/MysticWorld/Items/ItemStaff.java | 5 +- common/MysticWorld/Items/ItemStaffAir.java | 24 +++++- common/MysticWorld/Items/ItemStaffEarth.java | 31 +++++-- common/MysticWorld/Items/ItemStaffEnegy.java | 21 ++++- common/MysticWorld/Items/ItemStaffFire.java | 21 +++++ common/MysticWorld/Items/ItemStaffWater.java | 25 ++++-- common/MysticWorld/TickHandler.java | 29 ------- 13 files changed, 300 insertions(+), 101 deletions(-) create mode 100644 common/MysticWorld/Items/ItemOrb.java diff --git a/common/MysticWorld/Items/ItemOrb.java b/common/MysticWorld/Items/ItemOrb.java new file mode 100644 index 0000000..3de9b04 --- /dev/null +++ b/common/MysticWorld/Items/ItemOrb.java @@ -0,0 +1,20 @@ +package MysticWorld.Items; + +import java.util.Random; + +import MysticWorld.MysticWorld; +import net.minecraft.item.Item; + +public class ItemOrb extends Item { + + Random rand = new Random(); + + public ItemOrb(int id) + { + super(id); + this.setMaxStackSize(1); + this.setMaxDamage(200); + this.setCreativeTab(MysticWorld.MysticWorldTab); + } + +} diff --git a/common/MysticWorld/Items/ItemOrbAir.java b/common/MysticWorld/Items/ItemOrbAir.java index 96d78a7..d71f6ed 100644 --- a/common/MysticWorld/Items/ItemOrbAir.java +++ b/common/MysticWorld/Items/ItemOrbAir.java @@ -1,24 +1,44 @@ package MysticWorld.Items; +import java.util.Random; + import MysticWorld.MysticWorld; import MysticWorld.Entity.EntityChargeAir; import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -public class ItemOrbAir extends Item { - - public ItemOrbAir(int par1) +public class ItemOrbAir extends ItemOrb +{ + public ItemOrbAir(int id) { - super(par1); - this.setMaxStackSize(1); - this.setMaxDamage(200); - this.setCreativeTab(MysticWorld.MysticWorldTab); + super(id); } + @Override + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) + { + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + player.fallDistance = 0.0F; + MysticWorld.proxy.airFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } + } + + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { if (entityPlayer.onGround) @@ -31,10 +51,4 @@ public class ItemOrbAir extends Item { return itemStack; } - @Override - public void registerIcons(IconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("MysticTextures:OrbAir"); - } - } diff --git a/common/MysticWorld/Items/ItemOrbEarth.java b/common/MysticWorld/Items/ItemOrbEarth.java index 37e219b..1ea8f25 100644 --- a/common/MysticWorld/Items/ItemOrbEarth.java +++ b/common/MysticWorld/Items/ItemOrbEarth.java @@ -12,10 +12,13 @@ import net.minecraft.block.BlockSapling; import net.minecraft.block.BlockStem; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -24,22 +27,32 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.Event.Result; import net.minecraftforge.event.entity.player.BonemealEvent; -public class ItemOrbEarth extends Item { - - public ItemOrbEarth(int par1) +public class ItemOrbEarth extends ItemOrb +{ + public ItemOrbEarth(int id) { - super(par1); - this.setMaxStackSize(1); - this.setMaxDamage(200); - this.setCreativeTab(MysticWorld.MysticWorldTab); + super(id); } @Override - public void registerIcons(IconRegister iconRegister) + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) { - itemIcon = iconRegister.registerIcon("MysticTextures:OrbEarth"); + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } } + @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) diff --git a/common/MysticWorld/Items/ItemOrbEnergy.java b/common/MysticWorld/Items/ItemOrbEnergy.java index 93bdf0c..7fb5a8e 100644 --- a/common/MysticWorld/Items/ItemOrbEnergy.java +++ b/common/MysticWorld/Items/ItemOrbEnergy.java @@ -5,21 +5,41 @@ import MysticWorld.Blocks.BlockHandler; import MysticWorld.Entity.EntityChargeAir; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -public class ItemOrbEnergy extends Item { +public class ItemOrbEnergy extends ItemOrb { - public ItemOrbEnergy(int par1) + public ItemOrbEnergy(int id) { - super(par1); - this.setMaxStackSize(1); - this.setMaxDamage(200); - this.setCreativeTab(MysticWorld.MysticWorldTab); + super(id); } + @Override + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) + { + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2)); + MysticWorld.proxy.energyFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } + } + + @Override public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par7 == 0) @@ -70,11 +90,5 @@ public class ItemOrbEnergy extends Item { return true; } } - - @Override - public void registerIcons(IconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("MysticTextures:OrbEnergy"); - } } diff --git a/common/MysticWorld/Items/ItemOrbFire.java b/common/MysticWorld/Items/ItemOrbFire.java index 3ee6fdf..ba0d6ee 100644 --- a/common/MysticWorld/Items/ItemOrbFire.java +++ b/common/MysticWorld/Items/ItemOrbFire.java @@ -1,7 +1,10 @@ package MysticWorld.Items; +import java.util.Random; + import MysticWorld.MysticWorld; import MysticWorld.Entity.EntityChargeAir; +import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -16,15 +19,80 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -public class ItemOrbFire extends ItemFlintAndSteel { - - public ItemOrbFire(int par1) - { - super(par1); - this.setMaxStackSize(1); - this.setMaxDamage(200); - this.setCreativeTab(MysticWorld.MysticWorldTab); +public class ItemOrbFire extends ItemOrb { + + public ItemOrbFire(int id) { + super(id); } + + @Override + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) + { + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0)); + MysticWorld.proxy.fireFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } + } + + @Override + 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) + { + --par5; + } + + if (par7 == 1) + { + ++par5; + } + + if (par7 == 2) + { + --par6; + } + + if (par7 == 3) + { + ++par6; + } + + if (par7 == 4) + { + --par4; + } + + if (par7 == 5) + { + ++par4; + } + + if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) + { + return false; + } + else + { + if (par3World.isAirBlock(par4, par5, par6)) + { + par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + par3World.setBlock(par4, par5, par6, Block.fire.blockID); + } + + par1ItemStack.damageItem(1, par2EntityPlayer); + return true; + } + } public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) { @@ -36,6 +104,7 @@ public class ItemOrbFire extends ItemFlintAndSteel { return true; } + @Override public boolean onLeftClickEntity(ItemStack itemStack, EntityPlayer entityPlayer, Entity entity) { entity.setFire(5); diff --git a/common/MysticWorld/Items/ItemOrbWater.java b/common/MysticWorld/Items/ItemOrbWater.java index 17d6c40..a9c74bf 100644 --- a/common/MysticWorld/Items/ItemOrbWater.java +++ b/common/MysticWorld/Items/ItemOrbWater.java @@ -8,10 +8,13 @@ import MysticWorld.Entity.EntityChargeAir; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -19,24 +22,32 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.Event; import net.minecraftforge.event.entity.player.FillBucketEvent; -public class ItemOrbWater extends Item { - - Random rand = new Random(); +public class ItemOrbWater extends ItemOrb { - public ItemOrbWater(int par1) + public ItemOrbWater(int id) { - super(par1); - this.setMaxStackSize(1); - this.setMaxDamage(200); - this.setCreativeTab(MysticWorld.MysticWorldTab); + super(id); } @Override - public void registerIcons(IconRegister iconRegister) + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) { - itemIcon = iconRegister.registerIcon("MysticTextures:OrbWater"); + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (itemStack != null) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + MysticWorld.proxy.waterFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } } + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true); diff --git a/common/MysticWorld/Items/ItemStaff.java b/common/MysticWorld/Items/ItemStaff.java index 87316dc..ef48216 100644 --- a/common/MysticWorld/Items/ItemStaff.java +++ b/common/MysticWorld/Items/ItemStaff.java @@ -1,5 +1,7 @@ package MysticWorld.Items; +import java.util.Random; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import MysticWorld.MysticWorld; @@ -7,7 +9,8 @@ import net.minecraft.item.Item; public class ItemStaff extends Item { - + Random rand = new Random(); + public ItemStaff(int id) { super(id); diff --git a/common/MysticWorld/Items/ItemStaffAir.java b/common/MysticWorld/Items/ItemStaffAir.java index d96b55c..603459d 100644 --- a/common/MysticWorld/Items/ItemStaffAir.java +++ b/common/MysticWorld/Items/ItemStaffAir.java @@ -1,5 +1,7 @@ package MysticWorld.Items; +import java.util.Random; + import org.lwjgl.input.Keyboard; import cpw.mods.fml.relauncher.Side; @@ -9,6 +11,7 @@ import MysticWorld.MysticWorld; import MysticWorld.Entity.EntityChargeAir; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -16,16 +19,29 @@ import net.minecraft.item.ItemTool; import net.minecraft.world.World; public class ItemStaffAir extends ItemStaff { - + public ItemStaffAir(int id) { super(id); } @Override - public void registerIcons(IconRegister iconRegister) + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) { - itemIcon = iconRegister.registerIcon("MysticTextures:StaffAir"); + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + player.fallDistance = 0.0F; + MysticWorld.proxy.airFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } } public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) @@ -56,5 +72,5 @@ public class ItemStaffAir extends ItemStaff { return itemStack; } - + } diff --git a/common/MysticWorld/Items/ItemStaffEarth.java b/common/MysticWorld/Items/ItemStaffEarth.java index c984b71..636a1c3 100644 --- a/common/MysticWorld/Items/ItemStaffEarth.java +++ b/common/MysticWorld/Items/ItemStaffEarth.java @@ -14,6 +14,7 @@ import net.minecraft.block.BlockSapling; import net.minecraft.block.BlockStem; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.item.EntityItem; @@ -29,18 +30,32 @@ import net.minecraftforge.event.Event.Result; import net.minecraftforge.event.entity.player.BonemealEvent; import net.minecraftforge.event.entity.player.UseHoeEvent; -public class ItemStaffEarth extends ItemStaff { - - public ItemStaffEarth(int id) { +public class ItemStaffEarth extends ItemStaff +{ + public ItemStaffEarth(int id) + { super(id); } - @Override - public void registerIcons(IconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("MysticTextures:StaffEarth"); - } + @Override + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) + { + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } + } + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) diff --git a/common/MysticWorld/Items/ItemStaffEnegy.java b/common/MysticWorld/Items/ItemStaffEnegy.java index 9ee03c5..66c8e87 100644 --- a/common/MysticWorld/Items/ItemStaffEnegy.java +++ b/common/MysticWorld/Items/ItemStaffEnegy.java @@ -9,9 +9,12 @@ import MysticWorld.Entity.EntityChargeFire; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -23,11 +26,25 @@ public class ItemStaffEnegy extends ItemStaff { } @Override - public void registerIcons(IconRegister iconRegister) + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) { - itemIcon = iconRegister.registerIcon("MysticTextures:StaffEnergy"); + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2)); + MysticWorld.proxy.energyFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } } + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) diff --git a/common/MysticWorld/Items/ItemStaffFire.java b/common/MysticWorld/Items/ItemStaffFire.java index b68293c..763e054 100644 --- a/common/MysticWorld/Items/ItemStaffFire.java +++ b/common/MysticWorld/Items/ItemStaffFire.java @@ -19,6 +19,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; @@ -30,6 +32,25 @@ public class ItemStaffFire extends ItemStaff { super(id); } + @Override + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) + { + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0)); + MysticWorld.proxy.fireFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } + } + public boolean itemInteractionForEntity(ItemStack itemStack, EntityLiving entityLiving) { if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) diff --git a/common/MysticWorld/Items/ItemStaffWater.java b/common/MysticWorld/Items/ItemStaffWater.java index 0c6ecf3..e9d9ae7 100644 --- a/common/MysticWorld/Items/ItemStaffWater.java +++ b/common/MysticWorld/Items/ItemStaffWater.java @@ -10,6 +10,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; @@ -31,12 +32,25 @@ public class ItemStaffWater extends ItemStaff { this.setCreativeTab(MysticWorld.MysticWorldTab); } - @Override - public void registerIcons(IconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("MysticTextures:StaffWater"); - } + @Override + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) + { + EntityPlayer player = (EntityPlayer)entity; + ItemStack currentItem = player.inventory.getCurrentItem(); + + if (!world.isRemote) + { + if (currentItem != null) + { + if (currentItem.itemID == itemStack.itemID) + { + MysticWorld.proxy.waterFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); + } + } + } + } + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer){ if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { @@ -142,4 +156,5 @@ public class ItemStaffWater extends ItemStaff { return itemStack; } } + } \ No newline at end of file diff --git a/common/MysticWorld/TickHandler.java b/common/MysticWorld/TickHandler.java index 71ab27a..99d5cc0 100644 --- a/common/MysticWorld/TickHandler.java +++ b/common/MysticWorld/TickHandler.java @@ -43,8 +43,6 @@ public class TickHandler implements IScheduledTickHandler InventoryPlayer inventory = player.inventory; ItemStack itemstack = inventory.getCurrentItem(); - staffAndOrbTick(player, world, itemstack, rand); - pillarTick(player, world, inventory, rand); } @@ -128,31 +126,4 @@ public class TickHandler implements IScheduledTickHandler } } } - - private static void staffAndOrbTick(EntityPlayer player, World world, ItemStack itemstack, Random rand) - { - if (itemstack != null && (itemstack.itemID == ItemHandler$1.fireOrb.itemID || itemstack.itemID == ItemHandler$1.fireStaff.itemID)){ - player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0)); - MysticWorld.proxy.fireFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); - } - - if (itemstack != null && (itemstack.itemID == ItemHandler$1.airOrb.itemID || itemstack.itemID == ItemHandler$1.airStaff.itemID)){ - player.fallDistance = 0.0F; - MysticWorld.proxy.airFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); - } - - if (itemstack != null && (itemstack.itemID == ItemHandler$1.energyOrb.itemID || itemstack.itemID == ItemHandler$1.energyStaff.itemID)){ - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2)); - MysticWorld.proxy.energyFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); - player.stepHeight = 1.001F; - } - - if (itemstack != null && (itemstack.itemID == ItemHandler$1.earthOrb.itemID || itemstack.itemID == ItemHandler$1.earthStaff.itemID)){ - MysticWorld.proxy.earthFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); - } - - if (itemstack != null && (itemstack.itemID == ItemHandler$1.waterOrb.itemID || itemstack.itemID == ItemHandler$1.waterStaff.itemID)){ - MysticWorld.proxy.waterFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F); - } - } } \ No newline at end of file