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