From 14f38046e7d7c335871f9f3f67f87ecca2a50fa8 Mon Sep 17 00:00:00 2001 From: 4drian3d Date: Wed, 27 Jul 2022 16:52:04 +0000 Subject: [PATCH] feat: Improved reload messages --- .../authmevelocity/proxy/AuthMeVelocityPlugin.java | 4 ++-- .../authmevelocity/proxy/commands/AuthmeCommand.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthMeVelocityPlugin.java b/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthMeVelocityPlugin.java index bc92f02..4c6c6ad 100644 --- a/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthMeVelocityPlugin.java +++ b/proxy/src/main/java/com/glyart/authmevelocity/proxy/AuthMeVelocityPlugin.java @@ -15,7 +15,6 @@ import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.messages.ChannelIdentifier; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; -import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; import org.slf4j.Logger; @@ -122,7 +121,8 @@ public class AuthMeVelocityPlugin { public void sendInfoMessage() { CommandSource source = proxy.getConsoleCommandSource(); - source.sendMessage(Component.text("-- AuthMeVelocity enabled --")); + source.sendMessage(MiniMessage.miniMessage().deserialize( + " --- AuthMeVelocity ---")); source.sendMessage(MiniMessage.miniMessage().deserialize( "AuthServers: " + config.getAuthServers())); if (config.getToServerOptions().sendToServer()) { diff --git a/proxy/src/main/java/com/glyart/authmevelocity/proxy/commands/AuthmeCommand.java b/proxy/src/main/java/com/glyart/authmevelocity/proxy/commands/AuthmeCommand.java index 106cf6e..676225a 100644 --- a/proxy/src/main/java/com/glyart/authmevelocity/proxy/commands/AuthmeCommand.java +++ b/proxy/src/main/java/com/glyart/authmevelocity/proxy/commands/AuthmeCommand.java @@ -9,8 +9,7 @@ import com.velocitypowered.api.command.CommandManager; import com.velocitypowered.api.command.CommandMeta; import com.velocitypowered.api.command.CommandSource; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.format.NamedTextColor; +import net.kyori.adventure.text.minimessage.MiniMessage; public class AuthmeCommand { private AuthmeCommand() {} @@ -23,10 +22,11 @@ public class AuthmeCommand { CommandSource source = cmd.getSource(); if (plugin.reload()) { plugin.sendInfoMessage(); - source.sendMessage(Component.text("AuthmeVelocity has been successfully reloaded", NamedTextColor.GREEN)); + source.sendMessage(MiniMessage.miniMessage().deserialize( + "AuthmeVelocity has been successfully reloaded")); } else { - source.sendMessage(Component.text( - "There was an error while reloading the configuration. Check the server console", NamedTextColor.DARK_RED)); + source.sendMessage(MiniMessage.miniMessage().deserialize( + "There was an error while reloading the configuration. Check the server console")); } return Command.SINGLE_SUCCESS; })