2013-12-27 23:59:59 +01:00
|
|
|
package appeng.util.inv;
|
|
|
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import appeng.api.config.Actionable;
|
|
|
|
import appeng.api.storage.IMEInventory;
|
|
|
|
import appeng.api.storage.data.IAEItemStack;
|
|
|
|
import appeng.util.item.AEItemStack;
|
|
|
|
|
|
|
|
public class IMEInventoryDestination implements IInventoryDestination
|
|
|
|
{
|
|
|
|
|
|
|
|
IMEInventory<IAEItemStack> me;
|
|
|
|
|
|
|
|
public IMEInventoryDestination(IMEInventory<IAEItemStack> o) {
|
|
|
|
me = o;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canInsert(ItemStack stack)
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( stack == null )
|
|
|
|
return false;
|
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
IAEItemStack failed = me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
if ( failed == null )
|
|
|
|
return true;
|
|
|
|
return failed.getStackSize() != stack.stackSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|