Fix MsgCommand being able to /r to offline players

This commit is contained in:
2025-04-16 13:42:31 +02:00
parent 866c376ee5
commit 9da1de9b6c
@@ -20,6 +20,8 @@
package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.proxy.Velocity;
import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.listeners.ChatListener;
import de.steamwar.command.SWCommand;
import de.steamwar.messages.Chatter;
@@ -41,7 +43,7 @@ public class MsgCommand extends SWCommand {
}
public static void msg(PlayerChatter sender, Player target, String[] args) {
if(target == null || target.getCurrentServer().isEmpty()) {
if(target == null || VelocityCore.getProxy().getPlayer(target.getUniqueId()).orElse(null) == null) {
sender.system("MSG_OFFLINE");
return;
}