2013-12-27 23:59:59 +01:00
|
|
|
package appeng.integration.modules.helpers;
|
|
|
|
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2014-04-18 05:33:48 +02:00
|
|
|
import appeng.api.networking.security.BaseActionSource;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.storage.IExternalStorageHandler;
|
|
|
|
import appeng.api.storage.IMEInventory;
|
|
|
|
import appeng.api.storage.StorageChannel;
|
2014-02-15 07:40:02 +01:00
|
|
|
import appeng.integration.modules.DSU;
|
2014-05-04 02:21:33 +02:00
|
|
|
import appeng.me.storage.MEMonitorIInventory;
|
|
|
|
import appeng.util.inv.IMEAdaptor;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
public class MFRDSUHandler implements IExternalStorageHandler
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
2014-05-25 01:23:23 +02:00
|
|
|
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-02-15 07:40:02 +01:00
|
|
|
return chan == StorageChannel.ITEMS && DSU.instance.isDSU( te );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-04-18 05:33:48 +02:00
|
|
|
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
if ( chan == StorageChannel.ITEMS )
|
2014-05-04 02:21:33 +02:00
|
|
|
return new MEMonitorIInventory( new IMEAdaptor( DSU.instance.getDSU( te ), src ) );
|
2014-07-24 00:39:42 +02:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|