Package dev.booky.betterview.api
Interface BvManager
@NullMarked
public interface BvManager
Exposes a thread-safe API for getting
player states and dimension states managed by BetterView.
-
Method Summary
Modifier and TypeMethodDescriptiongetLevel(net.kyori.adventure.key.Key dimensionName) This method will always return a level instance and may create a new one if none exists.default BvPlayer@Nullable BvPlayergetPlayerOrNull(UUID playerId) This method will always return a player instance if the player is currently connected to the platform and may create a new one if the player doesn't exist yet.booleanhasLevel(net.kyori.adventure.key.Key dimensionName)
-
Method Details
-
hasLevel
boolean hasLevel(net.kyori.adventure.key.Key dimensionName) - Returns:
- whether BetterView has encountered a player with the specified dimension name before.
-
getLevel
This method will always return a level instance and may create a new one if none exists.- Parameters:
dimensionName- the namespaced name of the level (e.g. "minecraft:overworld")- Returns:
- the level managed by BetterView.
- Throws:
IllegalArgumentException- if the level can't be found
-
getPlayerOrNull
This method will always return a player instance if the player is currently connected to the platform and may create a new one if the player doesn't exist yet.- Parameters:
playerId- theUUIDof the Minecraft player profile.- Returns:
- the player managed by BetterView or null if the player doesn't exist on the platform.
-
getPlayer
- Throws:
IllegalArgumentException- ifgetPlayerOrNull(UUID)returns null.- See Also:
-