use of net.minecraft.server.v1_13_R2.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);
}
Aggregations