Applied-Energistics-2-tiler.../integration/modules/NEI.java

52 lines
1.9 KiB
Java
Raw Normal View History

2014-04-04 07:17:20 +02:00
package appeng.integration.modules;
import java.lang.reflect.Method;
import appeng.integration.IIntegrationModule;
2014-04-04 07:17:20 +02:00
import appeng.integration.modules.helpers.NEIAEShapedRecipeHandler;
import appeng.integration.modules.helpers.NEIAEShapelessRecipeHandler;
public class NEI implements IIntegrationModule
{
public static NEI instance;
2014-04-06 10:20:30 +02:00
Class API;
public NEI() throws ClassNotFoundException {
API = Class.forName( "codechicken.nei.api.API" );
}
@Override
public void Init() throws Throwable
{
Method registerRecipeHandler = API.getDeclaredMethod( "registerRecipeHandler", new Class[] { codechicken.nei.recipe.ICraftingHandler.class } );
Method registerUsageHandler = API.getDeclaredMethod( "registerUsageHandler", new Class[] { codechicken.nei.recipe.IUsageHandler.class } );
2014-04-04 07:17:20 +02:00
registerRecipeHandler.invoke( API, new NEIAEShapedRecipeHandler() );
registerUsageHandler.invoke( API, new NEIAEShapedRecipeHandler() );
registerRecipeHandler.invoke( API, new NEIAEShapelessRecipeHandler() );
registerUsageHandler.invoke( API, new NEIAEShapelessRecipeHandler() );
/*
* Method registerGuiOverlay = API.getDeclaredMethod( "registerGuiOverlay", new Class[] { Class.class,
* String.class, int.class, int.class } ); Class IOverlayHandler = Class.forName(
* "codechicken.nei.api.IOverlayHandler" ); Class DefaultOverlayHandler =
* NEICraftingTerminalOverlayHandler.class; Method registerGuiOverlayHandler = API.getDeclaredMethod(
* "registerGuiOverlayHandler", new Class[] { Class.class, IOverlayHandler, String.class } );
* registerGuiOverlay.invoke( API, GuiCraftingTerminal.class, "crafting", 6, 75 ); Constructor
* DefaultOverlayHandlerConstructor = DefaultOverlayHandler .getConstructor( new Class[] { int.class, int.class
* } ); registerGuiOverlayHandler.invoke( API, GuiCraftingTerminal.class,
* DefaultOverlayHandlerConstructor.newInstance( 6, 75 ), "crafting" );
*/
}
@Override
public void PostInit() throws Throwable
{
}
}