diff --git a/Common/src/main/java/com/almostreliable/unified/AlmostUnified.java b/Common/src/main/java/com/almostreliable/unified/AlmostUnified.java index c366b804..be83634e 100644 --- a/Common/src/main/java/com/almostreliable/unified/AlmostUnified.java +++ b/Common/src/main/java/com/almostreliable/unified/AlmostUnified.java @@ -1,9 +1,6 @@ package com.almostreliable.unified; -import com.almostreliable.unified.api.Placeholders; -import com.almostreliable.unified.api.TagMap; -import com.almostreliable.unified.api.UnifierRegistry; -import com.almostreliable.unified.api.UnifyHandler; +import com.almostreliable.unified.api.*; import com.almostreliable.unified.config.*; import com.almostreliable.unified.impl.AlmostUnifiedRuntimeImpl; import com.almostreliable.unified.impl.TagMapImpl; @@ -79,6 +76,7 @@ public static void onTagLoaderReload(Map tagMap = TagMapImpl.compose(unifyHandlers.stream().map(UnifyHandler::getTagMap).toList()); ItemHider.applyHideTags(tags, unifyHandlers); + logMissingPriorityMods(unifyHandlers); RUNTIME = new AlmostUnifiedRuntimeImpl(tagMap, unifyHandlers, dupConfig, @@ -87,6 +85,21 @@ public static void onTagLoaderReload(Map unifyHandlers) { + Set mods = unifyHandlers + .stream() + .map(UnifySettings::getModPriorities) + .flatMap(ModPriorities::stream) + .collect(Collectors.toSet()); + + for (String mod : mods) { + if (!AlmostUnifiedPlatform.INSTANCE.isModLoaded(mod)) { + LOG.warn("Mod '{}' is not loaded, but used in unify settings", mod); + } + } + } + + /** * Creates all unify handlers for further unification. *

diff --git a/Common/src/main/java/com/almostreliable/unified/api/ModPriorities.java b/Common/src/main/java/com/almostreliable/unified/api/ModPriorities.java index 8fc9c73a..2f7fa671 100644 --- a/Common/src/main/java/com/almostreliable/unified/api/ModPriorities.java +++ b/Common/src/main/java/com/almostreliable/unified/api/ModPriorities.java @@ -7,6 +7,8 @@ import javax.annotation.Nullable; import java.util.List; import java.util.function.BiConsumer; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; public interface ModPriorities extends Iterable { @@ -17,4 +19,8 @@ public interface ModPriorities extends Iterable { ResourceLocation findPreferredItemId(TagKey tag, List items); void forEachOverride(BiConsumer, String> callback); + + default Stream stream() { + return StreamSupport.stream(spliterator(), false); + } }