From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Thu, 24 Nov 2022 23:45:57 +0100 Subject: [PATCH] Do not log empty message warnings License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html) Gale - https://galemc.org diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index e88035e907b49983daafda61a3218cef1a34b2fb..5fe32932cce864997682b0d6b6b268074ba6f7c6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -183,6 +183,7 @@ import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions; +import org.apache.commons.lang3.StringUtils; import org.galemc.gale.configuration.GaleGlobalConfiguration; import org.slf4j.Logger; @@ -2541,7 +2542,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // CraftBukkit start String s = message.signedContent(); if (s.isEmpty()) { - ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); + if (GaleGlobalConfiguration.get().logToConsole.chat.emptyMessageWarning) ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); // Gale - do not log empty message warnings } else if (this.getCraftPlayer().isConversing()) { final String conversationInput = s; this.server.processQueue.add(new Runnable() { diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java index 79f8d5286adeabffdcb682c33e5d2b83afb11dda..1ac238ebf7280c70ba49c3f59d3b3800d6b39ee0 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java @@ -99,6 +99,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics + public Chat chat; + public class Chat extends ConfigurationPart { + public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings + } + } }