Skip to content

Commit

Permalink
Strict client-side only
Browse files Browse the repository at this point in the history
  • Loading branch information
Richy-Z committed May 19, 2024
1 parent e597d85 commit 716bff0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
10 changes: 10 additions & 0 deletions common/src/main/java/com/numelon/threatengl/ThreatenGL.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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...");
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/resources/threatengl.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

"minVersion": "0.8",

"client": [],
"client": ["ThreatenGLMixin"],

"mixins": ["ThreatenGLMixin"],
"mixins": [],

"injectors": {
"defaultRequire": 1
Expand Down
6 changes: 3 additions & 3 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -38,4 +38,4 @@ mandatory = true
# versionRange = "[11.1.17,)"
versionRange = "[2.10.12,)"
ordering = "AFTER"
side = "BOTH"
side = "CLIENT"
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ 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"
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"
Expand All @@ -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"
6 changes: 5 additions & 1 deletion quilt/src/main/resources/quilt.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,9 @@
]
},

"mixin": ["threatengl.mixins.json"]
"mixin": ["threatengl.mixins.json"],

"minecraft": {
"environment": "client"
}
}

0 comments on commit 716bff0

Please sign in to comment.