Fixed Bug: #0165 - DSU Crash.

This commit is contained in:
AlgorithmX2 2014-02-18 11:43:02 -06:00
parent f6a7e01d7f
commit c50535ab21
6 changed files with 26 additions and 10 deletions

View file

@ -0,0 +1,10 @@
package appeng.integration;
public class BaseModule {
protected void TestClass( Class clz )
{
clz.isInstance(this);
}
}

View file

@ -12,12 +12,15 @@ import appeng.api.config.TunnelType;
import appeng.api.features.IP2PTunnelRegistry; import appeng.api.features.IP2PTunnelRegistry;
import appeng.api.parts.IFacadePart; import appeng.api.parts.IFacadePart;
import appeng.facade.FacadePart; import appeng.facade.FacadePart;
import appeng.integration.BaseModule;
import appeng.integration.IIntegrationModule; import appeng.integration.IIntegrationModule;
import appeng.integration.abstraction.IBC; import appeng.integration.abstraction.IBC;
import appeng.integration.modules.helpers.BCPipeHandler; import appeng.integration.modules.helpers.BCPipeHandler;
import appeng.integration.modules.helpers.MJPerdition;
import buildcraft.BuildCraftEnergy; import buildcraft.BuildCraftEnergy;
import buildcraft.BuildCraftTransport; import buildcraft.BuildCraftTransport;
import buildcraft.api.tools.IToolWrench; import buildcraft.api.tools.IToolWrench;
import buildcraft.api.transport.IPipeConnection;
import buildcraft.api.transport.IPipeTile; import buildcraft.api.transport.IPipeTile;
import buildcraft.api.transport.IPipeTile.PipeType; import buildcraft.api.transport.IPipeTile.PipeType;
import buildcraft.transport.ItemFacade; import buildcraft.transport.ItemFacade;
@ -25,7 +28,7 @@ import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.TileGenericPipe; import buildcraft.transport.TileGenericPipe;
import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.event.FMLInterModComms;
public class BC implements IIntegrationModule, IBC public class BC extends BaseModule implements IIntegrationModule, IBC
{ {
public static BC instance; public static BC instance;
@ -173,6 +176,10 @@ public class BC implements IIntegrationModule, IBC
@Override @Override
public void Init() public void Init()
{ {
TestClass(IPipeConnection.class);
TestClass(ItemFacade.class);
TestClass(IToolWrench.class);
AEApi.instance().partHelper().registerNewLayer( "appeng.api.parts.layers.LayerIPipeConnection", "buildcraft.api.transport.IPipeConnection" ); AEApi.instance().partHelper().registerNewLayer( "appeng.api.parts.layers.LayerIPipeConnection", "buildcraft.api.transport.IPipeConnection" );
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BCPipeHandler() ); AEApi.instance().registries().externalStorage().addExternalStorageInterface( new BCPipeHandler() );
} }

View file

@ -4,12 +4,13 @@ import net.minecraft.tileentity.TileEntity;
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.storage.IMEInventory; import appeng.api.storage.IMEInventory;
import appeng.integration.BaseModule;
import appeng.integration.IIntegrationModule; import appeng.integration.IIntegrationModule;
import appeng.integration.abstraction.IDSU; import appeng.integration.abstraction.IDSU;
import appeng.integration.modules.helpers.MFRDSU; import appeng.integration.modules.helpers.MFRDSU;
import appeng.integration.modules.helpers.MFRDSUHandler; import appeng.integration.modules.helpers.MFRDSUHandler;
public class DSU implements IIntegrationModule, IDSU public class DSU extends BaseModule implements IIntegrationModule, IDSU
{ {
public static DSU instance; public static DSU instance;
@ -31,7 +32,7 @@ public class DSU implements IIntegrationModule, IDSU
@Override @Override
public void Init() public void Init()
{ {
TestClass(IDeepStorageUnit.class );
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package appeng.integration.modules; package appeng.integration.modules;
import appeng.integration.BaseModule;
import appeng.integration.IIntegrationModule; import appeng.integration.IIntegrationModule;
import appeng.integration.abstraction.IMJ; import appeng.integration.abstraction.IMJ;
import appeng.integration.abstraction.helpers.BaseMJperdition; import appeng.integration.abstraction.helpers.BaseMJperdition;
@ -7,7 +8,7 @@ import appeng.integration.modules.helpers.MJPerdition;
import appeng.tile.powersink.BuildCraft; import appeng.tile.powersink.BuildCraft;
import buildcraft.api.power.IPowerReceptor; import buildcraft.api.power.IPowerReceptor;
public class MJ implements IIntegrationModule, IMJ public class MJ extends BaseModule implements IIntegrationModule, IMJ
{ {
public static MJ instance; public static MJ instance;
@ -23,10 +24,7 @@ public class MJ implements IIntegrationModule, IMJ
@Override @Override
public void Init() throws Throwable public void Init() throws Throwable
{ {
if ( ((Object) this) instanceof MJPerdition ) TestClass(MJPerdition.class);
{
}
} }
@Override @Override

View file

@ -49,7 +49,7 @@ public class BCPipeInventory implements IMEInventory<IAEItemStack>
} }
@Override @Override
public IItemList<IAEItemStack> getAvailableItems(IItemList out) public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out)
{ {
return out; return out;
} }

View file

@ -89,7 +89,7 @@ public class MFRDSU implements IMEInventory<IAEItemStack>
} }
@Override @Override
public IItemList<IAEItemStack> getAvailableItems(IItemList out) public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out)
{ {
ItemStack is = dsu.getStoredItemType(); ItemStack is = dsu.getStoredItemType();
if ( is != null ) if ( is != null )