feat: 请求量pop位置调整

This commit is contained in:
C-H716 2025-09-27 20:18:13 +08:00
parent fc25e2bd1c
commit f60629aadf
2 changed files with 1 additions and 7 deletions

View File

@ -20,11 +20,4 @@ public class CraftingTreeNodeMixin {
// push the requestedAmount before addContainerItems is called
RequestedAmountHolder.push(requestedAmount);
}
@Inject(method = "request(Lappeng/crafting/inv/CraftingSimulationState;JLappeng/api/stacks/KeyCounter;)V",
at = @At(value = "RETURN"))
private void clearRequestedAmountOnReturn(CraftingSimulationState inv, long requestedAmount, KeyCounter containerItems, CallbackInfo ci) {
// pop the pushed requested amount on return
RequestedAmountHolder.pop();
}
}

View File

@ -55,6 +55,7 @@ public abstract class CraftingTreeProcessMixin {
CraftingTreeNodeAccessor parentAcc = (CraftingTreeNodeAccessor) craftingTreeNode;
AEKey parentTarget = parentAcc.eap$getWhat();
long requested = RequestedAmountHolder.get();
RequestedAmountHolder.pop();
// 根据配置决定是否在 provider 间轮询分配请求量默认开启
long perProvider = 1L;