int amountCursor = stackInSlot.getAmount() - amountSlot;
if (stackInSlot.getAmount() == 1) {
amountSlot = 0;
amountCursor = 1;
}
stackOnCursor = stackInSlot.clone();
stackOnCursor.setAmount(amountCursor);
stackInSlot.setAmount(amountSlot);
if (amountSlot == 0) {
stackInSlot = new ItemStack(0);
}