feat: Update join/leave messages for Velocity network
LoHub: - Changed join message to 'connected to hub' (Russian) - Changed quit message to 'left' (Russian) - Messages show only on actual join/leave, not server switches LoVelocity: - Added ServerSwitchListener - Velocity handles server switches silently - Backend servers (LoHub) show join/leave messages Result: Clean join/leave messages across the network
This commit is contained in:
parent
1e5e8d8638
commit
3ba41c18e7
3 changed files with 39 additions and 2 deletions
|
|
@ -38,6 +38,7 @@ public class LoVelocity {
|
|||
logger.info("Version: 1.5.5");
|
||||
|
||||
registerCommands();
|
||||
registerListeners();
|
||||
}
|
||||
|
||||
private void registerCommands() {
|
||||
|
|
@ -51,6 +52,11 @@ public class LoVelocity {
|
|||
logger.info("Commands registered: /hub, /lobby");
|
||||
}
|
||||
|
||||
private void registerListeners() {
|
||||
server.getEventManager().register(this, new com.loki.lovelocity.listeners.ServerSwitchListener(this));
|
||||
logger.info("Listeners registered");
|
||||
}
|
||||
|
||||
public ProxyServer getServer() {
|
||||
return server;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.loki.lovelocity.listeners;
|
||||
|
||||
import com.loki.lovelocity.LoVelocity;
|
||||
import com.velocitypowered.api.event.PostOrder;
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.connection.DisconnectEvent;
|
||||
import com.velocitypowered.api.event.player.ServerConnectedEvent;
|
||||
|
||||
public class ServerSwitchListener {
|
||||
|
||||
private final LoVelocity plugin;
|
||||
|
||||
public ServerSwitchListener(LoVelocity plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Subscribe(order = PostOrder.LAST)
|
||||
public void onServerConnected(ServerConnectedEvent event) {
|
||||
// Velocity doesn't show join/leave messages by default
|
||||
// They are handled by backend servers (Paper/Spigot)
|
||||
}
|
||||
|
||||
@Subscribe(order = PostOrder.LAST)
|
||||
public void onDisconnect(DisconnectEvent event) {
|
||||
// Velocity doesn't show join/leave messages by default
|
||||
// They are handled by backend servers (Paper/Spigot)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue