Factor in range dispatch scaling when sorting predicate

This commit is contained in:
Eclipse 2024-12-19 11:17:51 +00:00
parent e84f8a3543
commit bcc791544b
No known key found for this signature in database
GPG key ID: 95E6998F82EC938A

View file

@ -771,7 +771,9 @@ public class ItemRegistryPopulator {
.map(otherPredicate -> (RangeDispatchPredicate) otherPredicate)
.findFirst();
if (other.isPresent()) {
return (int) (other.orElseThrow().threshold() - rangeDispatch.threshold());
double otherScaledThreshold = other.get().threshold() / other.get().scale();
double thisThreshold = rangeDispatch.threshold() / rangeDispatch.scale();
return (int) (otherScaledThreshold - thisThreshold);
}
} // TODO not a fan of how this looks
}