2014-08-12 18:58:24 +02:00
|
|
|
package appeng.integration.modules.helpers;
|
2014-02-15 07:40:02 +01:00
|
|
|
|
2014-08-30 18:30:22 +02:00
|
|
|
import net.mcft.copy.betterstorage.api.crate.ICrateStorage;
|
2014-02-15 07:40:02 +01:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2014-08-12 18:58:24 +02:00
|
|
|
import appeng.api.networking.security.BaseActionSource;
|
2014-02-15 07:40:02 +01:00
|
|
|
import appeng.api.storage.IExternalStorageHandler;
|
|
|
|
import appeng.api.storage.IMEInventory;
|
|
|
|
import appeng.api.storage.StorageChannel;
|
|
|
|
|
|
|
|
public class BSCrateHandler implements IExternalStorageHandler
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
2014-08-12 18:58:24 +02:00
|
|
|
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc)
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
2014-08-12 18:58:24 +02:00
|
|
|
return channel == StorageChannel.ITEMS && te instanceof ICrateStorage;
|
2014-02-15 07:40:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-08-12 18:58:24 +02:00
|
|
|
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src)
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
2014-08-12 18:58:24 +02:00
|
|
|
if ( channel == StorageChannel.ITEMS )
|
2014-02-15 07:40:02 +01:00
|
|
|
return new BSCrate( te, ForgeDirection.UNKNOWN );
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|