Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Commit

Permalink
Fix wills not applying. Closes #372
Browse files Browse the repository at this point in the history
  • Loading branch information
williewillus committed Jul 21, 2016
1 parent 252e319 commit 1638138
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
Expand All @@ -48,6 +49,7 @@ public ItemTerrasteelHelm() {

public ItemTerrasteelHelm(String name) {
super(EntityEquipmentSlot.HEAD, name);
MinecraftForge.EVENT_BUS.register(this);
}

@Override
Expand Down Expand Up @@ -123,7 +125,7 @@ public void onEntityAttacked(LivingHurtEvent event) {
EntityPlayer player = (EntityPlayer) attacker;
if(hasArmorSet(player)) {
boolean crit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(MobEffects.BLINDNESS) && !player.isRiding();
ItemStack stack = player.inventory.armorItemInSlot(3);
ItemStack stack = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if(crit && stack != null && stack.getItem() instanceof ItemTerrasteelHelm) {
boolean ahrim = hasAncientWill(stack, 0);
boolean dharok = hasAncientWill(stack, 1);
Expand Down

0 comments on commit 1638138

Please sign in to comment.