mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-12 00:17:51 +00:00
Ignore nonstackables in max overlaid recipe count calculation (#365)
* Update buildscript * Ignore nonstackables in max overlaid recipe count calculation
This commit is contained in:
1 parent
23e16abae6
commit
9218e233aa
5 files changed
+56
-32
No files matched your search
@@ -146,11 +146,20 @@ public class DefaultOverlayHandler implements IOverlayHandler {
|
||||
DistributedIngred istack = distrib.distrib;
|
||||
if (istack.numSlots == 0) return 0;
|
||||
|
||||
final int maxStackSize = istack.stack.getMaxStackSize();
|
||||
int allSlots = istack.invAmount;
|
||||
if (allSlots / istack.numSlots > istack.stack.getMaxStackSize())
|
||||
allSlots = istack.numSlots * istack.stack.getMaxStackSize();
|
||||
if (allSlots / istack.numSlots > maxStackSize) allSlots = istack.numSlots * maxStackSize;
|
||||
|
||||
quantity = Math.min(quantity, allSlots / istack.distributed);
|
||||
final int newQuantity = allSlots / istack.distributed;
|
||||
if (maxStackSize == 1) {
|
||||
// If non-stackable, fill up as much as possible of the other ingredients
|
||||
continue;
|
||||
}
|
||||
quantity = Math.min(quantity, newQuantity);
|
||||
}
|
||||
if (quantity == Integer.MAX_VALUE) {
|
||||
// Only possible if all ingredients were non-stackable
|
||||
quantity = 1;
|
||||
}
|
||||
|
||||
return quantity;
|
||||
|
||||
Reference in new issue
Block a user