From e9de7eb801519c03616b1eea5f677bdf95f6720c Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:08:49 +0700 Subject: [PATCH] fix: ansi extra depth color fix (thanks Yaode_owo for mentioning) --- build-number.txt | 2 +- .../me/chayapak1/chomens_bot/util/ComponentUtilities.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build-number.txt b/build-number.txt index 1e36b913..6ee69cb7 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -1258 \ No newline at end of file +1259 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java b/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java index d118509c..2d7757f3 100644 --- a/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java +++ b/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java @@ -101,7 +101,7 @@ public class ComponentUtilities { builder.append(output.output); - for (Component child : message.children()) builder.append(stringify(child, output.lastColor, depth)); + for (Component child : message.children()) builder.append(stringify(child, lastColor != null ? lastColor : output.lastColor, depth)); return builder.toString(); } catch (Exception e) { @@ -120,7 +120,7 @@ public class ComponentUtilities { builder.append(output.output); - for (Component child : message.children()) builder.append(stringifyMotd(child, output.lastColor, depth)); + for (Component child : message.children()) builder.append(stringifyMotd(child, lastColor != null ? lastColor : output.lastColor, depth)); return builder.toString(); } catch (Exception e) { @@ -140,7 +140,7 @@ public class ComponentUtilities { builder.append(output.output); - for (Component child : message.children()) builder.append(stringifyAnsi(child, output.lastColor, noHex, depth)); + for (Component child : message.children()) builder.append(stringifyAnsi(child, lastColor != null ? lastColor : output.lastColor, noHex, depth)); return builder.toString(); } catch (Exception e) {