From 0b7d4442ee354377d70bdcfc78c57bf9118bd9de Mon Sep 17 00:00:00 2001 From: Arcaratus Date: Mon, 23 Mar 2015 17:48:41 -0400 Subject: [PATCH] Update CreativeDagger.java --- .../common/items/CreativeDagger.java | 40 ++----------------- 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeDagger.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeDagger.java index 62a0cbad..efafc60c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeDagger.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/CreativeDagger.java @@ -8,7 +8,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; public class CreativeDagger extends Item { @@ -23,25 +23,6 @@ public class CreativeDagger extends Item public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par3EntityPlayer.capabilities.isCreativeMode) - { - SacrificeKnifeUsedEvent evt = new SacrificeKnifeUsedEvent(par3EntityPlayer, true, true, 2); - if(MinecraftForge.EVENT_BUS.post(evt)) - { - return par1ItemStack; - } - - if(evt.shouldDrainHealth) - { - par3EntityPlayer.setHealth(par3EntityPlayer.getHealth() - 2); - } - - if(!evt.shouldFillAltar) - { - return par1ItemStack; - } - } - if (par3EntityPlayer instanceof FakePlayer) { return par1ItemStack; @@ -65,20 +46,7 @@ public class CreativeDagger extends Item { return par1ItemStack; } - - if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionSoulFray)) - { - findAndFillAltar(par2World, par3EntityPlayer, Integer.MAX_VALUE); - } else - { - findAndFillAltar(par2World, par3EntityPlayer, Integer.MAX_VALUE); - } - - if (par3EntityPlayer.getHealth() <= 0.001f) - { - par3EntityPlayer.onDeath(DamageSource.generic); - } - + findAndFillAltar(par2World, par3EntityPlayer, Integer.MAX_VALUE); return par1ItemStack; } @@ -87,7 +55,7 @@ public class CreativeDagger extends Item int posX = (int) Math.round(player.posX - 0.5f); int posY = (int) player.posY; int posZ = (int) Math.round(player.posZ - 0.5f); - IBloodAltar altarEntity = getAltar(world, posX, posY, posZ); + TEAltar altarEntity = getAltar(world, posX, posY, posZ); if (altarEntity == null) { @@ -98,7 +66,7 @@ public class CreativeDagger extends Item altarEntity.startCycle(); } - public IBloodAltar getAltar(World world, int x, int y, int z) + public TEAltar getAltar(World world, int x, int y, int z) { TileEntity tileEntity = null;