WorldEntityAvatar

class WorldEntityAvatar(allocator: ByteBufAllocator, zoneIndexStorage: ZoneIndexStorage, index: Int, sizeX: Int, sizeZ: Int, level: Int, currentCoordFine: CoordFine = CoordFine.INVALID, angle: Int) : Avatar

A world entity avatar represents a dynamic world entity as a single unit.

Constructors

Link copied to clipboard
constructor(allocator: ByteBufAllocator, zoneIndexStorage: ZoneIndexStorage, index: Int, sizeX: Int, sizeZ: Int, level: Int, currentCoordFine: CoordFine = CoordFine.INVALID, angle: Int)

Functions

Link copied to clipboard
open override fun postUpdate()

Handles any changes to be done to the avatar post its update. This will clean up any extended info blocks and update the last coordinate to match up with the current (set earlier in the cycle).

Link copied to clipboard
fun updateAngle(angle: Int)

Updates the current angle of this world entity. It should be noted that the client is only made to rotate by a maximum of 22.5 degrees (128/2048 units) per game cycle, so it may take multiple seconds for it to finish the turn.

Link copied to clipboard
fun updateCoord(level: Int, fineX: Int, fineY: Int, fineZ: Int, teleport: Boolean)

Updates the current coordinate of this world entity, along with a move speed to reach that coordinate, if applicable.