Player Avatar
The player avatar class represents an avatar for the purposes of player information packet. Every player will have a respective avatar that contains basic information about that player, such as their coordinates and how far to render other players.
Properties
The current known coordinate of the given player. The coordinate property will need to be updated for all players prior to computing player info packet for any of them.
Extended info repository, commonly referred to as "masks", will track everything relevant inside itself. Setting properties such as a spotanim would be done through this. The extendedInfo is also responsible for caching the non-temporary blocks, such as appearance and move speed.
Functions
Forces the resize range to range while disabling the auto resizing feature.
Gets the preferred resize range. This value represents the ideal number that player info will strive towards. If the value is Int.MAX_VALUE, resizing is disabled and getResizeRange is what is used as a constant.
Gets the current resize range. This variable might change over time.
Updates the previous cycle's coordinate to be the current cycle's coordinate. This is called at the end of the cycle, to prepare for the next cycle.
Sets the avatar as hidden (or unhidden, depending on hidden). When hidden via this function, no information is transmitted to the clients about this avatar. It is a hard-hiding function, unlike the one via appearance extended info, which strictly only hides client-side, but all clients still receive information about the client existing. The benefit to this function is that no plugins or RuneLite implementations can snoop on other players that are meant to be hidden. The downside, however, is that because the client has no knowledge of that specific avatar whatsoever, un-hiding while the player is moving is not as smooth as with the appearance variant, since it first appears as if the player teleported in.
Sets this avatar as high priority, meaning they will be rendered in large crowds if the size of the crowd causes the view range to decrease below the preferred range. As an example, a typical preferred range is 15 tiles, but if there's a large crowd of people around, it might drop down to say 5 tiles. If there's a player that has been marked as high priority 10 tiles away from us, they will still render to us if marked as high priority.
Sets the avatar as normal priority. This reverses the effects of setHighPriority.
Sets the preferred resize range, effectively how far to render players from. The preferred bit here means that it can resize down if there are too many players around.
Updates the current known coordinate of the given PlayerAvatar. This function must be called on each avatar before player info is computed.
Updates the world id for a given player. Whether a player renders to you is determined based on the player's distance to that world's render coord, as defined by PlayerInfo.