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 Details

    • getExecutor

      @Contract(pure=true) BvExecutor 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

      @Contract(pure=true) BvLevel getLevel()
      Returns:
      the level the player is currently in.
    • getChunkLifecycle

      @Contract(pure=true) ChunkLifecycle getChunkLifecycle(int chunkX, int chunkZ)
      Not thread-safe.
      Returns:
      the lifecycle of the specified chunk position.
    • refreshChunk

      void refreshChunk(int chunkX, int chunkZ) throws IllegalStateException
      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 (see ChunkLifecycle.isOwned()).