PlatformAdapter

interface PlatformAdapter

Adapts platform-specific objects and operations to the BetterModel API.

This interface provides methods for retrieving players, creating items, and checking server state, abstracting away the differences between platforms like Bukkit and Fabric.

Since

2.0.0

Functions

Link copied to clipboard
@NotNull
abstract fun air(): @NotNull PlatformItemStack
Returns a platform-specific representation of an empty item stack (air).
Link copied to clipboard
abstract fun isRegionSafe(): Boolean
Checks if it is safe to access region data from the current thread.
Link copied to clipboard
abstract fun isTickThread(): Boolean
Checks if the current thread is the main server tick thread.
Link copied to clipboard
@NotNull
abstract fun offlinePlayer(@NotNull uuid: @NotNull UUID): @NotNull PlatformOfflinePlayer
Retrieves an offline player by their UUID.
Link copied to clipboard
@Nullable
abstract fun player(@NotNull uuid: @NotNull UUID): @Nullable PlatformPlayer
Retrieves an online player by their UUID.
Link copied to clipboard
abstract fun serverViewDistance(): Int
Returns the server's default view distance.
Link copied to clipboard
@NotNull
abstract fun zero(): @NotNull PlatformLocation
Returns a location at coordinates (0, 0, 0) in a default or null world.