Use BukkitAudiences#console() instead of serialization

This commit is contained in:
Draycia committed 2020-09-08 11:59:56 -07:00
1 parent 2ae106400a
commit 1ac07d0d3a
5 files changed
+5 -10

No files matched your search

@@ -68,8 +68,7 @@ public class AliasedChannelCommand {
Component component = getChatChannel().sendMessage(user, message, false);
carbonChat.getLogger().info(CarbonChat.LEGACY.serialize(component)
.replaceAll("(?:[^%]|\\A)%(?:[^%]|\\z)", "%%"));
carbonChat.getAdventureManager().getAudiences().console().sendMessage(component);
}
public ChatChannel getChatChannel() {
@@ -78,8 +78,7 @@ public class ChannelCommand {
Component component = channel.sendMessage(user, message, false);
carbonChat.getLogger().info(CarbonChat.LEGACY.serialize(component)
.replaceAll("(?:[^%]|\\A)%(?:[^%]|\\z)", "%%"));
carbonChat.getAdventureManager().getAudiences().console().sendMessage(component);
}
}
@@ -69,8 +69,7 @@ public class SudoChannelCommand {
private void sendMessageOther(CommandSender sender, ChatUser user, ChatChannel channel, String message) {
Component component = channel.sendMessage(user, message, false);
carbonChat.getLogger().info(CarbonChat.LEGACY.serialize(component)
.replaceAll("(?:[^%]|\\A)%(?:[^%]|\\z)", "%%"));
carbonChat.getAdventureManager().getAudiences().console().sendMessage(component);
}
}
@@ -76,8 +76,7 @@ public class BukkitChatListener implements Listener {
Bukkit.getScheduler().runTaskAsynchronously(carbonChat, () -> {
Component component = selectedChannel.sendMessage(user, recipients, event.getMessage(), false);
carbonChat.getLogger().info(CarbonChat.LEGACY.serialize(component)
.replaceAll("(?:[^%]|\\A)%(?:[^%]|\\z)", "%%"));
carbonChat.getAdventureManager().getAudiences().console().sendMessage(component);
if (carbonChat.getConfig().getBoolean("show-tips")) {
carbonChat.getLogger().info("Tip: Sync chat event! I cannot set the message format due to this. :(");
@@ -129,8 +129,7 @@ public class MessageManager {
channel.sendComponent(user, component);
carbonChat.getLogger().info(CarbonChat.LEGACY.serialize(component)
.replaceAll("(?:[^%]|\\A)%(?:[^%]|\\z)", "%%"));
carbonChat.getAdventureManager().getAudiences().console().sendMessage(component);
}
});