9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-06 15:51:31 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0036-Do-not-log-expired-message-warnings.patch
2025-07-07 03:51:07 +08:00

35 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Fri, 25 Nov 2022 15:07:55 +0100
Subject: [PATCH] Do not log expired message warnings
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/net/minecraft/network/chat/PlayerChatMessage.java b/net/minecraft/network/chat/PlayerChatMessage.java
index 1ce8c41e5c61c356b6c20cd58f218f7d64f43ab9..ecd6332b8aa68c447170264173147b3b8fc21697 100644
--- a/net/minecraft/network/chat/PlayerChatMessage.java
+++ b/net/minecraft/network/chat/PlayerChatMessage.java
@@ -141,7 +141,7 @@ public record PlayerChatMessage(
}
public boolean hasExpiredServer(Instant timestamp) {
- return timestamp.isAfter(this.timeStamp().plus(MESSAGE_EXPIRES_AFTER_SERVER));
+ return timestamp.isAfter(this.timeStamp().plus(MESSAGE_EXPIRES_AFTER_SERVER)); // Gale - do not log expired message warnings - diff on change
}
public boolean hasExpiredClient(Instant timestamp) {
diff --git a/net/minecraft/network/chat/SignedMessageChain.java b/net/minecraft/network/chat/SignedMessageChain.java
index 3664c591532372d2782371871aec5159f2d8ab5b..cdcfadb843be7e42a24d71e4f77ff5c0d664ab40 100644
--- a/net/minecraft/network/chat/SignedMessageChain.java
+++ b/net/minecraft/network/chat/SignedMessageChain.java
@@ -55,7 +55,7 @@ public class SignedMessageChain {
this.setChainBroken();
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.INVALID_SIGNATURE);
} else {
- if (playerChatMessage.hasExpiredServer(Instant.now())) {
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.chat.expiredMessageWarning && playerChatMessage.hasExpiredServer(Instant.now())) { // Gale - do not log expired message warnings
SignedMessageChain.LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", body.content());
}