Fix cross server messages

This commit is contained in:
Draycia committed 2020-08-05 04:19:38 -07:00
1 parent 169c911f64
commit 8dd08c2389
2 files changed
+4 -4

No files matched your search

@@ -139,10 +139,10 @@ public class CarbonChatChannel extends ChatChannel {
// Route message to bungee / discord (if message originates from this server)
// Use instanceof and not isOnline, if this message originates from another then the instanceof will
// fail, but isOnline may succeed if the player is online on both servers (somehow).
if (user.isOnline() && fromBungee) {
if (shouldForwardFormatting() && shouldBungee()) {
if (user.isOnline() && !fromBungee && shouldBungee()) {
if (shouldForwardFormatting()) {
sendMessageToBungee(user.asPlayer(), componentEvent.getComponent());
} else if (shouldBungee()) {
} else {
sendMessageToBungee(user.asPlayer(), message);
}
}
@@ -141,7 +141,7 @@ public class PluginMessageManager implements PluginMessageListener {
public void sendComponent(ChatChannel chatChannel, Player player, Component component) {
ByteArrayDataOutput msg = ByteStreams.newDataOutput();
msg.writeUTF(chatChannel.getName());
msg.writeUTF(chatChannel.getKey());
msg.writeUTF(player.getUniqueId().toString());
msg.writeUTF(MiniMessage.get().serialize(component));