feat: Improved reload messages

This commit is contained in:
4drian3d 2022-07-27 16:52:04 +00:00
parent ec93099691
commit 14f38046e7
2 changed files with 7 additions and 7 deletions

View File

@ -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(
" <gray>--- <aqua>AuthMeVelocity</aqua> ---"));
source.sendMessage(MiniMessage.miniMessage().deserialize(
"<gray>AuthServers: <green>" + config.getAuthServers()));
if (config.getToServerOptions().sendToServer()) {

View File

@ -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(
"<aqua>AuthmeVelocity <green>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(
"<dark_red>There was an error while reloading the configuration. <red>Check the server console"));
}
return Command.SINGLE_SUCCESS;
})