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;
@ -64,6 +65,8 @@ public class ItemGasMask extends ItemArmor
ItemScubaTank tank = (ItemScubaTank)base.getCurrentItemOrArmor(3).getItem(); ItemScubaTank tank = (ItemScubaTank)base.getCurrentItemOrArmor(3).getItem();
if(tank.getFlowing(base.getCurrentItemOrArmor(3)) && tank.getGas(base.getCurrentItemOrArmor(3)) != null) if(tank.getFlowing(base.getCurrentItemOrArmor(3)) && tank.getGas(base.getCurrentItemOrArmor(3)) != null)
{
if(event.source == DamageSource.magic)
{ {
event.setCanceled(true); event.setCanceled(true);
} }
@ -71,3 +74,4 @@ public class ItemGasMask extends ItemArmor
} }
} }
} }
}