mirror of https://github.com/cabaletta/baritone
recalculate on allocation size change
This commit is contained in:
parent
c79f40a5f1
commit
8ece179912
|
@ -32,7 +32,12 @@ public abstract class QuantizedTaskPriorityAllocationCache extends QuantizedTask
|
|||
|
||||
@Override
|
||||
public final double priorityAllocatedTo(IQuantizedParentTaskRelationship child, int quantity) {
|
||||
return allocationByQuantity.computeIfAbsent(quantity, this::allocationStrategy).allocatedTo(child);
|
||||
Allocation allocation = allocationByQuantity.get(quantity);
|
||||
if (allocation == null || allocation.total != effectiveAllocationSize(quantity)) {
|
||||
allocation = allocationStrategy(quantity);
|
||||
allocationByQuantity.put(quantity, allocation);
|
||||
}
|
||||
return allocation.allocatedTo(child);
|
||||
}
|
||||
|
||||
protected Allocation allocationStrategy(int quantity) { // overridable
|
||||
|
|
Loading…
Reference in New Issue