Storage Buses no longer assume an inventory can be accessed just because it implements IInventory.

This commit is contained in:
AlgorithmX2
2014-07-23 17:39:42 -05:00
parent 980dff203f
commit 8bcd346226
3 changed files with 7 additions and 4 deletions
@@ -22,8 +22,10 @@ public class ExternalIInv implements IExternalStorageHandler
@Override @Override
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src) public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src)
{ {
if ( channel == StorageChannel.ITEMS && te instanceof IInventory ) InventoryAdaptor ad = InventoryAdaptor.getAdaptor( (IInventory) te, d );
return new MEMonitorIInventory( InventoryAdaptor.getAdaptor( (IInventory) te, d ) );
if ( channel == StorageChannel.ITEMS && ad != null )
return new MEMonitorIInventory( ad );
return null; return null;
} }
+1 -1
View File
@@ -380,7 +380,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
{ {
public InterfaceInventory(DualityInterface tileInterface) { public InterfaceInventory(DualityInterface tileInterface) {
super( InventoryAdaptor.getAdaptor( tileInterface.storage, ForgeDirection.UP ) ); super( new AdaptorIInventory( tileInterface.storage ) );
mySource = new MachineSource( iHost ); mySource = new MachineSource( iHost );
} }
@@ -24,6 +24,7 @@ public class MFRDSUHandler implements IExternalStorageHandler
{ {
if ( chan == StorageChannel.ITEMS ) if ( chan == StorageChannel.ITEMS )
return new MEMonitorIInventory( new IMEAdaptor( DSU.instance.getDSU( te ), src ) ); return new MEMonitorIInventory( new IMEAdaptor( DSU.instance.getDSU( te ), src ) );
return null; return null;
} }
} }