Fix Gas Masks making you completely invincible

This commit is contained in:
Aidan C. Brady 2014-01-15 07:22:50 -05:00
parent da8a1a78db
commit d03b2b28be

View file

@ -9,6 +9,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraftforge.common.EnumHelper; import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.ForgeSubscribe;
@ -65,7 +66,10 @@ public class ItemGasMask extends ItemArmor
if(tank.getFlowing(base.getCurrentItemOrArmor(3)) && tank.getGas(base.getCurrentItemOrArmor(3)) != null) if(tank.getFlowing(base.getCurrentItemOrArmor(3)) && tank.getGas(base.getCurrentItemOrArmor(3)) != null)
{ {
event.setCanceled(true); if(event.source == DamageSource.magic)
{
event.setCanceled(true);
}
} }
} }
} }