From c726b00f2a30a75f49a7ea45e28ce88681db087e Mon Sep 17 00:00:00 2001 From: umutcagand <237324081+c8dhjp4tyv-bit@users.noreply.github.com> Date: Sun, 13 Sep 2026 07:51:12 +0300 Subject: [PATCH] Fixed pasting a color config not applying it NbtUtils.fromClipboard(ISerializable) deserialises onto the existing object, so pasting NBT mutated the SettingColor in place without ever going through Setting#set and therefore without firing onChanged(). Every other mutation path in the screen (the RGBA boxes, the hue and brightness quads, the rainbow checkbox, the reset button) notifies the setting afterwards; paste did not. Settings whose value object is read directly appeared to work, but any setting that relies on its onChanged callback to propagate the value silently kept the old colour. In Block ESP that callback is also what registers the block in the map, so pasting a block config fell back to the default. Notify the setting on the NBT branch, and run the screen's action on both branches so paste is consistent with the other mutation paths. The trailing validate() moves into the NBT branch: the parse branch already validates through Setting#set -> ColorSetting#isValueValid. --- .../gui/screens/settings/ColorSettingScreen.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/gui/screens/settings/ColorSettingScreen.java b/src/main/java/meteordevelopment/meteorclient/gui/screens/settings/ColorSettingScreen.java index b2e104fe53a..f33782695c0 100644 --- a/src/main/java/meteordevelopment/meteorclient/gui/screens/settings/ColorSettingScreen.java +++ b/src/main/java/meteordevelopment/meteorclient/gui/screens/settings/ColorSettingScreen.java @@ -365,7 +365,12 @@ public boolean toClipboard() { @Override public boolean fromClipboard() { - if (!NbtUtils.fromClipboard(setting.get())) { + if (NbtUtils.fromClipboard(setting.get())) { + // The color was deserialised onto the existing object, so Setting#set - + // and with it onChanged() - was never reached. + setting.get().validate(); + setting.onChanged(); + } else { String clipboard = mc.keyboardHandler.getClipboard().trim(); SettingColor parsed; @@ -378,7 +383,7 @@ public boolean fromClipboard() { setting.set(parsed); } - setting.get().validate(); + callAction(); if (parent instanceof WidgetScreen p) { p.reload();