From 8f6674628cd4958fe4a1d33171dade66993c583b Mon Sep 17 00:00:00 2001 From: elmon <9622479+Elmon11@users.noreply.github.com> Date: Wed, 6 Oct 2021 14:24:43 +0200 Subject: [PATCH] [SUBJECT TO TESTING DO NOT PUSH] --- .../discord/DiscordToMinecraftListener.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/discord/DiscordToMinecraftListener.java b/src/main/java/me/totalfreedom/totalfreedommod/discord/DiscordToMinecraftListener.java index e0f26bff..9429f6b0 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/discord/DiscordToMinecraftListener.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/discord/DiscordToMinecraftListener.java @@ -34,7 +34,20 @@ public class DiscordToMinecraftListener extends ListenerAdapter { message.append(" ").append(tag); } - message.append(" ").append(ChatColor.RED).append(ChatColor.stripColor(member.getEffectiveName())).append(ChatColor.DARK_GRAY).append(":").append(ChatColor.RESET); + + message.append(" ").append(ChatColor.RED).append(ChatColor.stripColor(member.getEffectiveName())).append(ChatColor.DARK_GRAY).append(":"); + + Message repliedTo = msg.getReferencedMessage() + + if (repliedTo != null) + { + message.append(ChatColor.DARK_GRAY + ChatColor.ITALIC +"[" + ChatColor.GRAY + "Replying to " + ChatColor.BOLD + repliedTo.getAuthor().getName() + ChatColor.RESET + ChatColor.DARK_GRAY+ "]" + ChatColor.RESET); + } + else + { + message.append(ChatColor.RESET + " ") + } + ComponentBuilder builder = new ComponentBuilder(message.toString()); if (!msg.getContentDisplay().isEmpty()) { @@ -110,4 +123,4 @@ public class DiscordToMinecraftListener extends ListenerAdapter return null; } } -} \ No newline at end of file +}