Search in sources :

Example 46 with PacketPlayOutPlayerInfo

use of net.minecraft.server.v1_14_R1.PacketPlayOutPlayerInfo in project DragonsOnline by UniverseCraft.

the class PlayerNPC116R3 method updateToTablist.

public void updateToTablist() {
    PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
    PacketPlayOutPlayerInfo.PlayerInfoData data = packet.new PlayerInfoData(this.handle.getProfile(), 0, EnumGamemode.NOT_SET, CraftChatMessage.fromString(ChatColor.BLACK + "" + ChatColor.DARK_GRAY + "NPC: " + ChatColor.stripColor(tablistName))[0]);
    @SuppressWarnings("unchecked") List<PacketPlayOutPlayerInfo.PlayerInfoData> players = (List<PacketPlayOutPlayerInfo.PlayerInfoData>) getField(packet, "b");
    players.add(data);
    this.setField(packet, "a", PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_DISPLAY_NAME);
    this.setField(packet, "b", players);
    this.sendPacket(packet);
}
Also used : List(java.util.List) ArrayList(java.util.ArrayList) PacketPlayOutPlayerInfo(net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo)

Aggregations

GameProfile (com.mojang.authlib.GameProfile)13 PacketPlayOutPlayerInfo (net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo)9 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)8 PacketPlayOutPlayerInfo (net.minecraft.server.v1_10_R1.PacketPlayOutPlayerInfo)6 PacketPlayOutPlayerInfo (net.minecraft.server.v1_11_R1.PacketPlayOutPlayerInfo)6 PacketPlayOutPlayerInfo (net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo)6 ArrayList (java.util.ArrayList)4 List (java.util.List)4 UUID (java.util.UUID)4 EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)4 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)4 PacketPlayOutPlayerInfo (net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo)4 PacketPlayOutPlayerInfo (net.minecraft.server.v1_13_R2.PacketPlayOutPlayerInfo)4 PacketPlayOutPlayerInfo (net.minecraft.server.v1_14_R1.PacketPlayOutPlayerInfo)4 PacketPlayOutPlayerInfo (net.minecraft.server.v1_15_R1.PacketPlayOutPlayerInfo)4 Player (org.bukkit.entity.Player)4 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)4 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)3 EntityPlayer (net.minecraft.server.v1_13_R2.EntityPlayer)3 EntityPlayer (net.minecraft.server.v1_14_R1.EntityPlayer)3