summaryrefslogtreecommitdiffstats
path: root/neoforge
diff options
context:
space:
mode:
Diffstat (limited to 'neoforge')
-rw-r--r--neoforge/build.gradle6
-rw-r--r--neoforge/docs/META-INF/neoforge.mods.toml2
-rw-r--r--neoforge/src/main/java/com/aizistral/nochatreports/loader/LoaderPaths.java17
-rw-r--r--neoforge/src/main/java/com/aizistral/nochatreports/neoforge/NoChatReports.java15
-rw-r--r--neoforge/src/main/resources/mixins/neoforge/nochatreports-neoforge.mixins.json1
5 files changed, 29 insertions, 12 deletions
diff --git a/neoforge/build.gradle b/neoforge/build.gradle
index eeceb43..1559181 100644
--- a/neoforge/build.gradle
+++ b/neoforge/build.gradle
@@ -86,9 +86,9 @@ jar {
attributes([
"Specification-Title": "${mod_name}",
"Specification-Vendor": "${mod_author}",
- "Specification-Version": "${version}",
+ "Specification-Version": "${manifest_version}",
"Implementation-Title": "${mod_name}",
- "Implementation-Version": "${version}",
+ "Implementation-Version": "${manifest_version}",
"Implementation-Vendor" :"${mod_author}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
@@ -106,7 +106,7 @@ processResources {
// Replace properties in mods.toml with ones derived from settings.gradle
include 'neoforge.mods.toml'
expand 'mod_license': mod_license,
- 'mod_version': version,
+ 'mod_version': manifest_version,
'mod_id' : mod_id,
'mod_name': mod_name,
'mod_url': mod_url,
diff --git a/neoforge/docs/META-INF/neoforge.mods.toml b/neoforge/docs/META-INF/neoforge.mods.toml
index bb658c2..eefb0c1 100644
--- a/neoforge/docs/META-INF/neoforge.mods.toml
+++ b/neoforge/docs/META-INF/neoforge.mods.toml
@@ -15,6 +15,8 @@ version="${mod_version}"
displayName="${mod_name}"
displayURL="${mod_url}"
logoFile="${mod_icon}"
+iconFile="${mod_icon}"
+bannerFile="${mod_icon}"
credits="${contributor_0}, ${contributor_1}, ${contributor_2}"
authors="${mod_author}"
description='''
diff --git a/neoforge/src/main/java/com/aizistral/nochatreports/loader/LoaderPaths.java b/neoforge/src/main/java/com/aizistral/nochatreports/loader/LoaderPaths.java
new file mode 100644
index 0000000..8f4e23a
--- /dev/null
+++ b/neoforge/src/main/java/com/aizistral/nochatreports/loader/LoaderPaths.java
@@ -0,0 +1,17 @@
+package com.aizistral.nochatreports.loader;
+
+import java.nio.file.Path;
+
+import net.neoforged.fml.loading.FMLPaths;
+
+public final class LoaderPaths {
+
+ private LoaderPaths() {
+ throw new IllegalStateException("Can't touch this");
+ }
+
+ public static Path getConfigDir() {
+ return FMLPaths.CONFIGDIR.get();
+ }
+
+}
diff --git a/neoforge/src/main/java/com/aizistral/nochatreports/neoforge/NoChatReports.java b/neoforge/src/main/java/com/aizistral/nochatreports/neoforge/NoChatReports.java
index 5f5bbf0..a297082 100644
--- a/neoforge/src/main/java/com/aizistral/nochatreports/neoforge/NoChatReports.java
+++ b/neoforge/src/main/java/com/aizistral/nochatreports/neoforge/NoChatReports.java
@@ -2,6 +2,7 @@ package com.aizistral.nochatreports.neoforge;
import com.aizistral.nochatreports.common.NCRCore;
import com.aizistral.nochatreports.common.config.ClothConfigIntegration;
+import com.aizistral.nochatreports.common.config.NCRConfig;
import com.aizistral.nochatreports.common.platform.PlatformProvider;
import com.aizistral.nochatreports.common.platform.events.ClientEvents;
import net.minecraft.client.Minecraft;
@@ -9,12 +10,11 @@ import net.minecraft.client.multiplayer.ClientPacketListener;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent;
-import net.neoforged.bus.api.SubscribeEvent;
-import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.fml.loading.FMLPaths;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
+import net.neoforged.neoforge.common.NeoForge;
import java.nio.file.Path;
@@ -24,6 +24,10 @@ public class NoChatReports implements PlatformProvider {
public NoChatReports() {
NCRCore.awaken(this);
if (isOnClient()) {
+ if (NCRConfig.isModRunning()) {
+ NeoForge.EVENT_BUS.addListener(ClientPlayerNetworkEvent.LoggingIn.class, Events::onPlayReady);
+ }
+
if (!ClothConfigIntegration.ACTIVE) {
NCRCore.LOGGER.warn("ClothConfig API not found, cannot provide config screen factory.");
return;
@@ -49,16 +53,9 @@ public class NoChatReports implements PlatformProvider {
public Path getMinecraftDir() {
return FMLPaths.GAMEDIR.get();
}
-
- @Override
- public Path getConfigDir() {
- return FMLPaths.CONFIGDIR.get();
- }
- @EventBusSubscriber(modid = "nochatreports", value = Dist.CLIENT)
public static class Events {
- @SubscribeEvent
public static void onPlayReady(ClientPlayerNetworkEvent.LoggingIn event) {
Minecraft client = Minecraft.getInstance();
ClientPacketListener handler = client.getConnection();
diff --git a/neoforge/src/main/resources/mixins/neoforge/nochatreports-neoforge.mixins.json b/neoforge/src/main/resources/mixins/neoforge/nochatreports-neoforge.mixins.json
index 1da9702..1627464 100644
--- a/neoforge/src/main/resources/mixins/neoforge/nochatreports-neoforge.mixins.json
+++ b/neoforge/src/main/resources/mixins/neoforge/nochatreports-neoforge.mixins.json
@@ -2,6 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "com.aizistral.nochatreports.neoforge.mixins",
+ "plugin": "com.aizistral.nochatreports.common.NCRMixinPlugin",
"compatibilityLevel": "JAVA_25",
"mixins": [],
"client": [