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