PlayerAvatar

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

Link copied to clipboard
var currentCoord: CoordGrid

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.

Link copied to clipboard

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

Link copied to clipboard
open override fun postUpdate()

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.

Link copied to clipboard
fun setHidden(hidden: Boolean)
Link copied to clipboard
Link copied to clipboard
fun updateCoord(level: Int, x: Int, z: Int)

Updates the current known coordinate of the given PlayerAvatar. This function must be called on each avatar before player info is computed.