Files
Eagler-Archive/incari-client/files/patches/chat/0173-login-commands-passwords-kept-out-of-the-command-history.patch
T

28 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: incari-client <335801235+incari-client@users.noreply.github.com>
Date: Tue, 13 Oct 2026 18:32:16 -0400
Subject: [PATCH] chat: Login commands' passwords kept out of the command
history
diff --git a/src/main/java/net/minecraft/client/CommandHistory.java b/src/main/java/net/minecraft/client/CommandHistory.java
index e89477e53087da1d5c6433b1a36ff5424e1ded3d..18332ab989adc7b949159f98cb1bbf0b2b0be990 100644
--- a/src/main/java/net/minecraft/client/CommandHistory.java
+++ b/src/main/java/net/minecraft/client/CommandHistory.java
@@ -25,2 +25,5 @@
this.lastCommands.addAll(reader.lines().toList());
+ // Incari start: passwords saved before HiddenPasswords kept them out are dropped
+ this.lastCommands.removeIf(incari.client.gui.HiddenPasswords::hasPassword);
+ // Incari end
} catch (Exception exception) {
diff --git a/src/main/java/net/minecraft/client/gui/components/ChatComponent.java b/src/main/java/net/minecraft/client/gui/components/ChatComponent.java
index 2e94103c187c9b5fa1102cb003e3f32980c4f279..319262167035fd15c44d3130575da7b080861177 100644
--- a/src/main/java/net/minecraft/client/gui/components/ChatComponent.java
+++ b/src/main/java/net/minecraft/client/gui/components/ChatComponent.java
@@ -370,2 +370,5 @@
public void addRecentChat(final String message) {
+ // Incari start: a login command's password kept out of the history (HiddenPasswords)
+ if (incari.client.gui.HiddenPasswords.hasPassword(message)) return;
+ // Incari end
if (!message.equals(this.recentChat.peekLast())) {