From 716bff06939449c3b90270851247ed19d78f6b0d Mon Sep 17 00:00:00 2001 From: Richy Z <64844585+Richy-Z@users.noreply.github.com> Date: Sun, 19 May 2024 21:13:18 +0100 Subject: [PATCH] Strict client-side only --- .../main/java/com/numelon/threatengl/ThreatenGL.java | 10 ++++++++++ common/src/main/resources/threatengl.mixins.json | 4 ++-- forge/src/main/resources/META-INF/mods.toml | 6 +++--- gradle.properties | 2 +- .../src/main/resources/META-INF/neoforge.mods.toml | 6 +++--- quilt/src/main/resources/quilt.mod.json | 6 +++++- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/common/src/main/java/com/numelon/threatengl/ThreatenGL.java b/common/src/main/java/com/numelon/threatengl/ThreatenGL.java index 56164fe..1dfd143 100644 --- a/common/src/main/java/com/numelon/threatengl/ThreatenGL.java +++ b/common/src/main/java/com/numelon/threatengl/ThreatenGL.java @@ -3,6 +3,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import dev.architectury.platform.Platform; +import dev.architectury.utils.Env; + import org.lwjgl.glfw.GLFW; public final class ThreatenGL { @@ -12,6 +15,13 @@ public final class ThreatenGL { public static void init() { // Write common init code here. + + // just in case someone somehow forces this mod to run on servers despite the configuration specifying client only + if (Platform.getEnvironment() == Env.SERVER) { + LOGGER.info((char)27 + "[31mThreatenGL WILL NOT work on servers! It is a client-side mod ONLY! Please remove it from the server mods folder." + (char)27 + "[0m"); + return; + } + LOGGER.info("Hark! This numelon mod doth seem to toil as expected! O, dear sire, rejoice! How tremendous!"); LOGGER.info("ThreatenGL will threaten Minecraft soon..."); diff --git a/common/src/main/resources/threatengl.mixins.json b/common/src/main/resources/threatengl.mixins.json index ef5c22c..6fe9c65 100644 --- a/common/src/main/resources/threatengl.mixins.json +++ b/common/src/main/resources/threatengl.mixins.json @@ -7,9 +7,9 @@ "minVersion": "0.8", - "client": [], + "client": ["ThreatenGLMixin"], - "mixins": ["ThreatenGLMixin"], + "mixins": [], "injectors": { "defaultRequire": 1 diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 6e369c5..23e9605 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -22,14 +22,14 @@ mandatory = true # Forge 1.17.1 and up (fml 37) versionRange = "[37,)" ordering = "NONE" -side = "BOTH" +side = "CLIENT" [[dependencies.threatengl]] modId = "minecraft" mandatory = true versionRange = "[1.17,)" ordering = "NONE" -side = "BOTH" +side = "CLIENT" [[dependencies.threatengl]] modId = "architectury" @@ -38,4 +38,4 @@ mandatory = true # versionRange = "[11.1.17,)" versionRange = "[2.10.12,)" ordering = "AFTER" -side = "BOTH" +side = "CLIENT" diff --git a/gradle.properties b/gradle.properties index 414f7cb..e528a5c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx8G org.gradle.parallel=true # Mod properties -mod_version = 1.3.0-beta.2 +mod_version = 1.3.1-beta.1 maven_group = com.numelon.threatengl archives_name = threatengl enabled_platforms = fabric,forge,neoforge,quilt diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index a07655d..330008b 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -23,7 +23,7 @@ type = "required" # Therefore we have to specify [20,) instead of [40,) otherwise that will invalidate future Minecraft releases and future NeoForge loader releases who have the new versioning system instead of the fml versioning system versionRange = "[20,)" ordering = "NONE" -side = "BOTH" +side = "CLIENT" [[dependencies.threatengl]] modId = "minecraft" @@ -31,7 +31,7 @@ type = "required" # Note that NeoForged was created in July 2023 and thus does not have support before Minecraft 1.20.1 versionRange = "[1.20.1,)" ordering = "NONE" -side = "BOTH" +side = "CLIENT" [[dependencies.threatengl]] modId = "architectury" @@ -40,7 +40,7 @@ type = "optional" # however Forge specific versions are, and this is the last version supporting 1.20.1 versionRange = "[9.2.14,)" ordering = "AFTER" -side = "BOTH" +side = "CLIENT" [[mixins]] config = "threatengl.mixins.json" diff --git a/quilt/src/main/resources/quilt.mod.json b/quilt/src/main/resources/quilt.mod.json index d36ab1c..1400911 100644 --- a/quilt/src/main/resources/quilt.mod.json +++ b/quilt/src/main/resources/quilt.mod.json @@ -51,5 +51,9 @@ ] }, - "mixin": ["threatengl.mixins.json"] + "mixin": ["threatengl.mixins.json"], + + "minecraft": { + "environment": "client" + } }