Use RTT as that seems to vary less wildly compared to getPing()

This commit is contained in:
onebeastchris 2023-09-18 15:39:23 +02:00
parent c75c5b4fb9
commit d62470b408
1 changed files with 1 additions and 4 deletions

View File

@ -30,7 +30,6 @@ import org.cloudburstmc.netty.handler.codec.raknet.common.RakSessionCodec;
import org.geysermc.geyser.command.GeyserCommand;
import org.geysermc.geyser.command.GeyserCommandSource;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.ChatColor;
public class PingCommand extends GeyserCommand {
public PingCommand(String name, String description, String permission) {
@ -45,9 +44,7 @@ public class PingCommand extends GeyserCommand {
RakSessionCodec rakSessionCodec = ((RakChildChannel) session.getUpstream().getSession().getPeer().getChannel()).rakPipeline().get(RakSessionCodec.class);
// todo lang strings
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 ping is: §7" + (int) Math.floor(rakSessionCodec.getRTT()) + " ms.");
}
@Override