From 50b69473121d51dfa9ce9fe1699eb8db7f967ef0 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Thu, 13 Mar 2025 17:14:17 +0100 Subject: [PATCH] Hotfix DiscordChatRoom --- VelocityCore/src/de/steamwar/messages/Chatter.java | 8 ++++++-- .../velocitycore/discord/channels/DiscordChatRoom.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/VelocityCore/src/de/steamwar/messages/Chatter.java b/VelocityCore/src/de/steamwar/messages/Chatter.java index 2e67354c..607b4fd2 100644 --- a/VelocityCore/src/de/steamwar/messages/Chatter.java +++ b/VelocityCore/src/de/steamwar/messages/Chatter.java @@ -213,10 +213,14 @@ public interface Chatter { } static Chatter of(SteamwarUser user) { - return of(user.getUUID()); + return of(user.getUUID(), false); } static Chatter of(UUID uuid) { + return of(uuid, false); + } + + static Chatter of(UUID uuid, boolean playerlessChatShown) { Player player = VelocityCore.getProxy().getPlayer(uuid).orElse(null); if(player != null) return Chatter.of(player); @@ -229,7 +233,7 @@ public interface Chatter { @Override public boolean chatShown() { - return false; + return playerlessChatShown; } @Override diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChatRoom.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChatRoom.java index ce54b2d5..7b05357c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChatRoom.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChatRoom.java @@ -47,6 +47,6 @@ public class DiscordChatRoom extends DiscordChannel { return; } - ChatListener.sendChat(Chatter.of(user), target.get(), format, null, event.getMessage().getContentDisplay().replace('§', '&').replace('\n', ' ')); + ChatListener.sendChat(Chatter.of(user.getUUID(), true), target.get(), format, null, event.getMessage().getContentDisplay().replace('§', '&').replace('\n', ' ')); } }