First iteration of making integrations typesafe

This commit is contained in:
yueh
2015-08-06 16:01:56 +02:00
parent 0df445c6a8
commit f303c17ae0
44 changed files with 282 additions and 147 deletions
@@ -22,28 +22,44 @@ package appeng.integration.modules;
import li.cil.oc.api.Items;
import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.config.TunnelType;
import appeng.api.features.IP2PTunnelRegistry;
import appeng.api.parts.IPartHelper;
import appeng.helpers.Reflected;
import appeng.integration.BaseModule;
import appeng.integration.IntegrationHelper;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
public class OpenComputers extends BaseModule
{
@Reflected
public static OpenComputers instance;
@Reflected
public OpenComputers()
{
this.testClassExistence( li.cil.oc.api.Items.class );
this.testClassExistence( li.cil.oc.api.Network.class );
this.testClassExistence( li.cil.oc.api.network.Environment.class );
this.testClassExistence( li.cil.oc.api.network.SidedEnvironment.class );
this.testClassExistence( li.cil.oc.api.network.Node.class );
this.testClassExistence( li.cil.oc.api.network.Message.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.Items.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.Network.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.network.Environment.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.network.SidedEnvironment.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.network.Node.class );
IntegrationHelper.testClassExistence( this, li.cil.oc.api.network.Message.class );
}
@Override
public void init()
{
final IAppEngApi api = AEApi.instance();
final IPartHelper partHelper = api.partHelper();
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
{
partHelper.registerNewLayer( "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment" );
}
}
@Override