diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-02-10 10:56:26 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-02-18 11:30:11 +0800 |
| commit | 1e6007c3336dbf300927310d6b81ad722c68f282 (patch) | |
| tree | 97452c60356271664113eeb7d0a5671cca44f341 /runtime/src/main/java/me | |
| parent | 0b57f3b514b1fe74016f6fc1092db966526fc7fc (diff) | |
| download | RoughlyEnoughItems-1e6007c3336dbf300927310d6b81ad722c68f282.tar.gz RoughlyEnoughItems-1e6007c3336dbf300927310d6b81ad722c68f282.tar.bz2 RoughlyEnoughItems-1e6007c3336dbf300927310d6b81ad722c68f282.zip | |
Close #773
Diffstat (limited to 'runtime/src/main/java/me')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java index 97f53c08d..5b56c0739 100644 --- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java +++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java @@ -27,13 +27,19 @@ import dev.architectury.injectables.annotations.ExpectPlatform; import net.fabricmc.api.EnvType; import java.lang.invoke.MethodHandles; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class RoughlyEnoughItemsInitializer { + public static final String COMPATIBLE_MC_VERSION = "1.18"; + public static void onInitialize() { RoughlyEnoughItemsState.env = isClient() ? EnvType.CLIENT : EnvType.SERVER; RoughlyEnoughItemsState.isDev = isDev(); + + if (getMinecraftVersion().startsWith("1.") && !getMinecraftVersion().startsWith(COMPATIBLE_MC_VERSION)) { + RoughlyEnoughItemsState.error("Your current REI version (for " + COMPATIBLE_MC_VERSION + ") is not compatible with your current Minecraft version (" + getMinecraftVersion() + ")."); + } + checkMods(); if (RoughlyEnoughItemsState.getErrors().isEmpty()) { @@ -95,4 +101,9 @@ public class RoughlyEnoughItemsInitializer { public static void checkMods() { throw new AssertionError(); } + + @ExpectPlatform + public static String getMinecraftVersion() { + throw new AssertionError(); + } }
\ No newline at end of file |
