aboutsummaryrefslogtreecommitdiff
path: root/forge/src/serverComponent
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-01-16 01:18:36 +0800
committershedaniel <daniel@shedaniel.me>2022-01-16 03:01:20 +0800
commit5122d2ba64e67decc414f47b455dadbd273da268 (patch)
tree23dc67ff98020eb17c8780d2077c0395c70f83dc /forge/src/serverComponent
parent18759884ec0a61e497332cdf38d97890eda15f35 (diff)
downloadRoughlyEnoughItems-5122d2ba64e67decc414f47b455dadbd273da268.tar.gz
RoughlyEnoughItems-5122d2ba64e67decc414f47b455dadbd273da268.tar.bz2
RoughlyEnoughItems-5122d2ba64e67decc414f47b455dadbd273da268.zip
Introduce the server component version of REI
Diffstat (limited to 'forge/src/serverComponent')
-rw-r--r--forge/src/serverComponent/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForgeServerComponent.java52
-rw-r--r--forge/src/serverComponent/resources/META-INF/mods.toml28
2 files changed, 80 insertions, 0 deletions
diff --git a/forge/src/serverComponent/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForgeServerComponent.java b/forge/src/serverComponent/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForgeServerComponent.java
new file mode 100644
index 000000000..91becf2f8
--- /dev/null
+++ b/forge/src/serverComponent/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForgeServerComponent.java
@@ -0,0 +1,52 @@
+/*
+ * This file is licensed under the MIT License, part of Roughly Enough Items.
+ * Copyright (c) 2018, 2019, 2020, 2021, 2022 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 me.shedaniel.rei.RoughlyEnoughItemsInitializer;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.fml.DatagenModLoader;
+import net.minecraftforge.fml.ModList;
+import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.fml.loading.FMLEnvironment;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+@Mod("roughlyenoughitems_servercomponent")
+public class RoughlyEnoughItemsForgeServerComponent {
+ public RoughlyEnoughItemsForgeServerComponent() {
+ Logger logger = LogManager.getLogger(RoughlyEnoughItemsForgeServerComponent.class);
+ if (!DatagenModLoader.isRunningDataGen()) {
+ if (FMLEnvironment.dist == Dist.CLIENT) {
+ logger.error("Roughly Enough Items Server Component is not compatible with the client!");
+ System.exit(1);
+ } else if (ModList.get().isLoaded("roughlyenoughitems")) {
+ logger.error("Roughly Enough Items is already loaded! The server component is only used alongside Just Enough Items, " +
+ "to allow clients to use REI without switching to JEI completely on the server!");
+ System.exit(1);
+ } else {
+ RoughlyEnoughItemsInitializer.onInitialize();
+ }
+ }
+ }
+}
diff --git a/forge/src/serverComponent/resources/META-INF/mods.toml b/forge/src/serverComponent/resources/META-INF/mods.toml
new file mode 100644
index 000000000..c51ea9e70
--- /dev/null
+++ b/forge/src/serverComponent/resources/META-INF/mods.toml
@@ -0,0 +1,28 @@
+modLoader = "javafml"
+loaderVersion = "[33,)"
+issueTrackerURL = "https://github.com/shedaniel/RoughlyEnoughItems/issues"
+logoFile = "icon.png"
+authors = "shedaniel"
+license = "MIT"
+
+[[mods]]
+modId = "roughlyenoughitems_servercomponent"
+version = "${version}"
+displayName = "Roughly Enough Items Server Component (REI)"
+description = '''
+To allow players to view items and recipes.
+'''
+
+[[dependencies.roughlyenoughitems_servercomponent]]
+modId = "architectury"
+mandatory = true
+versionRange = "[1.10.139,)"
+ordering = "NONE"
+side = "BOTH"
+
+[[dependencies.roughlyenoughitems_servercomponent]]
+modId = "cloth-config"
+mandatory = true
+versionRange = "[4.12,)"
+ordering = "NONE"
+side = "BOTH"