aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-05-16 21:43:35 +0800
committershedaniel <daniel@shedaniel.me>2021-05-16 21:43:35 +0800
commit9796ed33a2616dd4bca6b0158e329c2191a76685 (patch)
tree9983daa7fb6def70203ca0d18b0e8faecb42ccc2
parent7ebb226c85529ef9de4c93ce91f24c9ca6f608a7 (diff)
downloadRoughlyEnoughItems-9796ed33a2616dd4bca6b0158e329c2191a76685.tar.gz
RoughlyEnoughItems-9796ed33a2616dd4bca6b0158e329c2191a76685.tar.bz2
RoughlyEnoughItems-9796ed33a2616dd4bca6b0158e329c2191a76685.zip
Add "jei" stub, and made JEI compat defaulted enable
-rw-r--r--forge/build.gradle2
-rw-r--r--forge/src/main/java/me/shedaniel/rei/forge/JEIStub.java31
-rw-r--r--forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsInitializerImpl.java3
-rw-r--r--forge/src/main/resources/META-INF/mods.toml9
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java2
6 files changed, 46 insertions, 7 deletions
diff --git a/forge/build.gradle b/forge/build.gradle
index c7ccec31c..dd119678f 100644
--- a/forge/build.gradle
+++ b/forge/build.gradle
@@ -57,6 +57,8 @@ dependencies {
modRuntime("appeng:appliedenergistics2:8.2.0")
modRuntime("curse.maven:tcon-74072:3273213")
modRuntime("curse.maven:mantle-74924:3273201")
+ modRuntime("curse.maven:jer-240630:3066754")
+ modRuntime("curse.maven:jep-417645:3198370")
}
shadowJar {
diff --git a/forge/src/main/java/me/shedaniel/rei/forge/JEIStub.java b/forge/src/main/java/me/shedaniel/rei/forge/JEIStub.java
new file mode 100644
index 000000000..de0c34314
--- /dev/null
+++ b/forge/src/main/java/me/shedaniel/rei/forge/JEIStub.java
@@ -0,0 +1,31 @@
+/*
+ * 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.forge;
+
+import net.minecraftforge.fml.common.Mod;
+
+// Hello mods, JEI is present!! Please give in and trust me!
+@Mod("jei")
+public class JEIStub {
+}
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 45b4e39a7..fa282697a 100644
--- a/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsInitializerImpl.java
+++ b/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsInitializerImpl.java
@@ -34,9 +34,6 @@ public class RoughlyEnoughItemsInitializerImpl {
}
public static void checkMods() {
- if (ModList.get().isLoaded("jei")) {
- RoughlyEnoughItemsState.error("JEI is installed! REI is an replacement of JEI, we can't co-exist!");
- }
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");
diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml
index 74fa66012..30ac8e0af 100644
--- a/forge/src/main/resources/META-INF/mods.toml
+++ b/forge/src/main/resources/META-INF/mods.toml
@@ -4,6 +4,7 @@ issueTrackerURL = "https://github.com/shedaniel/RoughlyEnoughItems/issues"
logoFile = "icon.png"
authors = "shedaniel"
license = "MIT"
+
[[mods]]
modId = "roughlyenoughitems"
version = "${version}"
@@ -12,6 +13,14 @@ description = '''
To allow players to view items and recipes.
'''
+[[mods]]
+modId = "jei"
+version = "7.9999"
+displayName = "Roughly Enough Items (JEI Stub)"
+description = '''
+To allow players to view items and recipes.
+'''
+
[[dependencies.roughlyenoughitems]]
modId = "architectury"
mandatory = true
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java
index ac2156026..f5b637ba4 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java
@@ -383,11 +383,11 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
@Override
public boolean isJEICompatibilityLayerEnabled() {
- return Platform.isForge() && advanced.jeiCompatibilityLayer;
+ return Platform.isForge() && advanced.enableJeiCompatibilityLayer;
}
public void setJEICompatibilityLayerEnabled(boolean value) {
- advanced.jeiCompatibilityLayer = value;
+ advanced.enableJeiCompatibilityLayer = value;
}
@Retention(RetentionPolicy.RUNTIME)
@@ -493,7 +493,7 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
@ConfigEntry.Gui.CollapsibleObject(startExpanded = true)
public Filtering filtering = new Filtering();
@ConfigEntry.Gui.Excluded
- public boolean jeiCompatibilityLayer = false;
+ public boolean enableJeiCompatibilityLayer = true;
public static class Tooltips {
@Comment("Declares whether REI should append mod names to entries.") private boolean appendModNames = true;
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java
index 0a1c57a9a..8c52a7614 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java
@@ -156,7 +156,7 @@ public abstract class AbstractEntryStack<A> extends AbstractRenderer implements
public Tooltip getTooltip(Point mouse, boolean appendModName) {
Mutable<Tooltip> tooltip = new MutableObject<>(getRenderer().<A>cast().getTooltip(this, mouse));
if (tooltip.getValue() == null) return null;
- tooltip.getValue().getText().addAll(get(EntryStack.Settings.TOOLTIP_APPEND_EXTRA).apply(this));
+ tooltip.getValue().getText().addAll(get(Settings.TOOLTIP_APPEND_EXTRA).apply(this));
tooltip.setValue(get(Settings.TOOLTIP_PROCESSOR).apply(this, tooltip.getValue()));
if (tooltip.getValue() == null) return null;
if (appendModName) {