Add support for custom channel aliases and improve string formatting consistency
This commit is contained in:
@@ -12,7 +12,6 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ChatChannel extends BukkitCommand {
|
||||
@@ -28,7 +27,7 @@ public class ChatChannel extends BukkitCommand {
|
||||
this.command = channel.getChannelName().toLowerCase();
|
||||
this.description = "Chat channel named " + channel.getChannelName() + ".";
|
||||
this.usageMessage = "/" + command + " <message>";
|
||||
this.setAliases(Collections.emptyList());
|
||||
this.setAliases(channel.getAliases());
|
||||
activeCommands.add(this);
|
||||
this.toggleableForCustomChannel = new ToggleableForCustomChannel(channel);
|
||||
}
|
||||
@@ -43,7 +42,7 @@ public class ChatChannel extends BukkitCommand {
|
||||
player.sendRichMessage(Config.CUSTOM_CHANNEL_TOGGLED, TagResolver.resolver(
|
||||
Placeholder.unparsed("channel", channel.getChannelName()),
|
||||
Placeholder.component("status", toggleableForCustomChannel.toggle(player.getUniqueId())
|
||||
? Config.TOGGLED_ON : Config.TOGGLED_OFF)));
|
||||
? Config.TOGGLED_ON : Config.TOGGLED_OFF)));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user