Overview
TheBetterModelPlatform 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.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).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.boolean - True if snapshot, false otherwise
Since: 1.15.2
version()
Returns the Minecraft version of the running server.MinecraftVersion - The Minecraft version
Since: 1.15.2
semver()
Returns the semantic version of the platform.Semver - The semantic version
Since: 1.15.2
Configuration & Managers
config()
Returns the platform’s configuration manager.BetterModelConfig - The configuration
Since: 1.15.2
modelManager()
Returns the model manager for accessing and managing model renderers.ModelManager - The model manager
Since: 1.15.2
playerManager()
Returns the player manager for handling player-specific operations.PlayerManager - The player manager
Since: 1.15.2
scriptManager()
Returns the script manager for handling scripting operations.ScriptManager - The script manager
Since: 1.15.2
skinManager()
Returns the skin manager for handling entity skins.SkinManager - The skin manager
Since: 1.15.2
profileManager()
Returns the profile manager.ProfileManager - The profile manager
Since: 1.15.2
scheduler()
Returns the platform’s scheduler for task scheduling.ModelScheduler - The scheduler
Since: 1.15.2
adapter()
Returns the platform’s adapter for platform-specific operations.PlatformAdapter - The adapter
NMS & Low-Level Access
nms()
Returns the NMS (Net.Minecraft.Server) handler for version-specific operations.NMS - The NMS handler
Since: 1.15.2
Utilities
logger()
Returns the platform’s logger.BetterModelLogger - The logger
Since: 1.15.2
evaluator()
Returns the expression evaluator for evaluating dynamic expressions.BetterModelEvaluator - The evaluator
Since: 1.15.2
eventBus()
Returns the event bus for registering and handling events.BetterModelEventBus - The event bus
Since: 2.0.0
getResource()
Retrieves a resource from the platform’s JAR file.The path to the resource
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).ReloadResult - The result of the reload operation
Since: 2.0.0
reload(Audience)
Reloads the platform, specifying the command sender who initiated it.The command sender who initiated the reload
ReloadResult - The result of the reload operation
Since: 1.15.2
reload(ReloadInfo)
Reloads the platform with specific reload information.The reload configuration
ReloadResult - The result of the reload operation
Since: 1.15.2
Example:
addReloadStartHandler()
Registers a handler to be executed when a reload starts.The handler, receiving the PackZipper
addReloadEndHandler()
Registers a handler to be executed when a reload ends.The handler, receiving the ReloadResult
Nested Types
ReloadResult
Represents the outcome of a platform reload operation.ReloadResult.Success
Indicates a successful reload.True if this is the first load (startup), false otherwise
The time taken to reload assets in milliseconds
The result of the resource pack generation
packingTime()- Returns the time taken to generate the resource packtotalTime()- Returns the total time taken for the reload operationlength()- Returns the size of the generated resource pack in bytes
ReloadResult.OnReload
Indicates that a reload is currently in progress.ReloadResult.Failure
Indicates a failed reload.The exception that caused the failure
JarType
Represents the type of JAR file the platform is running on.SPIGOT- Indicates a Spigot-based serverPAPER- Indicates a Paper-based serverFABRIC- Indicates a Fabric-based server
raw()- Returns the raw string representation (e.g., “spigot”, “paper”, “fabric”)
Complete Example
See Also
- BetterModel - Main API entry point
- BetterModelConfig - Configuration interface
