From 7e9aae9a9b49882bb41205ba35472301f66e5f02 Mon Sep 17 00:00:00 2001 From: Draycia Date: Sun, 2 Aug 2020 00:30:10 -0700 Subject: [PATCH] Adjust a few config options --- .../java/net/draycia/carbon/channels/ChatChannel.java | 2 +- .../draycia/carbon/channels/impls/CarbonChatChannel.java | 8 ++++---- CarbonChat/src/main/resources/config.yml | 8 +++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CarbonChat/src/main/java/net/draycia/carbon/channels/ChatChannel.java b/CarbonChat/src/main/java/net/draycia/carbon/channels/ChatChannel.java index 56f9d9ff..7824f75f 100644 --- a/CarbonChat/src/main/java/net/draycia/carbon/channels/ChatChannel.java +++ b/CarbonChat/src/main/java/net/draycia/carbon/channels/ChatChannel.java @@ -66,7 +66,7 @@ public abstract class ChatChannel { public abstract String getCannotUseMessage(); - public abstract Boolean firstMatchingGroup(); + public abstract Boolean primaryGroupOnly(); public abstract boolean testContext(ChatUser sender, ChatUser target); diff --git a/CarbonChat/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java b/CarbonChat/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java index 22c10958..70ef7156 100644 --- a/CarbonChat/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java +++ b/CarbonChat/src/main/java/net/draycia/carbon/channels/impls/CarbonChatChannel.java @@ -172,7 +172,7 @@ public class CarbonChatChannel extends ChatChannel { private String getFormat(ChatUser user) { String group = "default"; - if (!firstMatchingGroup()) { + if (this.primaryGroupOnly()) { if (user.isOnline()) { group = carbonChat.getPermission().getPrimaryGroup(user.asPlayer()); } else { @@ -181,7 +181,7 @@ public class CarbonChatChannel extends ChatChannel { } else { String[] groups; - // TODO: this can't be done on main thread :( + // TODO: this can't be done on main thread (if user is offline) :( if (user.isOnline()) { groups = carbonChat.getPermission().getPlayerGroups(user.asPlayer()); } else { @@ -314,8 +314,8 @@ public class CarbonChatChannel extends ChatChannel { } @Override - public Boolean firstMatchingGroup() { - return getBoolean("first-matching-group"); + public Boolean primaryGroupOnly() { + return getBoolean("primary-group-only"); } @Override diff --git a/CarbonChat/src/main/resources/config.yml b/CarbonChat/src/main/resources/config.yml index 2e3519db..97a98f36 100644 --- a/CarbonChat/src/main/resources/config.yml +++ b/CarbonChat/src/main/resources/config.yml @@ -44,8 +44,9 @@ default: forward-format: true # Enables/disables cross server chat for this channel should-bungee: true - # Determines if this channel should use the highest matching vault group found for formatting - first-matching-group: false + # If true, plugin will only use the format corresponding to the user's primary group (vault). + # If false, plugin will look through the user's groups and go with the first group with a corresponding format. + primary-group-only: true channels: global: @@ -100,9 +101,6 @@ item-link-placeholders: - '%item%' spy-prefix: '[SPY] ' -spy-prefix-nation: '[SPY ] ' -spy-prefix-town: '[SPY ] ' -spy-prefix-mcmmo: '[SPY ] ' pings: enabled: true