use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project FireAPI by FireBlade-Serv.
the class PingCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
int ping = ((CraftPlayer) p).getHandle().ping;
p.sendMessage("§6[§ePing§6]§r Ton ping §eserveur§r est de §e" + ping + " ms§r !");
try {
c.sendPacket(new PacketPlayerPing(p.getName(), PingState.INIT_SERVER));
} catch (IOException e) {
e.printStackTrace();
}
} else {
sender.sendMessage("§6[§ePing§6]§r §cErreur, vous devez être en jeu pour pouvoir executer cette commande !");
}
return false;
}
use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project FireAPI by FireBlade-Serv.
the class FireBukkitActionBar method send.
public void send(String message) {
IChatBaseComponent cbc = ChatSerializer.a("{\"text\": \"" + message + "\"}");
PacketPlayOutChat ppoc = new PacketPlayOutChat(cbc, (byte) 2);
((CraftPlayer) this.player).getHandle().playerConnection.sendPacket(ppoc);
}
use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project Citizens2 by CitizensDev.
the class NMSImpl method sendTabListAdd.
@Override
public void sendTabListAdd(Player recipient, Player listPlayer) {
Preconditions.checkNotNull(recipient);
Preconditions.checkNotNull(listPlayer);
EntityPlayer entity = ((CraftPlayer) listPlayer).getHandle();
NMSImpl.sendPacket(recipient, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entity));
}
use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project Citizens2 by CitizensDev.
the class NMSImpl method sendTabListRemove.
@Override
public void sendTabListRemove(Player recipient, Player listPlayer) {
Preconditions.checkNotNull(recipient);
Preconditions.checkNotNull(listPlayer);
EntityPlayer entity = ((CraftPlayer) listPlayer).getHandle();
NMSImpl.sendPacket(recipient, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, entity));
}
use of org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer in project Citizens2 by CitizensDev.
the class NMSImpl method sendTabListAdd.
@Override
public void sendTabListAdd(Player recipient, Player listPlayer) {
Preconditions.checkNotNull(recipient);
Preconditions.checkNotNull(listPlayer);
EntityPlayer entity = ((CraftPlayer) listPlayer).getHandle();
NMSImpl.sendPacket(recipient, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entity));
}
Aggregations