Fix Gas Masks making you completely invincible
This commit is contained in:
parent
da8a1a78db
commit
d03b2b28be
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue