// Path: src/main/java/openperipheral/addons/api/ITerminalIdAccess.java
// public interface ITerminalIdAccess extends IApiInterface {
// 	public Optional<Long> getIdFrom(EntityPlayer player);
// 
// 	public boolean setIdFor(EntityPlayer player, long guid);
// 
// 	public void register(ITerminalIdGetter getter);
// 
// 	public void register(ITerminalIdSetter setter);
// }
// 
// Path: src/main/java/openperipheral/addons/api/ITerminalIdGetter.java
// public interface ITerminalIdGetter {
// 	public Optional<Long> getFor(EntityPlayer player);
// 
// 	public int getPriority();
// }
// 
// Path: src/main/java/openperipheral/addons/api/ITerminalIdSetter.java
// public interface ITerminalIdSetter {
// 	public boolean setFor(EntityPlayer player, long terminalId);
// 
// 	public int getPriority();
// }
// 
// Path: src/main/java/openperipheral/addons/api/ITerminalItem.java
// public interface ITerminalItem {
// 	public Long getTerminalGuid(ItemStack stack);
// 
// 	public void bindToTerminal(ItemStack stack, long guid);
// }


import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.primitives.Ints;
import java.util.Arrays;
import java.util.Comparator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import openmods.access.ApiSingleton;
import openperipheral.addons.api.ITerminalIdAccess;
import openperipheral.addons.api.ITerminalIdGetter;
import openperipheral.addons.api.ITerminalIdSetter;
import openperipheral.addons.api.ITerminalItem;
import org.apache.commons.lang3.ArrayUtils;
			final ItemStack stack = player.getHeldItem();
			return stack != null? setFor(stack, guid) : false;
		}

		protected abstract boolean setFor(ItemStack helmet, long guid);

		@Override
		public int getPriority() {
			return 0;
		}
	}

	public static class InterfaceGetter extends HelmetGetterAdapter {
		@Override
		public Optional<Long> getFor(ItemStack stack) {
			final Item item = stack.getItem();
			if (item instanceof ITerminalItem) {
				final ITerminalItem terminalItem = (ITerminalItem)item;
				return Optional.fromNullable(terminalItem.getTerminalGuid(stack));
			}

			return Optional.absent();
		}
	}

	public static class InterfaceSetter extends HandSetterAdapter {
		@Override
		public boolean setFor(ItemStack stack, long guid) {
			final Item item = stack.getItem();
			if (item instanceof ITerminalItem) {
// Path: src/main/java/openperipheral/addons/api/ITerminalIdAccess.java
// public interface ITerminalIdAccess extends IApiInterface {
// 	public Optional<Long> getIdFrom(EntityPlayer player);
// 
// 	public boolean setIdFor(EntityPlayer player, long guid);
// 
// 	public void register(ITerminalIdGetter getter);
// 
// 	public void register(ITerminalIdSetter setter);
// }
// 
// Path: src/main/java/openperipheral/addons/api/ITerminalIdGetter.java
// public interface ITerminalIdGetter {
// 	public Optional<Long> getFor(EntityPlayer player);
// 
// 	public int getPriority();
// }
// 
// Path: src/main/java/openperipheral/addons/api/ITerminalIdSetter.java
// public interface ITerminalIdSetter {
// 	public boolean setFor(EntityPlayer player, long terminalId);
// 
// 	public int getPriority();
// }
// 
// Path: src/main/java/openperipheral/addons/api/ITerminalItem.java
// public interface ITerminalItem {
// 	public Long getTerminalGuid(ItemStack stack);
// 
// 	public void bindToTerminal(ItemStack stack, long guid);
// }


// Path: src/main/java/openperipheral/addons/glasses/TerminalIdAccess.java
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.primitives.Ints;
import java.util.Arrays;
import java.util.Comparator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import openmods.access.ApiSingleton;
import openperipheral.addons.api.ITerminalIdAccess;
import openperipheral.addons.api.ITerminalIdGetter;
import openperipheral.addons.api.ITerminalIdSetter;
import openperipheral.addons.api.ITerminalItem;
import org.apache.commons.lang3.ArrayUtils;

			final ItemStack stack = player.getHeldItem();
			return stack != null? setFor(stack, guid) : false;
		}

		protected abstract boolean setFor(ItemStack helmet, long guid);

		@Override
		public int getPriority() {
			return 0;
		}
	}

	public static class InterfaceGetter extends HelmetGetterAdapter {
		@Override
		public Optional<Long> getFor(ItemStack stack) {
			final Item item = stack.getItem();
			if (item instanceof ITerminalItem) {
				final ITerminalItem terminalItem = (ITerminalItem)item;
				return Optional.fromNullable(terminalItem.getTerminalGuid(stack));
			}

			return Optional.absent();
		}
	}

	public static class InterfaceSetter extends HandSetterAdapter {
		@Override
		public boolean setFor(ItemStack stack, long guid) {
			final Item item = stack.getItem();
			if (item instanceof ITerminalItem) {
				final ITerminalItem terminalItem = (ITerminalItem)item;