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.ChannelIdentifier;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.MiniMessage;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -122,7 +121,8 @@ public class AuthMeVelocityPlugin {
public void sendInfoMessage() { public void sendInfoMessage() {
CommandSource source = proxy.getConsoleCommandSource(); CommandSource source = proxy.getConsoleCommandSource();
source.sendMessage(Component.text("-- AuthMeVelocity enabled --")); source.sendMessage(MiniMessage.miniMessage().deserialize(
" <gray>--- <aqua>AuthMeVelocity</aqua> ---"));
source.sendMessage(MiniMessage.miniMessage().deserialize( source.sendMessage(MiniMessage.miniMessage().deserialize(
"<gray>AuthServers: <green>" + config.getAuthServers())); "<gray>AuthServers: <green>" + config.getAuthServers()));
if (config.getToServerOptions().sendToServer()) { 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.CommandMeta;
import com.velocitypowered.api.command.CommandSource; import com.velocitypowered.api.command.CommandSource;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.format.NamedTextColor;
public class AuthmeCommand { public class AuthmeCommand {
private AuthmeCommand() {} private AuthmeCommand() {}
@ -23,10 +22,11 @@ public class AuthmeCommand {
CommandSource source = cmd.getSource(); CommandSource source = cmd.getSource();
if (plugin.reload()) { if (plugin.reload()) {
plugin.sendInfoMessage(); 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 { } else {
source.sendMessage(Component.text( source.sendMessage(MiniMessage.miniMessage().deserialize(
"There was an error while reloading the configuration. Check the server console", NamedTextColor.DARK_RED)); "<dark_red>There was an error while reloading the configuration. <red>Check the server console"));
} }
return Command.SINGLE_SUCCESS; return Command.SINGLE_SUCCESS;
}) })