aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-02-10 10:56:26 +0800
committershedaniel <daniel@shedaniel.me>2022-02-10 10:56:26 +0800
commitc2f282812a2d88eb017fefe05e202b42b272ae5c (patch)
tree90a2bc11795498c68f6dec96ff0696280c4d2533 /runtime
parenta0162fe0f6f73bc2dbfdee29ae2e32a06b5e13a7 (diff)
downloadRoughlyEnoughItems-c2f282812a2d88eb017fefe05e202b42b272ae5c.tar.gz
RoughlyEnoughItems-c2f282812a2d88eb017fefe05e202b42b272ae5c.tar.bz2
RoughlyEnoughItems-c2f282812a2d88eb017fefe05e202b42b272ae5c.zip
Close #773
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java13
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