From c2f282812a2d88eb017fefe05e202b42b272ae5c Mon Sep 17 00:00:00 2001 From: shedaniel Date: Thu, 10 Feb 2022 10:56:26 +0800 Subject: Close #773 --- .../me/shedaniel/rei/RoughlyEnoughItemsInitializer.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'runtime/src/main/java/me') 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 -- cgit