Added Integration Check

This commit is contained in:
AlgorithmX2 2014-01-28 14:51:44 -06:00
parent e7cda2b8e0
commit 24ad83356c
2 changed files with 21 additions and 12 deletions

View file

@ -26,11 +26,14 @@ public abstract class BuildCraft extends AERootPoweredTile implements IPowerRece
{
if ( Loader.isModLoaded( "BuildCraftAPI|power" ) )
{
IBC bcIntegration = (IBC) AppEng.instance.getIntegration( "BC" );
if ( bcIntegration != null )
if ( AppEng.instance.isIntegrationEnabled( "BC" ) )
{
addNewHandler( bcPowerWrapper = bcIntegration.createPerdition( this ) );
bcPowerWrapper.configure( 1, 380, 1.0f / 5.0f, 1000 );
IBC bcIntegration = (IBC) AppEng.instance.getIntegration( "BC" );
if ( bcIntegration != null )
{
addNewHandler( bcPowerWrapper = bcIntegration.createPerdition( this ) );
bcPowerWrapper.configure( 1, 380, 1.0f / 5.0f, 1000 );
}
}
}
}

View file

@ -78,21 +78,27 @@ public abstract class IC2 extends BuildCraft implements IEnergySink
final private void addToENet()
{
IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( "IC2" );
if ( !isInIC2 && Platform.isServer() && ic2Integration != null )
if ( AppEng.instance.isIntegrationEnabled( "IC2" ) )
{
ic2Integration.addToEnergyNet( this );
isInIC2 = true;
IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( "IC2" );
if ( !isInIC2 && Platform.isServer() && ic2Integration != null )
{
ic2Integration.addToEnergyNet( this );
isInIC2 = true;
}
}
}
final private void removeFromENet()
{
IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( "IC2" );
if ( isInIC2 && Platform.isServer() && ic2Integration != null )
if ( AppEng.instance.isIntegrationEnabled( "IC2" ) )
{
ic2Integration.removeFromEnergyNet( this );
isInIC2 = false;
IIC2 ic2Integration = (IIC2) AppEng.instance.getIntegration( "IC2" );
if ( isInIC2 && Platform.isServer() && ic2Integration != null )
{
ic2Integration.removeFromEnergyNet( this );
isInIC2 = false;
}
}
}