for (final ItemStack armorStack : player.inventory.armorInventory)
{
if (armorStack != null && armorStack.getItem() instanceof IBreathableArmor)
{
final IBreathableArmor breathableArmor = (IBreathableArmor) armorStack.getItem();
if (breathableArmor.handleGearType(EnumGearType.HELMET))
{
if (breathableArmor.canBreathe(armorStack, player, EnumGearType.HELMET))
{
handled = true;
}
}
}
}
if (!handled)
{
missingComponent = true;
}
}
if (stats.extendedInventory.getStackInSlot(1) == null || !OxygenUtil.isItemValidForPlayerTankInv(1, stats.extendedInventory.getStackInSlot(1)))
{
boolean handled = false;
for (final ItemStack armorStack : player.inventory.armorInventory)
{
if (armorStack != null && armorStack.getItem() instanceof IBreathableArmor)
{
final IBreathableArmor breathableArmor = (IBreathableArmor) armorStack.getItem();
if (breathableArmor.handleGearType(EnumGearType.GEAR))
{
if (breathableArmor.canBreathe(armorStack, player, EnumGearType.GEAR))
{
handled = true;
}
}
}
}
if (!handled)
{
missingComponent = true;
}
}
if ((stats.extendedInventory.getStackInSlot(2) == null || !OxygenUtil.isItemValidForPlayerTankInv(2, stats.extendedInventory.getStackInSlot(2))) && (stats.extendedInventory.getStackInSlot(3) == null || !OxygenUtil.isItemValidForPlayerTankInv(3, stats.extendedInventory.getStackInSlot(3))))
{
boolean handled = false;
for (final ItemStack armorStack : player.inventory.armorInventory)
{
if (armorStack != null && armorStack.getItem() instanceof IBreathableArmor)
{
final IBreathableArmor breathableArmor = (IBreathableArmor) armorStack.getItem();
if (breathableArmor.handleGearType(EnumGearType.TANK1))
{
if (breathableArmor.canBreathe(armorStack, player, EnumGearType.TANK1))
{
handled = true;
}
}
if (breathableArmor.handleGearType(EnumGearType.TANK2))
{
if (breathableArmor.canBreathe(armorStack, player, EnumGearType.TANK2))
{
handled = true;
}
}
}