appendHighResolutionIndices

fun <T : MutableCollection<Int>> appendHighResolutionIndices(worldId: Int, collection: T, throwExceptionIfNoWorld: Boolean = true): T

Appends the high resolution indices of the given worldId to the provided collection. This can be used to determine which NPCs the player is currently seeing in the client. Servers often rely on this metric to determine things such as aggression/hunt.

Return

the provided collection to chaining.

Parameters

worldId

the worldId to collect the indices from. For root world, use ROOT_WORLD.

collection

the mutable collection of integer indices to append the indices into.

throwExceptionIfNoWorld

whether to throw an exception if the world does not exist.

Throws

if the world id is not in range of 0..<2048, or ROOT_WORLD, as long as throwExceptionIfNoWorld is true.

if the provided world has not been allocated. It is up to the caller to ensure the world they're accessible is available. Root world will always be available as long as the given info object is allocated. This will only be thrown if throwExceptionIfNoWorld is true.