2013-12-27 23:59:59 +01:00
|
|
|
package appeng.core.api;
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
|
2014-01-31 23:26:08 +01:00
|
|
|
import java.io.IOException;
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2014-07-04 08:19:35 +02:00
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
2014-07-04 08:19:35 +02:00
|
|
|
import appeng.api.networking.crafting.ICraftingLink;
|
|
|
|
import appeng.api.networking.crafting.ICraftingRequester;
|
2014-01-05 09:43:49 +01:00
|
|
|
import appeng.api.networking.energy.IEnergySource;
|
|
|
|
import appeng.api.networking.security.BaseActionSource;
|
|
|
|
import appeng.api.storage.IMEInventory;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.storage.IStorageHelper;
|
|
|
|
import appeng.api.storage.data.IAEFluidStack;
|
|
|
|
import appeng.api.storage.data.IAEItemStack;
|
|
|
|
import appeng.api.storage.data.IItemList;
|
2014-07-04 08:19:35 +02:00
|
|
|
import appeng.crafting.CraftingLink;
|
2014-01-05 09:43:49 +01:00
|
|
|
import appeng.util.Platform;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.util.item.AEFluidStack;
|
|
|
|
import appeng.util.item.AEItemStack;
|
|
|
|
import appeng.util.item.ItemList;
|
|
|
|
|
|
|
|
public class ApiStorage implements IStorageHelper
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IAEItemStack createItemStack(ItemStack is)
|
|
|
|
{
|
|
|
|
return AEItemStack.create( is );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IAEFluidStack createFluidStack(FluidStack is)
|
|
|
|
{
|
|
|
|
return AEFluidStack.create( is );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-21 21:36:40 +01:00
|
|
|
public IItemList<IAEItemStack> createItemList()
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-07-04 08:19:35 +02:00
|
|
|
return new ItemList( IAEItemStack.class );
|
2014-02-21 21:36:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IItemList<IAEFluidStack> createFluidList()
|
|
|
|
{
|
2014-07-04 08:19:35 +02:00
|
|
|
return new ItemList( IAEFluidStack.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2014-01-05 09:43:49 +01:00
|
|
|
@Override
|
|
|
|
public IAEItemStack poweredExtraction(IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack request, BaseActionSource src)
|
|
|
|
{
|
|
|
|
return Platform.poweredExtraction( energy, cell, request, src );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IAEItemStack poweredInsert(IEnergySource energy, IMEInventory<IAEItemStack> cell, IAEItemStack input, BaseActionSource src)
|
|
|
|
{
|
|
|
|
return Platform.poweredInsert( energy, cell, input, src );
|
|
|
|
}
|
|
|
|
|
2014-01-31 23:26:08 +01:00
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public IAEItemStack readItemFromPacket(ByteBuf input) throws IOException
|
2014-01-31 23:26:08 +01:00
|
|
|
{
|
|
|
|
return AEItemStack.loadItemStackFromPacket( input );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public IAEFluidStack readFluidFromPacket(ByteBuf input) throws IOException
|
2014-01-31 23:26:08 +01:00
|
|
|
{
|
|
|
|
return AEFluidStack.loadFluidStackFromPacket( input );
|
|
|
|
}
|
2014-07-04 08:19:35 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public ICraftingLink loadCraftingLink(NBTTagCompound data, ICraftingRequester req)
|
|
|
|
{
|
|
|
|
return new CraftingLink( data, req );
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|