9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-20 15:29:30 +00:00
Files
Gale/patches/server/0058-Do-not-log-empty-message-warnings.patch
2023-08-08 20:49:05 +02:00

46 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
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 9e7c92730f04827d6052dce5b10453e67b70a682..ba2eb5818c1170eea9f455b7caeb3484e51ec395 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -185,6 +185,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;
@@ -2596,7 +2597,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 044ea3e293a7ad2ae169a7ac8a635c390aa5d393..453e47a3748a8da3cb1674949ded2bc64af0c67a 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -104,6 +104,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
+ }
+
}
}