Refactor config reload and server name handling.

Replaced inconsistent `ReloadConfig` usage with `reloadConfig` across the codebase for better naming consistency. Introduced `ServerName` utility to standardize server name retrieval and improve maintainability. Added logging enhancements for better debugging of muted users and blocked messages.
This commit is contained in:
2025-03-21 22:55:57 +01:00
parent f1b8af6136
commit 5212954946
10 changed files with 87 additions and 33 deletions
@@ -24,7 +24,6 @@ import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.plugin.Dependency;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ConsoleCommandSource;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
@@ -83,9 +82,9 @@ public class VelocityChat {
ChatUserManager.addUser(console);
}
public void ReloadConfig() {
chatAPI.ReloadConfig();
chatAPI.ReloadChatFilters();
public void reloadConfig() {
chatAPI.reloadConfig();
chatAPI.reloadChatFilters();
serverHandler.cleanup();
ByteArrayDataOutput buf = ByteStreams.newDataOutput();
buf.writeUTF("reloadconfig");
@@ -15,7 +15,7 @@ public class Reload {
.<CommandSource>literal("reloadchat")
.requires(ctx -> ctx.hasPermission("command.chat.reloadchat"))
.executes(context -> {
VelocityChat.getPlugin().ReloadConfig();
VelocityChat.getPlugin().reloadConfig();
return 1;
})
.build();