Skip to main content

Overview

The BetterModelPlatform interface represents the core platform abstraction for BetterModel. It provides access to configuration, managers, schedulers, and lifecycle operations like reloading. You typically access this interface through BetterModel.platform().

Package

Methods

Platform Information

dataFolder()

Returns the data folder for the BetterModel plugin where configuration files, data files, and other plugin-specific resources are stored.
Returns: File - The data folder as a File object Since: 2.0.0

jarType()

Returns the type of JAR file this platform is running on (e.g., SPIGOT, PAPER, FABRIC).
Returns: JarType - The JAR type enum representing the platform Since: 2.0.0 Example:

isSnapshot()

Checks if the running version of BetterModel is a snapshot build.
Returns: boolean - True if snapshot, false otherwise Since: 1.15.2

version()

Returns the Minecraft version of the running server.
Returns: MinecraftVersion - The Minecraft version Since: 1.15.2

semver()

Returns the semantic version of the platform.
Returns: Semver - The semantic version Since: 1.15.2

Configuration & Managers

config()

Returns the platform’s configuration manager.
Returns: BetterModelConfig - The configuration Since: 1.15.2

modelManager()

Returns the model manager for accessing and managing model renderers.
Returns: ModelManager - The model manager Since: 1.15.2

playerManager()

Returns the player manager for handling player-specific operations.
Returns: PlayerManager - The player manager Since: 1.15.2

scriptManager()

Returns the script manager for handling scripting operations.
Returns: ScriptManager - The script manager Since: 1.15.2

skinManager()

Returns the skin manager for handling entity skins.
Returns: SkinManager - The skin manager Since: 1.15.2

profileManager()

Returns the profile manager.
Returns: ProfileManager - The profile manager Since: 1.15.2

scheduler()

Returns the platform’s scheduler for task scheduling.
Returns: ModelScheduler - The scheduler Since: 1.15.2

adapter()

Returns the platform’s adapter for platform-specific operations.
Returns: PlatformAdapter - The adapter

NMS & Low-Level Access

nms()

Returns the NMS (Net.Minecraft.Server) handler for version-specific operations.
Returns: NMS - The NMS handler Since: 1.15.2

Utilities

logger()

Returns the platform’s logger.
Returns: BetterModelLogger - The logger Since: 1.15.2

evaluator()

Returns the expression evaluator for evaluating dynamic expressions.
Returns: BetterModelEvaluator - The evaluator Since: 1.15.2

eventBus()

Returns the event bus for registering and handling events.
Returns: BetterModelEventBus - The event bus Since: 2.0.0

getResource()

Retrieves a resource from the platform’s JAR file.
String
required
The path to the resource
Returns: InputStream - An input stream for the resource, or null if not found Since: 1.15.2

Reload Operations

reload()

Reloads the platform with default settings (console sender).
Returns: ReloadResult - The result of the reload operation Since: 2.0.0

reload(Audience)

Reloads the platform, specifying the command sender who initiated it.
Audience
required
The command sender who initiated the reload
Returns: ReloadResult - The result of the reload operation Since: 1.15.2

reload(ReloadInfo)

Reloads the platform with specific reload information.
ReloadInfo
required
The reload configuration
Returns: ReloadResult - The result of the reload operation Since: 1.15.2 Example:

addReloadStartHandler()

Registers a handler to be executed when a reload starts.
Consumer<PackZipper>
required
The handler, receiving the PackZipper
Since: 1.15.2

addReloadEndHandler()

Registers a handler to be executed when a reload ends.
Consumer<ReloadResult>
required
The handler, receiving the ReloadResult
Since: 1.15.2

Nested Types

ReloadResult

Represents the outcome of a platform reload operation.

ReloadResult.Success

Indicates a successful reload.
boolean
True if this is the first load (startup), false otherwise
long
The time taken to reload assets in milliseconds
PackResult
The result of the resource pack generation
Methods:
  • packingTime() - Returns the time taken to generate the resource pack
  • totalTime() - Returns the total time taken for the reload operation
  • length() - Returns the size of the generated resource pack in bytes
Since: 1.15.2

ReloadResult.OnReload

Indicates that a reload is currently in progress.
Since: 1.15.2

ReloadResult.Failure

Indicates a failed reload.
Throwable
The exception that caused the failure
Since: 1.15.2

JarType

Represents the type of JAR file the platform is running on.
Values:
  • SPIGOT - Indicates a Spigot-based server
  • PAPER - Indicates a Paper-based server
  • FABRIC - Indicates a Fabric-based server
Methods:
  • raw() - Returns the raw string representation (e.g., “spigot”, “paper”, “fabric”)
Since: 2.0.0

Complete Example

See Also