Add max stack size check to ItemHelper.extract

This commit is contained in:
Snownee 2021-02-14 11:51:31 +08:00
parent 676a05ad07
commit 5e14ca71d9

View file

@ -174,7 +174,7 @@ public class ItemHelper {
if (!simulate && hasEnoughItems)
inv.extractItem(slot, stack.getCount(), false);
if (extracting.getCount() >= maxExtractionCount) {
if (extracting.getCount() >= maxExtractionCount || extracting.getCount() >= extracting.getMaxStackSize()) {
if (checkHasEnoughItems) {
hasEnoughItems = true;
checkHasEnoughItems = false;
@ -234,7 +234,7 @@ public class ItemHelper {
if (!simulate)
inv.extractItem(slot, stack.getCount(), false);
if (extracting.getCount() == maxExtractionCount)
if (extracting.getCount() >= maxExtractionCount || extracting.getCount() >= extracting.getMaxStackSize())
break;
}