package net.shadowfacts.enfusion.item.tool;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.shadowfacts.enfusion.energy.EFItemEnergyContainer;
import net.shadowfacts.enfusion.entity.EntityMiningLaser;

public class ItemMiningLaser extends EFItemEnergyContainer {

	public ItemMiningLaser() {
		super(32000, 64);
		this.setMaxStackSize(1);
	}
	
	@Override
	public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
		itemStack.damageItem(1, player);
		world.playSoundAtEntity(player, "random.bow", 0.5f, 0.4f / (itemRand.nextFloat() * 0.4f + 0.8f));
		if (!world.isRemote) {
			if (getEnergyStored(itemStack) >= 16) {
				world.spawnEntityInWorld(new EntityMiningLaser(world, player));
				this.extractEnergy(itemStack, 16, false);
			}
		}
		
		return itemStack;
	}

//	Display how much energy is stored on the tooltip
//	@Override
//	@SideOnly(Side.CLIENT)
//	public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isShifting) {
//		list.add(String.format("%sEnergy Stored%s: %d/%d RF", StringHelper.YELLOW, StringHelper.WHITE, getEnergyStored(stack), this.capacity));
//	}
//
////	Mining Lasers with both no energy and full energy.
//	@Override
//	public void getSubItems(Item item, CreativeTabs tab, List list) {
//		list.add(EnergyUtils.setEnergyInStack(new ItemStack(item, 1, 0), 0));
//		list.add(EnergyUtils.setEnergyInStack(new ItemStack(item, 1, 0), this.capacity));
//	}
//
//	@Override
//	public int getDisplayDamage(ItemStack stack) {
//		return capacity - getEnergyStored(stack);
//	}
//
//	@Override
//	public int getMaxDamage(ItemStack stack) {
//		return getMaxEnergyStored();
//	}
//
//	@Override
//	public boolean isDamaged(ItemStack stack) {
//		return true;
//	}
//
////	IEnergyContainerItem
//	@Override
//	public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
//		if (container.stackTagCompound == null) {
//			container.stackTagCompound = new NBTTagCompound();
//		}
//
//		int energy = container.stackTagCompound.getInteger("Energy");
//		int energyRecieved = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
//
//		if (!simulate) {
//			energy += energyRecieved;
//			container.stackTagCompound.setInteger("Energy", energy);
//		}
//
//		return energyRecieved;
//	}
//
//	@Override
//	public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
//		if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
//			return 0;
//		}
//
//		int energy = container.stackTagCompound.getInteger("Energy");
//		int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
//
//		if (!simulate) {
//			energy -= energyExtracted;
//			container.stackTagCompound.setInteger("Energy", energy);
//		}
//
//		return energyExtracted;
//	}
//
//	@Override
//	public int getEnergyStored(ItemStack container) {
//		if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
//			return 0;
//		}
//
//		return container.stackTagCompound.getInteger("Energy");
//	}
//
//	@Override
//	public int getMaxEnergyStored(ItemStack container) {
//		return getMaxEnergyStored();
//	}
//
//	public int getMaxEnergyStored() {
//		return capacity;
//	}

}

@@ -881,2463 +881,6 @@
 %09%7D%0A%0A
-//%09Display how much energy is stored on the tooltip%0A//%09@Override%0A//%09@SideOnly(Side.CLIENT)%0A//%09public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isShifting) %7B%0A//%09%09list.add(String.format(%22%25sEnergy Stored%25s: %25d/%25d RF%22, StringHelper.YELLOW, StringHelper.WHITE, getEnergyStored(stack), this.capacity));%0A//%09%7D%0A//%0A////%09Mining Lasers with both no energy and full energy.%0A//%09@Override%0A//%09public void getSubItems(Item item, CreativeTabs tab, List list) %7B%0A//%09%09list.add(EnergyUtils.setEnergyInStack(new ItemStack(item, 1, 0), 0));%0A//%09%09list.add(EnergyUtils.setEnergyInStack(new ItemStack(item, 1, 0), this.capacity));%0A//%09%7D%0A//%0A//%09@Override%0A//%09public int getDisplayDamage(ItemStack stack) %7B%0A//%09%09return capacity - getEnergyStored(stack);%0A//%09%7D%0A//%0A//%09@Override%0A//%09public int getMaxDamage(ItemStack stack) %7B%0A//%09%09return getMaxEnergyStored();%0A//%09%7D%0A//%0A//%09@Override%0A//%09public boolean isDamaged(ItemStack stack) %7B%0A//%09%09return true;%0A//%09%7D%0A//%0A////%09IEnergyContainerItem%0A//%09@Override%0A//%09public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) %7B%0A//%09%09if (container.stackTagCompound == null) %7B%0A//%09%09%09container.stackTagCompound = new NBTTagCompound();%0A//%09%09%7D%0A//%0A//%09%09int energy = container.stackTagCompound.getInteger(%22Energy%22);%0A//%09%09int energyRecieved = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));%0A//%0A//%09%09if (!simulate) %7B%0A//%09%09%09energy += energyRecieved;%0A//%09%09%09container.stackTagCompound.setInteger(%22Energy%22, energy);%0A//%09%09%7D%0A//%0A//%09%09return energyRecieved;%0A//%09%7D%0A//%0A//%09@Override%0A//%09public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) %7B%0A//%09%09if (container.stackTagCompound == null %7C%7C !container.stackTagCompound.hasKey(%22Energy%22)) %7B%0A//%09%09%09return 0;%0A//%09%09%7D%0A//%0A//%09%09int energy = container.stackTagCompound.getInteger(%22Energy%22);%0A//%09%09int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));%0A//%0A//%09%09if (!simulate) %7B%0A//%09%09%09energy -= energyExtracted;%0A//%09%09%09container.stackTagCompound.setInteger(%22Energy%22, energy);%0A//%09%09%7D%0A//%0A//%09%09return energyExtracted;%0A//%09%7D%0A//%0A//%09@Override%0A//%09public int getEnergyStored(ItemStack container) %7B%0A//%09%09if (container.stackTagCompound == null %7C%7C !container.stackTagCompound.hasKey(%22Energy%22)) %7B%0A//%09%09%09return 0;%0A//%09%09%7D%0A//%0A//%09%09return container.stackTagCompound.getInteger(%22Energy%22);%0A//%09%7D%0A//%0A//%09@Override%0A//%09public int getMaxEnergyStored(ItemStack container) %7B%0A//%09%09return getMaxEnergyStored();%0A//%09%7D%0A//%0A//%09public int getMaxEnergyStored() %7B%0A//%09%09return capacity;%0A//%09%7D%0A%0A
 %7D%0A

Remove old code