mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
Use keys instead of names when possible
This commit is contained in:
1 parent
9b9ca554e4
commit
22a068ff09
6 files changed
+28
-10
No files matched your search
@@ -26,7 +26,7 @@ public class CommandManager {
|
||||
|
||||
for (ChatChannel chatChannel : carbonChat.getChannelManager().getRegistry().values()) {
|
||||
if (chatChannel.canPlayerUse(user)) {
|
||||
completions.add(chatChannel.getName());
|
||||
completions.add(chatChannel.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CommandManager {
|
||||
List<String> completions = new ArrayList<>();
|
||||
|
||||
for (ChatChannel chatChannel : carbonChat.getChannelManager().getRegistry().values()) {
|
||||
completions.add(chatChannel.getName());
|
||||
completions.add(chatChannel.getKey());
|
||||
}
|
||||
|
||||
return completions;
|
||||
@@ -47,7 +47,7 @@ public class CommandManager {
|
||||
String name = context.popFirstArg();
|
||||
|
||||
for (ChatChannel chatChannel : carbonChat.getChannelManager().getRegistry().values()) {
|
||||
if (chatChannel.getName().equalsIgnoreCase(name)) {
|
||||
if (chatChannel.getKey().equalsIgnoreCase(name)) {
|
||||
return chatChannel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user