package reborncore.common.powerSystem;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Loader;
import reborncore.api.power.IEnergyInterfaceItem;
import reborncore.mixin.MixinManager;
import reborncore.mixin.json.MixinTargetData;

public abstract class PoweredItem {

	public static void registerPoweredItem(String itemclass){
		MixinManager.registerMixin(new MixinTargetData("reborncore.common.powerSystem.mixin.BasePowerMixin", itemclass));
		MixinManager.registerMixin(new MixinTargetData("reborncore.common.powerSystem.mixin.CapabilityItemPowerMixin", itemclass));
		if(Loader.isModLoaded("IC2")){
			MixinManager.registerMixin(new MixinTargetData("reborncore.common.powerSystem.mixin.EUItemPowerTrait", itemclass));
		}
	}

	public static boolean canUseEnergy(double energy, ItemStack stack) {
		if (stack.getItem() instanceof IEnergyInterfaceItem) {
			return ((IEnergyInterfaceItem) stack.getItem()).canUseEnergy(energy, stack);
		} else {
			return false;
		}
	}

	public static double useEnergy(double energy, ItemStack stack) {
		if (stack.getItem() instanceof IEnergyInterfaceItem) {
			return ((IEnergyInterfaceItem) stack.getItem()).useEnergy(energy, stack);
		} else {
			return 0;
		}
	}

	public static void setEnergy(double energy, ItemStack stack) {
		if (stack.getItem() instanceof IEnergyInterfaceItem) {
			((IEnergyInterfaceItem) stack.getItem()).setEnergy(energy, stack);
		}
	}

	public static double getEnergy(ItemStack stack) {
		if (stack.getItem() instanceof IEnergyInterfaceItem) {
			return ((IEnergyInterfaceItem) stack.getItem()).getEnergy(stack);
		} else {
			return 0;
		}
	}

	public static double addEnergy(double energy, ItemStack stack) {
		if (stack.getItem() instanceof IEnergyInterfaceItem) {
			return ((IEnergyInterfaceItem) stack.getItem()).addEnergy(energy, stack);
		}
		return 0;
	}

	public static double getMaxPower(ItemStack stack) {
		if (stack.getItem() instanceof IEnergyInterfaceItem) {
			return ((IEnergyInterfaceItem) stack.getItem()).getMaxPower(stack);
		}
		return 0;
	}

}

@@ -375,19 +375,32 @@
 temclass
+, boolean ic2
 )%7B%0A
-
 %09%09MixinM
@@ -638,16 +638,23 @@
 );%0A%09%09if(
+ic2 && 
 Loader.i
@@ -792,24 +792,24 @@
 lass));%0A
-
 %09%09%7D%0A%09%7D%0A%0A
 %09public 
@@ -792,32 +792,135 @@
 lass));%0A%09%09%7D%0A%09%7D%0A%0A
+%09public static void registerPoweredItem(String itemclass)%7B%0A%09%09registerPoweredItem(itemclass, true);%0A%09%7D%0A%0A
 %09public static b

Add a way to register powered items without ic2 support