XaeroPlus

XaeroPlus

4M Downloads

[Fabric] Incompatible Minimap Error GUI

rfresh2 opened this issue ยท 1 comments

commented

I get frequent reports, mostly from people using the vanilla MC launcher as its error/crash GUI is absolutely useless and people don't check logs.

Replace the forced crash here:

private static void minimapCompatibleVersionCheck() {
try {
SemanticVersion compatibleMinimapVersion = SemanticVersion.parse(getCompatibleMinimapVersion());
if (!checkVersion("xaerominimap", compatibleMinimapVersion) && !checkVersion("xaerobetterpvp", compatibleMinimapVersion)) {
throw new RuntimeException("XaeroPlus requires version: '" + compatibleMinimapVersion + "' of Xaero's Minimap or BetterPVP installed");
}
} catch (VersionParsingException e) {
throw new RuntimeException(e);
}
}
private static boolean checkVersion(final String modId, final SemanticVersion version) {
try {
return FabricLoader.getInstance().getAllMods().stream()
.filter(modContainer -> modContainer.getMetadata().getId().equals(modId))
.map(modContainer -> modContainer.getMetadata().getVersion())
.anyMatch(ver -> ver.compareTo(version) == 0);
} catch (final Exception e) {
LOGGER.error("Failed to check version for {}", modId, e);
return false;
}
}
private static String getCompatibleMinimapVersion() {
return FabricLoader.getInstance().getModContainer("xaeroplus").get().getMetadata().getCustomValue("minimap_version").getAsString();
with a GUI similar to https://github.com/Luligabi1/NoIndium

Need to hook in before mixins are applied and crashes caused.

Not an issue on Forge as mods can be declared non-required and it will enforce version ranges only if the mod is present like we need

commented

resolved in b609757