Colored toggle word, improved default party online/offline marker

This commit is contained in:
Teriuihi 2022-05-30 19:27:47 +02:00
parent 679602c1f7
commit 82eecc3142
3 changed files with 10 additions and 6 deletions

View File

@ -325,8 +325,8 @@ public final class Config {
DISBANDED_PARTY = getString("party.messages.disbanded-party", DISBANDED_PARTY);
PARTY_INFO = getString("party.messages.party-info", PARTY_INFO);
ALREADY_IN_THIS_PARTY = getString("party.messages.already-in-this-party", ALREADY_IN_THIS_PARTY);
ONLINE_PREFIX = Utility.parseMiniMessage(getString("party.messages.online-prefix", "<green>■ </green>"));
OFFLINE_PREFIX = Utility.parseMiniMessage(getString("party.messages.offline-prefix", "<red>■ </red>"));
ONLINE_PREFIX = Utility.parseMiniMessage(getString("party.messages.online-prefix", "<green>■</green>"));
OFFLINE_PREFIX = Utility.parseMiniMessage(getString("party.messages.offline-prefix", "<red>■</red>"));
PARTY_TOGGLED = getString("party.messages.party-toggled", PARTY_TOGGLED);
}
@ -360,6 +360,8 @@ public final class Config {
}
public static String CUSTOM_CHANNEL_TOGGLED = "<yellow>Toggled <channel> <status>.</yellow>";
public static Component TOGGLED_ON = null;
public static Component TOGGLED_OFF = null;
private static void chatChannels() {
ConfigurationNode node = getNode("chat-channels");
if (node.empty()) {
@ -379,6 +381,8 @@ public final class Config {
}
CUSTOM_CHANNEL_TOGGLED = getString("chat-channels-messages.channel-toggled", CUSTOM_CHANNEL_TOGGLED);
TOGGLED_ON = Utility.parseMiniMessage(getString("party.messages.online-prefix", "<green>on</green><gray>"));
TOGGLED_OFF = Utility.parseMiniMessage(getString("party.messages.offline-prefix", "<red>off</red><gray>"));
}
public static String SERVERMUTEPERMISSION = "chat.command.mute-server";

View File

@ -40,8 +40,8 @@ public class ChatChannel extends BukkitCommand {
if(args.length == 0) {
player.sendMiniMessage(Config.PARTY_TOGGLED, TagResolver.resolver(
Placeholder.unparsed("channel", channel.getChannelName()),
Placeholder.unparsed("status", toggleableForCustomChannel.toggle(player.getUniqueId())
? "<green>on</green>" : "<red>off</red>")));
Placeholder.component("status", toggleableForCustomChannel.toggle(player.getUniqueId())
? Config.TOGGLED_ON : Config.TOGGLED_OFF)));
return false;
}

View File

@ -26,8 +26,8 @@ public class PartyChat extends Toggleable implements CommandExecutor {
}
if(args.length == 0) {
player.sendMiniMessage(Config.PARTY_TOGGLED, Placeholder.unparsed("status",
toggle(player.getUniqueId()) ? "<green>on</green>" : "<red>off</red>"));
player.sendMiniMessage(Config.PARTY_TOGGLED, Placeholder.component("status",
toggle(player.getUniqueId()) ? Config.TOGGLED_ON : Config.TOGGLED_OFF));
return true;
}