question: 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 ; }
target:  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.