From 5e14ca71d997786c1ab7edbe85971b17e6028c63 Mon Sep 17 00:00:00 2001 From: Snownee Date: Sun, 14 Feb 2021 11:51:31 +0800 Subject: [PATCH] Add max stack size check to ItemHelper.extract --- .../java/com/simibubi/create/foundation/item/ItemHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java b/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java index 22a225e60..0263c476f 100644 --- a/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java @@ -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; }