package info.evshiron.ingresscraft.items;

import info.evshiron.ingresscraft.Constants;
import info.evshiron.ingresscraft.IngressCraft;
import info.evshiron.ingresscraft.client.gui.ScannerGUI;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.EnumHelper;

/**
 * Created by evshiron on 5/25/15.
 */
public class ScannerItem extends ItemArmor {

    public static final String NAME = "scanner";

    private int mTriggerCounter;

    public ScannerItem() {

        super(EnumHelper.addArmorMaterial("XM", 33, new int[]{ 1, 3, 2, 1 }, 0), 0, 0);

        setUnlocalizedName(NAME);
        setTextureName("chainmail_helmet");

    }

    @Override
    public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {

        //System.out.println("tick");

        if(world.isRemote){

            if((!itemStack.hasTagCompound()) || (itemStack.getTagCompound().getInteger("faction") == Constants.Faction.NEUTRAL)) {

                if(mTriggerCounter == 0){

                    player.openGui(IngressCraft.Instance, ScannerGUI.ID, world, (int) player.posX, (int) player.posY, (int) player.posZ);

                }

                mTriggerCounter++;

            }else{

                mTriggerCounter = 0;

            }

        }

    }

}

@@ -388,16 +388,62 @@
 mStack;%0A
+import net.minecraft.util.EnumChatFormatting;%0A
 import n
@@ -468,16 +468,16 @@
 .World;%0A
-
 import n
@@ -519,16 +519,40 @@
 elper;%0A%0A
+import java.util.List;%0A%0A
 /**%0A * C
@@ -867,16 +867,16 @@
 (NAME);%0A
-
         
@@ -915,24 +915,467 @@
 %22);%0A%0A    %7D%0A%0A
+    @Override%0A    public void addInformation(ItemStack itemStack, EntityPlayer player, List lines, boolean p_77624_4_) %7B%0A%0A        if(itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey(%22codename%22)) %7B%0A%0A            lines.add((itemStack.getTagCompound().getInteger(%22faction%22) == Constants.Faction.RESISTANCE ? EnumChatFormatting.BLUE : EnumChatFormatting.GREEN) + itemStack.getTagCompound().getString(%22codename%22));%0A%0A        %7D%0A%0A    %7D%0A%0A
     @Overrid

Add Scanner tooltip