gt:         if (source.isUnblockable()) {
context: /*******************************************************************************
   * Copyright (c) 2014 Tombenpotter.
   * All rights reserved. 
   *
   * This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
   * which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
   *
   * This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
   * Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
   * http://www.minecraftforum.net/topic/1585216-
   ******************************************************************************/
  package electricMagicTools.tombenpotter.electricmagictools.common.items.armor.goggles;
  
  import cpw.mods.fml.relauncher.Side;
  import cpw.mods.fml.relauncher.SideOnly;
  import electricMagicTools.tombenpotter.electricmagictools.common.Config;
  import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
  import electricMagicTools.tombenpotter.electricmagictools.common.ElectricMagicTools;
  import ic2.api.item.ElectricItem;
  import ic2.api.item.IElectricItem;
  import ic2.api.item.IMetalArmor;
  import net.minecraft.client.renderer.texture.IIconRegister;
  import net.minecraft.creativetab.CreativeTabs;
  import net.minecraft.entity.Entity;
  import net.minecraft.entity.EntityLivingBase;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.init.Items;
  import net.minecraft.item.Item;
  import net.minecraft.item.ItemArmor;
  import net.minecraft.item.ItemStack;
  import net.minecraft.potion.Potion;
  import net.minecraft.potion.PotionEffect;
  import net.minecraft.util.DamageSource;
  import net.minecraft.util.MathHelper;
  import net.minecraft.world.World;
  import net.minecraftforge.common.ISpecialArmor;
  import thaumcraft.api.IGoggles;
  import thaumcraft.api.IVisDiscountGear;
  import thaumcraft.api.aspects.Aspect;
  import thaumcraft.api.nodes.IRevealer;
  
  import java.util.*;
  
  public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
      @SuppressWarnings({"unchecked", "rawtypes"})
      private static final Map<Integer, Integer> potionCost = new HashMap();
  
      public ItemQuantumThaumicHelmet(int par3, int par4) {
          super(ArmorMaterial.DIAMOND, par3, par4);
          this.setCreativeTab(CreativeTab.tabTombenpotter);
          this.setMaxDamage(27);
          this.setMaxStackSize(1);
  
          potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
          potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
          potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
      }
  
      public int maxCharge = 10000000;
  
      @SideOnly(Side.CLIENT)
      @Override
      public void registerIcons(IIconRegister iconRegister) {
          this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":quantumthaumichelmet");
      }
  
      @Override
      public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
          return ElectricMagicTools.texturePath + ":textures/models/thaumicquantumhelmet.png";
      }
  
      @Override
      public boolean canProvideEnergy(ItemStack itemStack) {
          return false;
      }
  
      @Override
      public int getMaxCharge(ItemStack itemStack) {
          return maxCharge;
      }
  
      @Override
      public int getTier(ItemStack itemStack) {
          return 2;
      }
  
      @SuppressWarnings({"rawtypes", "unchecked"})
      @Override
      public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
          int refill = player.getAir();
          if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
              player.setAir(refill + 200);
              ElectricItem.manager.use(itemStack, 1000, null);
          }
  
          Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
          do {
              if (!i$.hasNext()) {
                  break;
              }
              {
                  PotionEffect effect = (PotionEffect) i$.next();
                  int id = effect.getPotionID();
                  Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
                  if (cost != null) {
                      cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
                      if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
                          ElectricItem.manager.use(itemStack, cost.intValue(), null);
                          ItemStack milk = (new ItemStack(Items.milk_bucket));
                          player.curePotionEffects(milk);
                      }
                  }
              }
          } while (true);
  
          if (Config.nightVisionOff == false) {
              if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
                  int x = MathHelper.floor_double(player.posX);
                  int z = MathHelper.floor_double(player.posZ);
                  int y = MathHelper.floor_double(player.posY);
                  int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
                  if (lightlevel >= 0)
                      player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
                  ElectricItem.manager.use(itemStack, 1 / 1000, player);
              } else {
                  player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
              }
          }
      }
  
      @Override
      public int getTransferLimit(ItemStack itemStack) {
          return 10000;
      }
  
      @SuppressWarnings({"rawtypes", "unchecked"})
      @SideOnly(Side.CLIENT)
      public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
          ItemStack itemStack = new ItemStack(this, 1);
          if (getChargedItem(itemStack) == this) {
              ItemStack charged = new ItemStack(this, 1);
              ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
              itemList.add(charged);
          }
          if (getEmptyItem(itemStack) == this) {
              itemList.add(new ItemStack(this, 1, getMaxDamage()));
          }
      }
  
      @Override
      public boolean isRepairable() {
          return false;
      }
  
      @Override
      public int getItemEnchantability() {
          if (Config.enchanting == false) {
              return 0;
          } else {
              return 4;
          }
      }
  
      @Override
      public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
          if (Config.enchanting == false) {
              return false;
          } else {
              return true;
          }
      }
  
      @SuppressWarnings({"rawtypes", "unchecked"})
      @Override
      public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
          list.add("Vis discount: 8%");
      }
  
      @Override
      public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
          return 8;
      }
  
      @Override
      public boolean showNodes(ItemStack itemstack, EntityLivingBase player) {
          return true;
      }
  
      @Override
      public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) {
          return true;
      }
  
      @Override
      public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
          return true;
      }
  
      @Override
      public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
  