diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-02-10 10:56:26 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-02-18 11:45:35 +0800 |
| commit | ff5e546de4bca679231e5ca474dc21785622463b (patch) | |
| tree | afdcd0133a1bffef1797ee654f2d8a1c7c396833 /runtime/src/main/java/me | |
| parent | c26287418dd457b84f6f7483bd09316a644d1b70 (diff) | |
| download | RoughlyEnoughItems-ff5e546de4bca679231e5ca474dc21785622463b.tar.gz RoughlyEnoughItems-ff5e546de4bca679231e5ca474dc21785622463b.tar.bz2 RoughlyEnoughItems-ff5e546de4bca679231e5ca474dc21785622463b.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, 13 insertions, 0 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java index 6ecffd4b6..0558cab1a 100644 --- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java +++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java @@ -26,13 +26,21 @@ package me.shedaniel.rei; 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.16"; + 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()) { @@ -94,4 +102,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 |
