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