From 745f78a4aa7d23fe03e7420eb3fe06b8c418db35 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Mon, 17 May 2021 21:41:03 +0800 Subject: Implement ErrorDisplayer on Fabric properly --- .../forge/RoughlyEnoughItemsInitializerImpl.java | 12 ++++---- .../rei/impl/client/forge/ErrorDisplayerImpl.java | 33 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 forge/src/main/java/me/shedaniel/rei/impl/client/forge/ErrorDisplayerImpl.java (limited to 'forge/src/main/java/me') diff --git a/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsInitializerImpl.java b/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsInitializerImpl.java index fa282697a..6baa7fd5c 100644 --- a/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsInitializerImpl.java +++ b/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsInitializerImpl.java @@ -23,10 +23,9 @@ package me.shedaniel.rei.forge; -import me.shedaniel.rei.RoughlyEnoughItemsState; import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.loading.FMLEnvironment; +import net.minecraftforge.fml.loading.FMLLoader; public class RoughlyEnoughItemsInitializerImpl { public static boolean isClient() { @@ -34,10 +33,9 @@ public class RoughlyEnoughItemsInitializerImpl { } public static void checkMods() { - if (isClient()) { - if (!ModList.get().isLoaded("cloth-config")) { - RoughlyEnoughItemsState.error("Cloth Config is not installed!", "https://www.curseforge.com/minecraft/mc-mods/cloth-config/files/all"); - } - } + } + + public static boolean isDev() { + return !FMLLoader.isProduction(); } } diff --git a/forge/src/main/java/me/shedaniel/rei/impl/client/forge/ErrorDisplayerImpl.java b/forge/src/main/java/me/shedaniel/rei/impl/client/forge/ErrorDisplayerImpl.java new file mode 100644 index 000000000..5186c7884 --- /dev/null +++ b/forge/src/main/java/me/shedaniel/rei/impl/client/forge/ErrorDisplayerImpl.java @@ -0,0 +1,33 @@ +/* + * This file is licensed under the MIT License, part of Roughly Enough Items. + * Copyright (c) 2018, 2019, 2020, 2021 shedaniel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package me.shedaniel.rei.impl.client.forge; + +import net.minecraft.client.gui.screens.Screen; + +import java.util.function.Consumer; + +public class ErrorDisplayerImpl { + public static void registerGuiInit(Consumer consumer) { + } +} -- cgit