From e4dd37b5d8961a0286ccacbd1b0f6b47441f9b61 Mon Sep 17 00:00:00 2001 From: Aizistral Date: Thu, 19 Nov 2026 03:31:54 +0100 Subject: Register config screen only on client --- .../aizistral/nochatreports/neoforge/NoChatReports.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'neoforge') 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 52c3657..64e9da8 100644 --- a/neoforge/src/main/java/com/aizistral/nochatreports/neoforge/NoChatReports.java +++ b/neoforge/src/main/java/com/aizistral/nochatreports/neoforge/NoChatReports.java @@ -30,13 +30,15 @@ public class NoChatReports implements PlatformProvider { NeoForge.EVENT_BUS.addListener(ClientPlayerNetworkEvent.LoggingIn.class, Events::onPlayReady); } - Function configScreenFactory = NCRClient.getConfigScreen(); - if (isOnClient() && configScreenFactory != null) { - ModLoadingContext.get().registerExtensionPoint( - IConfigScreenFactory.class, - () -> (minecraft, parent) -> configScreenFactory.apply(parent) - ); - } + if (this.isOnClient()) { + Function configScreenFactory = NCRClient.getConfigScreen(); + if (configScreenFactory != null) { + ModLoadingContext.get().registerExtensionPoint( + IConfigScreenFactory.class, + () -> (minecraft, parent) -> configScreenFactory.apply(parent) + ); + } + } } @Override -- cgit v1.2.3