From 339a8514d4088a217b74ad8f7437bfb875ec7ec0 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Mon, 15 Aug 2022 01:07:39 +0800 Subject: Switch to Error Notifier --- .../rei/fabric/PrimitivePlatformAdapterImpl.java | 41 ---------------------- fabric/src/main/resources/error_notifier.json | 26 ++++++++++++++ 2 files changed, 26 insertions(+), 41 deletions(-) create mode 100644 fabric/src/main/resources/error_notifier.json (limited to 'fabric/src/main') diff --git a/fabric/src/main/java/me/shedaniel/rei/fabric/PrimitivePlatformAdapterImpl.java b/fabric/src/main/java/me/shedaniel/rei/fabric/PrimitivePlatformAdapterImpl.java index 3b5d4ef7a..54cbfe4ad 100644 --- a/fabric/src/main/java/me/shedaniel/rei/fabric/PrimitivePlatformAdapterImpl.java +++ b/fabric/src/main/java/me/shedaniel/rei/fabric/PrimitivePlatformAdapterImpl.java @@ -23,8 +23,6 @@ package me.shedaniel.rei.fabric; -import com.google.common.collect.ImmutableSet; -import me.shedaniel.rei.RoughlyEnoughItemsState; import me.shedaniel.rei.impl.init.PrimitivePlatformAdapter; import net.fabricmc.api.EnvType; import net.fabricmc.loader.api.FabricLoader; @@ -40,45 +38,6 @@ public class PrimitivePlatformAdapterImpl implements PrimitivePlatformAdapter { @Override public void checkMods() { - ImmutableSet requiredModules = isClient() ? - ImmutableSet.builder() - .add("fabric-api-base") - .add("fabric-resource-loader-v0") - .add("fabric-networking-v0") - .add("fabric-lifecycle-events-v1") - .add("fabric-rendering-fluids-v1") - .build() : - ImmutableSet.builder() - .add("fabric-api-base") - .add("fabric-resource-loader-v0") - .add("fabric-networking-v0") - .add("fabric-lifecycle-events-v1") - .build(); - for (String module : requiredModules) { - boolean moduleLoaded = FabricLoader.getInstance().isModLoaded(module); - if (!moduleLoaded) { - RoughlyEnoughItemsState.error("Fabric API is not installed!", "https://www.curseforge.com/minecraft/mc-mods/fabric-api/files/all"); - break; - } - } - if (!FabricLoader.getInstance().isModLoaded("architectury")) { - RoughlyEnoughItemsState.error("Architectury API is not installed!", "https://www.curseforge.com/minecraft/mc-mods/architectury-api/files/all"); - } else { - Version version = FabricLoader.getInstance().getModContainer("architectury").get().getMetadata().getVersion(); - - try { - if (version instanceof SemanticVersion && SemanticVersion.parse("1.24.0").compareTo((SemanticVersion) version) > 0) { - RoughlyEnoughItemsState.error("Architectury API is too old, please update!", "https://www.curseforge.com/minecraft/mc-mods/architectury-api/files/all"); - } - } catch (VersionParsingException e) { - e.printStackTrace(); - } - } - if (isClient()) { - if (!FabricLoader.getInstance().isModLoaded("cloth-config2")) { - RoughlyEnoughItemsState.error("Cloth Config is not installed!", "https://www.curseforge.com/minecraft/mc-mods/cloth-config/files/all"); - } - } } @Override diff --git a/fabric/src/main/resources/error_notifier.json b/fabric/src/main/resources/error_notifier.json new file mode 100644 index 000000000..90d2a76bf --- /dev/null +++ b/fabric/src/main/resources/error_notifier.json @@ -0,0 +1,26 @@ +{ + "schemaVersion": 1, + "checks": [ + { + "type": "depends", + "modId": "fabric", + "modName": "Fabric API", + "versions": "*", + "url": "https://www.curseforge.com/minecraft/mc-mods/fabric-api/files/all/" + }, + { + "type": "depends", + "modId": "architectury", + "modName": "Architectury API", + "versions": ">=1.0.0 <2.0.0", + "url": "https://www.curseforge.com/minecraft/mc-mods/architectury-api/files/all" + }, + { + "type": "depends", + "modId": "cloth-config2", + "modName": "Cloth Config", + "versions": "*", + "url": "https://www.curseforge.com/minecraft/mc-mods/cloth-config/files/all" + } + ] +} \ No newline at end of file -- cgit