diff options
Diffstat (limited to 'src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java')
-rw-r--r-- | src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java b/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java index 3dd4c8d..ff31023 100644 --- a/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java @@ -26,6 +26,7 @@ import java.util.stream.Collectors; import net.elytrium.java.commons.mc.serialization.Serializer; import net.elytrium.limboauth.LimboAuth; import net.elytrium.limboauth.Settings; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; @@ -102,10 +103,10 @@ public class LimboAuthCommand implements SimpleCommand { if (command.equalsIgnoreCase("reload") && source.hasPermission("limboauth.admin.reload")) { try { this.plugin.reload(); - source.sendMessage(serializer.deserialize(Settings.IMP.MAIN.STRINGS.RELOAD)); + source.sendMessage(serializer.deserialize(Settings.IMP.MAIN.STRINGS.RELOAD), MessageType.SYSTEM); } catch (Exception e) { e.printStackTrace(); - source.sendMessage(serializer.deserialize(Settings.IMP.MAIN.STRINGS.RELOAD_FAILED)); + source.sendMessage(serializer.deserialize(Settings.IMP.MAIN.STRINGS.RELOAD_FAILED), MessageType.SYSTEM); } return; @@ -142,15 +143,17 @@ public class LimboAuthCommand implements SimpleCommand { } private void showHelp(CommandSource source) { - HELP_MESSAGE.forEach(source::sendMessage); + for (Component component : HELP_MESSAGE) { + source.sendMessage(component, MessageType.SYSTEM); + } List<Map.Entry<String, Component>> availableSubcommands = SUBCOMMANDS.entrySet().stream() .filter(command -> source.hasPermission("limboauth.admin." + command.getKey())) .collect(Collectors.toList()); if (availableSubcommands.size() > 0) { - source.sendMessage(AVAILABLE_SUBCOMMANDS_MESSAGE); - availableSubcommands.forEach(command -> source.sendMessage(command.getValue())); + source.sendMessage(AVAILABLE_SUBCOMMANDS_MESSAGE, MessageType.SYSTEM); + availableSubcommands.forEach(command -> source.sendMessage(command.getValue(), MessageType.SYSTEM)); } else { - source.sendMessage(NO_AVAILABLE_SUBCOMMANDS_MESSAGE); + source.sendMessage(NO_AVAILABLE_SUBCOMMANDS_MESSAGE, MessageType.SYSTEM); } } } |