Change prefix to message-prefix

This commit is contained in:
Draycia committed 2020-08-07 02:10:22 -07:00
1 parent f64ae319ed
commit 4bd0df8272
4 files changed
+9 -9

No files matched your search

@@ -41,7 +41,7 @@ public abstract class ChatChannel {
public abstract String getKey(); public abstract String getKey();
@Nullable @Nullable
public abstract String getPrefix(); public abstract String getMessagePrefix();
public abstract String getAliases(); public abstract String getAliases();
@@ -290,9 +290,9 @@ public class CarbonChatChannel extends ChatChannel {
@Override @Override
@Nullable @Nullable
public String getPrefix() { public String getMessagePrefix() {
if (config != null && config.contains("prefix")) { if (config != null && config.contains("message-prefix")) {
return config.getString("prefix"); return config.getString("message-prefix");
} }
return null; return null;
@@ -26,13 +26,13 @@ public class BukkitChatListener implements Listener {
ChatChannel channel = user.getSelectedChannel(); ChatChannel channel = user.getSelectedChannel();
for (ChatChannel entry : carbonChat.getChannelManager().getRegistry().values()) { for (ChatChannel entry : carbonChat.getChannelManager().getRegistry().values()) {
if (entry.getPrefix() == null) { if (entry.getMessagePrefix() == null) {
continue; continue;
} }
if (event.getMessage().startsWith(entry.getPrefix())) { if (event.getMessage().startsWith(entry.getMessagePrefix())) {
if (entry.canPlayerUse(user)) { if (entry.canPlayerUse(user)) {
event.setMessage(event.getMessage().substring(entry.getPrefix().length())); event.setMessage(event.getMessage().substring(entry.getMessagePrefix().length()));
channel = entry; channel = entry;
break; break;
} }
+2 -2
View File
@@ -54,7 +54,7 @@ channels:
default: true default: true
# If the player speaks in chat, and their message starts with the following, their message # If the player speaks in chat, and their message starts with the following, their message
# is automatically sent in this channel. This setting is entirely optional. # is automatically sent in this channel. This setting is entirely optional.
prefix: '#' message-prefix: '#'
announcements: announcements:
name: 'Announcements' name: 'Announcements'
formats: formats:
@@ -62,7 +62,7 @@ channels:
staff: '<gold>Broadcast: <yellow><message>' staff: '<gold>Broadcast: <yellow><message>'
ignorable: false ignorable: false
should-bungee: false should-bungee: false
prefix: '!' message-prefix: '!'
# Options: # Options:
# 'MiniMessage': https://github.com/KyoriPowered/adventure-docs/blob/feature/minimessage/source/minimessage.rst#the-components # 'MiniMessage': https://github.com/KyoriPowered/adventure-docs/blob/feature/minimessage/source/minimessage.rst#the-components