package org.cyclops.commoncapabilities.modcompat.ic2;

import net.minecraftforge.fml.common.ModAPIManager;
import org.cyclops.commoncapabilities.GeneralConfig;
import org.cyclops.commoncapabilities.Reference;
import org.cyclops.commoncapabilities.modcompat.ic2.capability.tesla.Ic2TeslaIntegration;
import org.cyclops.cyclopscore.modcompat.IModCompat;

/**
 * Capabilities for IC2.
 * @author rubensworks
 */
public class Ic2ModCompat implements IModCompat {
    @Override
    public String getModID() {
        return Reference.MOD_IC2;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }

    @Override
    public String getComment() {
        return "Tesla capabilities for IC2 tiles and items.";
    }

    @Override
    public void onInit(Step initStep) {
        if(initStep == Step.PREINIT && ModAPIManager.INSTANCE.hasAPI(Reference.MOD_TESLA_API) && GeneralConfig.ic2EuToTesla) {
            Ic2TeslaIntegration.load();
        }
    }

}

@@ -48,16 +48,270 @@
 t.ic2;%0A%0A
+import ic2.core.item.tool.ItemToolWrench;%0Aimport ic2.core.item.tool.ItemToolWrenchElectric;%0Aimport net.minecraft.item.ItemStack;%0Aimport net.minecraftforge.common.capabilities.Capability;%0Aimport net.minecraftforge.common.capabilities.ICapabilityProvider;%0A
 import n
@@ -350,24 +350,82 @@
 APIManager;%0A
+import org.cyclops.commoncapabilities.CommonCapabilities;%0A
 import org.c
@@ -556,111 +556,604 @@
 ies.
-modcompat.ic2.capability.tesla.Ic2TeslaIntegration;%0Aimport org.cyclops.cyclopscore.modcompat.IModCompat
+api.capability.wrench.DefaultWrench;%0Aimport org.cyclops.commoncapabilities.api.capability.wrench.IWrench;%0Aimport org.cyclops.commoncapabilities.capability.wrench.WrenchConfig;%0Aimport org.cyclops.commoncapabilities.modcompat.ic2.capability.tesla.Ic2TeslaIntegration;%0Aimport org.cyclops.cyclopscore.modcompat.IModCompat;%0Aimport org.cyclops.cyclopscore.modcompat.capabilities.CapabilityConstructorRegistry;%0Aimport org.cyclops.cyclopscore.modcompat.capabilities.DefaultCapabilityProvider;%0Aimport org.cyclops.cyclopscore.modcompat.capabilities.ICapabilityConstructor;%0A%0Aimport javax.annotation.Nullable
 ;%0A%0A/
@@ -1487,16 +1487,27 @@
  %22Tesla 
+and wrench 
 capabili
@@ -1766,16 +1766,1541 @@
 load();%0A
+            CapabilityConstructorRegistry registry = CommonCapabilities._instance.getCapabilityConstructorRegistry();%0A%0A            // Wrench%0A            registry.registerItem(ItemToolWrenchElectric.class,%0A                    new ICapabilityConstructor%3CIWrench, ItemToolWrenchElectric, ItemStack%3E() %7B%0A                        @Override%0A                        public Capability%3CIWrench%3E getCapability() %7B%0A                            return WrenchConfig.CAPABILITY;%0A                        %7D%0A%0A                        @Nullable%0A                        @Override%0A                        public ICapabilityProvider createProvider(ItemToolWrenchElectric hostType, final ItemStack host) %7B%0A                            return new DefaultCapabilityProvider%3C%3E(WrenchConfig.CAPABILITY, new DefaultWrench());%0A                        %7D%0A                    %7D);%0A            registry.registerItem(ItemToolWrench.class,%0A                    new ICapabilityConstructor%3CIWrench, ItemToolWrench, ItemStack%3E() %7B%0A                        @Override%0A                        public Capability%3CIWrench%3E getCapability() %7B%0A                            return WrenchConfig.CAPABILITY;%0A                        %7D%0A%0A                        @Nullable%0A                        @Override%0A                        public ICapabilityProvider createProvider(ItemToolWrench hostType, final ItemStack host) %7B%0A                            return new DefaultCapabilityProvider%3C%3E(WrenchConfig.CAPABILITY, new DefaultWrench());%0A                        %7D%0A                    %7D);%0A
         

Add wrench capabilities for IC2