mirror of
https://github.com/kaboomserver/extras.git
synced 2024-06-03 02:41:23 +00:00
No longer use CraftBukkit to get the player's ping, and instead use the Player's spigot object.
This commit is contained in:
parent
591fd42908
commit
eef7c55b38
7
pom.xml
7
pom.xml
|
@ -22,13 +22,6 @@
|
|||
<artifactId>ProtocolLib</artifactId>
|
||||
<version>4.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/tools/craftbukkit.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
|
|
|
@ -4,14 +4,13 @@ import org.bukkit.ChatColor;
|
|||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public final class CommandPing implements CommandExecutor {
|
||||
|
||||
public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) {
|
||||
final Player player = (Player) sender;
|
||||
final int ping = ((CraftPlayer) player).getHandle().playerConnection.player.ping;
|
||||
final int ping = player.spigot().getPing();
|
||||
final int d = (int) Math.floor(ping / 100);
|
||||
ChatColor highlighting = ChatColor.WHITE;
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue