From c65284d96e439a18b0ec4813e7dc632ce09183b5 Mon Sep 17 00:00:00 2001 From: Aizistral Date: Thu, 19 Nov 2026 00:34:05 +0100 Subject: Register config screen only on client --- .../aizistral/nochatreports/forge/NoChatReports.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'forge') diff --git a/forge/src/main/java/com/aizistral/nochatreports/forge/NoChatReports.java b/forge/src/main/java/com/aizistral/nochatreports/forge/NoChatReports.java index 7730ee9..8c59459 100644 --- a/forge/src/main/java/com/aizistral/nochatreports/forge/NoChatReports.java +++ b/forge/src/main/java/com/aizistral/nochatreports/forge/NoChatReports.java @@ -30,15 +30,17 @@ public class NoChatReports implements PlatformProvider { ClientPlayerNetworkEvent.LoggingIn.BUS.addListener(Events::onPlayReady); } - Function configScreenFactory = NCRClient.getConfigScreen(); - if (isOnClient() && configScreenFactory != null) { - context.registerExtensionPoint( - ConfigScreenHandler.ConfigScreenFactory.class, - () -> new ConfigScreenHandler.ConfigScreenFactory( - (minecraft, parent) -> configScreenFactory.apply(parent) - ) - ); - } + if (this.isOnClient()) { + Function configScreenFactory = NCRClient.getConfigScreen(); + if (configScreenFactory != null) { + context.registerExtensionPoint( + ConfigScreenHandler.ConfigScreenFactory.class, + () -> new ConfigScreenHandler.ConfigScreenFactory( + (minecraft, parent) -> configScreenFactory.apply(parent) + ) + ); + } + } } @Override -- cgit v1.2.3