2014-03-18 12:54:57 -05:00
|
|
|
package appeng.integration.modules.helpers;
|
2014-02-15 00:40:02 -06:00
|
|
|
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2014-04-17 22:33:48 -05:00
|
|
|
import appeng.api.networking.security.BaseActionSource;
|
2014-02-15 00:40:02 -06:00
|
|
|
import appeng.api.storage.IExternalStorageHandler;
|
|
|
|
import appeng.api.storage.IMEInventory;
|
|
|
|
import appeng.api.storage.StorageChannel;
|
|
|
|
import appeng.integration.modules.FZ;
|
2014-05-03 19:21:33 -05:00
|
|
|
import appeng.me.storage.MEMonitorIInventory;
|
|
|
|
import appeng.util.inv.IMEAdaptor;
|
2014-02-15 00:40:02 -06:00
|
|
|
|
|
|
|
public class FactorizationHandler implements IExternalStorageHandler
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
2014-05-24 18:23:23 -05:00
|
|
|
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc)
|
2014-02-15 00:40:02 -06:00
|
|
|
{
|
|
|
|
return chan == StorageChannel.ITEMS && FZ.instance.isBarrel( te );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-04-17 22:33:48 -05:00
|
|
|
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src)
|
2014-02-15 00:40:02 -06:00
|
|
|
{
|
|
|
|
if ( chan == StorageChannel.ITEMS )
|
2014-05-03 19:21:33 -05:00
|
|
|
return new MEMonitorIInventory( new IMEAdaptor( FZ.instance.getFactorizationBarrel( te ), src ) );
|
2014-02-15 00:40:02 -06:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|