mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
[CI skip] Small performance optimization
This commit is contained in:
parent
f4bded9491
commit
dba628f99c
@ -292,6 +292,11 @@ final class CargoUtils {
|
||||
int maxStackSize = itemInSlot.getType().getMaxStackSize();
|
||||
int currentAmount = itemInSlot.getAmount();
|
||||
|
||||
if (!smartFill && currentAmount == maxStackSize) {
|
||||
// Skip full stacks - Performance optimization for non-smartfill nodes
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SlimefunUtils.isItemSimilar(itemInSlot, wrapper, true, false)) {
|
||||
if (currentAmount < maxStackSize) {
|
||||
int amount = currentAmount + stack.getAmount();
|
||||
@ -339,11 +344,17 @@ final class CargoUtils {
|
||||
inv.setItem(slot, stack);
|
||||
return null;
|
||||
} else {
|
||||
int currentAmount = itemInSlot.getAmount();
|
||||
int maxStackSize = itemInSlot.getType().getMaxStackSize();
|
||||
|
||||
if (!smartFill && currentAmount == maxStackSize) {
|
||||
// Skip full stacks - Performance optimization for non-smartfill nodes
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SlimefunUtils.isItemSimilar(itemInSlot, wrapper, true, false)) {
|
||||
if (itemInSlot.getAmount() < maxStackSize) {
|
||||
int amount = itemInSlot.getAmount() + stack.getAmount();
|
||||
if (currentAmount < maxStackSize) {
|
||||
int amount = currentAmount + stack.getAmount();
|
||||
|
||||
if (amount > maxStackSize) {
|
||||
stack.setAmount(amount - maxStackSize);
|
||||
|
Loading…
Reference in New Issue
Block a user