Allow using handlerId for handler order (#290)

This commit is contained in:
miozune authored and GitHub committed 2022-09-03 10:25:40 +02:00
1 parent a2c037e0c0
commit 748695158f
1 file changed
+7 -1
@@ -88,7 +88,13 @@ public class NEIClientConfig {
handler -> Objects.firstNonNull(handler.getOverlayIdentifier(), handler.getHandlerId());
public static int getHandlerOrder(IRecipeHandler handler) {
return handlerOrdering.getOrDefault(HANDLER_ID_FUNCTION.apply(handler), 0);
if (handlerOrdering.get(handler.getOverlayIdentifier()) != null) {
return handlerOrdering.get(handler.getOverlayIdentifier());
}
if (handlerOrdering.get(handler.getHandlerId()) != null) {
return handlerOrdering.get(handler.getHandlerId());
}
return 0;
}
// Comparator that compares handlers using the handlerOrdering map.