aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-05-17 21:41:03 +0800
committershedaniel <daniel@shedaniel.me>2021-05-17 21:41:03 +0800
commit745f78a4aa7d23fe03e7420eb3fe06b8c418db35 (patch)
tree1d4960dbb5b575975602f23b557f7d3246f21e96 /runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java
parent1e8f7022d4a82a6210c9d4080f3bc49d8129d20a (diff)
downloadRoughlyEnoughItems-745f78a4aa7d23fe03e7420eb3fe06b8c418db35.tar.gz
RoughlyEnoughItems-745f78a4aa7d23fe03e7420eb3fe06b8c418db35.tar.bz2
RoughlyEnoughItems-745f78a4aa7d23fe03e7420eb3fe06b8c418db35.zip
Implement ErrorDisplayer on Fabric properly
Diffstat (limited to 'runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java
index 468ac0988..7ca37778f 100644
--- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java
+++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java
@@ -23,8 +23,7 @@
package me.shedaniel.rei;
-import me.shedaniel.architectury.platform.Platform;
-import me.shedaniel.architectury.utils.Env;
+import net.fabricmc.api.EnvType;
import net.minecraft.util.Tuple;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -41,6 +40,8 @@ public class RoughlyEnoughItemsState {
public static final Logger LOGGER = LogManager.getFormatterLogger("REI");
+ public static EnvType env;
+ public static boolean isDev;
private static List<Tuple<String, String>> errors = new ArrayList<>();
private static List<Tuple<String, String>> warnings = new ArrayList<>();
private static Set<String> errorSet = new LinkedHashSet<>();
@@ -48,7 +49,7 @@ public class RoughlyEnoughItemsState {
private static List<Runnable> continueCallbacks = new ArrayList<>();
public static void error(String reason) {
- if (Platform.getEnvironment() == Env.SERVER || Platform.isDevelopmentEnvironment())
+ if (env == EnvType.SERVER || isDev)
throw new RuntimeException(reason);
if (RoughlyEnoughItemsState.errorSet.add(reason + " " + null)) {
RoughlyEnoughItemsState.errors.add(new Tuple<>(reason, null));
@@ -57,7 +58,7 @@ public class RoughlyEnoughItemsState {
}
public static void error(String reason, String link) {
- if (Platform.getEnvironment() == Env.SERVER || Platform.isDevelopmentEnvironment())
+ if (env == EnvType.SERVER || isDev)
throw new RuntimeException(reason + " " + link);
if (RoughlyEnoughItemsState.errorSet.add(reason + " " + link)) {
RoughlyEnoughItemsState.errors.add(new Tuple<>(reason, link));