aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/main/java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java
index 5b56c0739..adc82c4c4 100644
--- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java
+++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java
@@ -30,14 +30,16 @@ import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
public class RoughlyEnoughItemsInitializer {
- public static final String COMPATIBLE_MC_VERSION = "1.18";
+ public static final String COMPATIBLE_MC_VERSION_LOW = "1.18.2";
+ public static final String COMPATIBLE_MC_VERSION_HIGH = "1.19";
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() + ").");
+
+ String minecraftVersion = getMinecraftVersion();
+ if (minecraftVersion.startsWith("1.") && (compareVersions(minecraftVersion, COMPATIBLE_MC_VERSION_LOW) < 0 || compareVersions(minecraftVersion, COMPATIBLE_MC_VERSION_HIGH) >= 0)) {
+ RoughlyEnoughItemsState.error("Your current REI version (for >=" + COMPATIBLE_MC_VERSION_LOW + " and <" + COMPATIBLE_MC_VERSION_HIGH + ") is not compatible with your current Minecraft version (" + minecraftVersion + ").");
}
checkMods();
@@ -106,4 +108,9 @@ public class RoughlyEnoughItemsInitializer {
public static String getMinecraftVersion() {
throw new AssertionError();
}
+
+ @ExpectPlatform
+ public static int compareVersions(String version1, String version2) {
+ throw new AssertionError();
+ }
} \ No newline at end of file