From 05fa454bac96f223bf8335be1e111e1be8d6f6b7 Mon Sep 17 00:00:00 2001 From: Draycia Date: Thu, 3 Sep 2020 23:35:22 -0700 Subject: [PATCH] Deprecate shouldBungee, ignore this update --- .../net/draycia/carbon/channels/ChatChannel.java | 12 ++++++++++++ .../carbon/channels/impls/CarbonChatChannel.java | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/draycia/carbon/channels/ChatChannel.java b/src/main/java/net/draycia/carbon/channels/ChatChannel.java index 1ab3dbdf..5901c25b 100644 --- a/src/main/java/net/draycia/carbon/channels/ChatChannel.java +++ b/src/main/java/net/draycia/carbon/channels/ChatChannel.java @@ -33,8 +33,20 @@ public abstract class ChatChannel implements ForwardingAudience { */ public abstract Boolean isIgnorable(); + /** + * + * @return If this channel should be synced cross server + * + * @deprecated Use {@link #isCrossServer()} instead + */ + @Deprecated public abstract Boolean shouldBungee(); + /** + * @return If this channel should be synced cross server + */ + public abstract Boolean isCrossServer(); + /** * @return The name of this channel. */ diff --git a/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java b/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java index a63452d2..39df21be 100644 --- a/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java +++ b/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java @@ -190,7 +190,7 @@ 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() && !fromRemote && shouldBungee()) { + if (user.isOnline() && !fromRemote && (shouldBungee() || isCrossServer())) { sendMessageToBungee(user.asPlayer(), consoleEvent.getComponent()); } @@ -382,8 +382,14 @@ public class CarbonChatChannel extends ChatChannel { } @Override + @Deprecated public Boolean shouldBungee() { - return getBoolean("should-bungee") || getBoolean("is-cross-server"); + return getBoolean("should-bungee"); + } + + @Override + public Boolean isCrossServer() { + return getBoolean("is-cross-server"); } @Override