Package appeng.util.inv

Source Code of appeng.util.inv.IMEInventoryDestination

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
{

  final IMEInventory<IAEItemStack> me;

  public IMEInventoryDestination(IMEInventory<IAEItemStack> o) {
    me = o;
  }

  @Override
  public boolean canInsert(ItemStack stack)
  {

    if ( stack == null )
      return false;

    IAEItemStack failed = me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null );

    if ( failed == null )
      return true;
    return failed.getStackSize() != stack.stackSize;
  }

}
TOP

Related Classes of appeng.util.inv.IMEInventoryDestination

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.