Block just console execution, not everything but console senders

This commit is contained in:
onebeastchris 2023-09-18 15:35:06 +02:00
parent 4bf2a4303a
commit c75c5b4fb9
1 changed files with 2 additions and 2 deletions

View File

@ -39,13 +39,13 @@ public class PingCommand extends GeyserCommand {
@Override @Override
public void execute(GeyserSession session, GeyserCommandSource sender, String[] args) { public void execute(GeyserSession session, GeyserCommandSource sender, String[] args) {
if (!sender.isConsole()) { if (sender.isConsole()) {
return; return;
} }
RakSessionCodec rakSessionCodec = ((RakChildChannel) session.getUpstream().getSession().getPeer().getChannel()).rakPipeline().get(RakSessionCodec.class); RakSessionCodec rakSessionCodec = ((RakChildChannel) session.getUpstream().getSession().getPeer().getChannel()).rakPipeline().get(RakSessionCodec.class);
//todo lang strings // todo lang strings
sender.sendMessage("Your ping is: " + ChatColor.BOLD + rakSessionCodec.getPing() + ChatColor.RESET + "ms."); sender.sendMessage("Your ping is: " + ChatColor.BOLD + rakSessionCodec.getPing() + ChatColor.RESET + "ms.");
sender.sendMessage("Your RTT is: §7" + ChatColor.BOLD + rakSessionCodec.getRTT() + ChatColor.RESET + "ms."); sender.sendMessage("Your RTT is: §7" + ChatColor.BOLD + rakSessionCodec.getRTT() + ChatColor.RESET + "ms.");
} }