From 021b27a89aff73ce766234e9bd08c91f5c9cd4d3 Mon Sep 17 00:00:00 2001 From: Jeremy Diamond Date: Mon, 3 Feb 2014 01:34:07 -0800 Subject: [PATCH] Alchemical cap inflicts weakness --- src/com/spiteful/forbidden/FMEventHandler.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/com/spiteful/forbidden/FMEventHandler.java b/src/com/spiteful/forbidden/FMEventHandler.java index 2ef1cb4..39a2e37 100644 --- a/src/com/spiteful/forbidden/FMEventHandler.java +++ b/src/com/spiteful/forbidden/FMEventHandler.java @@ -30,6 +30,8 @@ import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantment; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagString; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.FakePlayer; import net.minecraftforge.event.ForgeSubscribe; @@ -353,6 +355,19 @@ public class FMEventHandler event.setCanceled(true); } } + + if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) + { + ItemStack equip = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem(); + if(equip.getItem() instanceof ItemWandCasting) + { + if(((ItemWandCasting)equip.getItem()).getCap(equip).getTag().equals("alchemical") + && ((ItemWandCasting)equip.getItem()).getRod(equip).getTag().equals("blood")) + { + event.entityLiving.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2)); + } + } + } } @ForgeSubscribe