Package dev.booky.betterview.api
Interface BvPlayer
@NullMarked
public interface BvPlayer
Mostly thread-unsafe API for accessing data stored about
a player which is managed by BetterView.
Please see each methods individual Javadoc for more info on thread-safety.
Methods which are marked as thread unsafe will need to be run using the executor
returned by getExecutor().
-
Method Summary
Modifier and TypeMethodDescriptiongetChunkLifecycle(int chunkX, int chunkZ) Not thread-safe.getLevel()booleanisActive()voidrefreshChunk(int chunkX, int chunkZ) Not thread-safe.
-
Method Details
-
getExecutor
- Returns:
- the executor which will need to be used to safely access
other methods of this
BvPlayer.
-
isActive
@Contract(pure=true) boolean isActive()- Returns:
- whether this player is currently ticked by BetterView (e.g. false when entering a dimension which is disabled in BetterView's config).
-
getLevel
- Returns:
- the level the player is currently in.
-
getChunkLifecycle
Not thread-safe.- Returns:
- the lifecycle of the specified chunk position.
-
refreshChunk
Not thread-safe.Queues the specified chunk for resending. This may or may not cause the current chunk sending queue to be re-ordered.
Please note that this method does not invalidate the per-dimension chunk cache, so the chunk may still be outdated after a refresh. See
BvLevel.invalidateChunkCache(int, int)for invalidating the cache of a specific chunk.- Throws:
IllegalStateException- if the chunk is currently NOT managed by BetterView (seeChunkLifecycle.isOwned()).
-