public ItemStack removeItems(ItemStack drive,ItemStack stack,int amountWanted){
  if (getMaxKilobits(drive) == -1)   return null;
  int stored=getAmountStored(drive,stack);
  int amountGiven=Math.min(amountWanted,stored);
  if (amountGiven > 0) {
    setAmountStored(drive,stack,stored - amountGiven);
    stack.stackSize+=amountGiven;
    markDirty(drive);
  }
  return stack;
}

public ItemStack removeItems ( ItemStack drive , ItemStack stack , int amountWanted ) { if ( getMaxKilobits ( drive ) == - 1 ) return null ; int stored = getAmountStored ( drive , stack ) ; int amountGiven = Math . min ( amountWanted , stored ) ; if ( amountGiven > 0 ) { setAmountStored ( drive , stack , stored - amountGiven ) ; stack . stackSize += amountGiven ; markDirty ( drive ) ; } return stack ; }
take as many items as possible , up to the passed limit , from a drive into the given stack . < p > the stacksize of the passed stack will be affected . return value is for convenience .
