mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-19 14:59:29 +00:00
45 lines
2.6 KiB
Diff
45 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MartijnMuijsers <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)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
index d31a345edfffe39f127073fc3aec8b3489bae79c..426a7fd3df09aa34967ab7707959ea7e037381fb 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.apache.commons.lang3.StringUtils;
|
|
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
|
import org.slf4j.Logger;
|
|
|
|
// CraftBukkit start
|
|
@@ -2569,7 +2570,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
|
// CraftBukkit start
|
|
String s = message.signedContent().plain();
|
|
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()) {
|
|
OutgoingPlayerChatMessage outgoing = OutgoingPlayerChatMessage.create(message);
|
|
outgoing.sendHeadersToRemainingPlayers(this.server.getPlayerList());
|
|
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
index c67adaa664bfe2b371f14efa83ea200b0e1006f0..f292156b411b4c0f5db8fa15c92df395acb6e901 100644
|
|
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
|
@@ -58,6 +58,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
|
|
+ }
|
|
+
|
|
}
|
|
|
|
}
|