mirror of https://github.com/GeyserMC/Geyser.git
Use RTT as that seems to vary less wildly compared to getPing()
This commit is contained in:
parent
c75c5b4fb9
commit
d62470b408
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue