From a6ea7f330d45ee856e413301fbbee53f53a0e76f Mon Sep 17 00:00:00 2001 From: Jais Djurhuus-Kempel Date: Fri, 9 Aug 2024 12:46:37 +0300 Subject: [PATCH] only log screen name client side --- gradle.properties | 2 +- src/main/java/invtweaks/config/InvTweaksConfig.java | 2 +- src/main/java/invtweaks/util/Sorting.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 476bcb9..a2c23af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,7 +31,7 @@ mod_name=Inventory Tweaks Refoxed # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=Apache License, Version 2.0 # The mod version. See https://semver.org/ -mod_version=1.21.0-1.1.3 +mod_version=1.21.0-1.1.4 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/invtweaks/config/InvTweaksConfig.java b/src/main/java/invtweaks/config/InvTweaksConfig.java index c83b5f7..f881e33 100644 --- a/src/main/java/invtweaks/config/InvTweaksConfig.java +++ b/src/main/java/invtweaks/config/InvTweaksConfig.java @@ -339,7 +339,7 @@ public static boolean isQuickViewEnabled() { } public static boolean isDebugEnabled() { - return ENABLE_DEBUG.get(); + return CLIENT_CONFIG.isLoaded() && ENABLE_DEBUG.get(); } public static Map cfgToCompiledCats(List lst) { diff --git a/src/main/java/invtweaks/util/Sorting.java b/src/main/java/invtweaks/util/Sorting.java index d9ec5b3..6165b24 100644 --- a/src/main/java/invtweaks/util/Sorting.java +++ b/src/main/java/invtweaks/util/Sorting.java @@ -30,7 +30,7 @@ public class Sorting { public static void executeSort(Player player, boolean isPlayerSort, String screenClass) { - if (InvTweaksConfig.isDebugEnabled()) { + if (player != null && player.level().isClientSide() && InvTweaksConfig.isDebugEnabled()) { InvTweaksMod.LOGGER.debug("screen: " + screenClass); } if (isPlayerSort) {