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

View file

@ -22,9 +22,11 @@ public class ExternalIInv implements IExternalStorageHandler
@Override
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src)
{
if ( channel == StorageChannel.ITEMS && te instanceof IInventory )
return new MEMonitorIInventory( InventoryAdaptor.getAdaptor( (IInventory) te, d ) );
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( (IInventory) te, d );
if ( channel == StorageChannel.ITEMS && ad != null )
return new MEMonitorIInventory( ad );
return null;
}

View file

@ -380,7 +380,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
{
public InterfaceInventory(DualityInterface tileInterface) {
super( InventoryAdaptor.getAdaptor( tileInterface.storage, ForgeDirection.UP ) );
super( new AdaptorIInventory( tileInterface.storage ) );
mySource = new MachineSource( iHost );
}

View file

@ -24,6 +24,7 @@ public class MFRDSUHandler implements IExternalStorageHandler
{
if ( chan == StorageChannel.ITEMS )
return new MEMonitorIInventory( new IMEAdaptor( DSU.instance.getDSU( te ), src ) );
return null;
}
}