mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-11-19 03:39:08 +00:00
Alchemical cap inflicts weakness
This commit is contained in:
1 parent
cbf1dc21f1
commit
021b27a89a
1 file changed
+15
@@ -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
|
||||
|
||||
Reference in new issue
Block a user