Interface BetterModelPlatform
- All Superinterfaces:
ModelEventApplication
Represents the main platform interface for BetterModel.
This interface provides access to core engine managers, schedulers, adapters, configuration, NMS interfaces, and event bus systems across supported server platforms.
Example usage:
BetterModelPlatform platform = BetterModel.platform();
ModelScheduler scheduler = platform.scheduler();
BetterModelConfig config = platform.config();
- Since:
- 1.15.2
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumRepresents the type of JAR file the platform is running on.static interfaceRepresents the outcome of a platform reload operation. -
Method Summary
Modifier and TypeMethodDescription@NotNull PlatformAdapteradapter()Returns the platform-specific entity and component adapter.voidaddReloadEndHandler(@NotNull Consumer<BetterModelPlatform.ReloadResult> consumer) Registers a handler to be executed when a reload ends.voidaddReloadStartHandler(@NotNull Consumer<PackZipper> consumer) Registers a handler to be executed when a reload starts.@NotNull BetterModelConfigconfig()Returns the platform's configuration manager.@NotNull FileReturns the data folder for the BetterModel plugin.@NotNull BetterModelEvaluatorReturns the expression evaluator.@NotNull BetterModelEventBuseventBus()Returns the event bus.@Nullable InputStreamgetResource(@NotNull String path) Retrieves a resource from the platform's JAR file.booleanChecks if the running version of BetterModel is a snapshot build.@NotNull BetterModelPlatform.JarTypejarType()Returns the type of JAR file this platform is running on (e.g., SPIGOT, PAPER, FABRIC).@NotNull BetterModelLoggerlogger()Returns the platform's logger.<T extends Manager>
TGets the specified manager instance.default @NotNull ModelManagerDeprecated.use BetterModelPlatform#manager instead.@NotNull NMSnms()Returns the NMS (Net.Minecraft.Server) handler for version-specific operations.default @NotNull PlayerManagerDeprecated.use BetterModelPlatform#manager instead.default @NotNull ProfileManagerDeprecated.use BetterModelPlatform#manager instead.default @NotNull BetterModelPlatform.ReloadResultreload()Reloads the platform with default settings (console sender).@NotNull BetterModelPlatform.ReloadResultreload(@NotNull ReloadInfo info) Reloads the platform with specific reload information.default @NotNull BetterModelPlatform.ReloadResultreload(@NotNull net.kyori.adventure.audience.Audience sender) Reloads the platform, specifying the command sender who initiated it.@NotNull ModelSchedulerReturns the platform's scheduler.default @NotNull ScriptManagerDeprecated.use BetterModelPlatform#manager instead.@NotNull org.semver4j.Semversemver()Returns the semantic version of the platform.default @NotNull SkinManagerDeprecated.use BetterModelPlatform#manager instead.@NotNull MinecraftVersionversion()Returns the Minecraft version of the running server.Methods inherited from interface ModelEventApplication
isEnabled
-
Method Details
-
dataFolder
-
jarType
Returns the type of JAR file this platform is running on (e.g., SPIGOT, PAPER, FABRIC).- Returns:
- the
BetterModelPlatform.JarTypeenum representing the platform's JAR type. - Since:
- 2.0.0
-
reload
Reloads the platform with default settings (console sender).- Returns:
- the result of the reload operation
- Since:
- 2.0.0
-
reload
@NotNull default @NotNull BetterModelPlatform.ReloadResult reload(@NotNull @NotNull net.kyori.adventure.audience.Audience sender) Reloads the platform, specifying the command sender who initiated it.- Parameters:
sender- the command sender- Returns:
- the result of the reload operation
- Since:
- 1.15.2
-
reload
Reloads the platform with specific reload information.- Parameters:
info- the reload configuration- Returns:
- the result of the reload operation
- Since:
- 1.15.2
-
isSnapshot
boolean isSnapshot()Checks if the running version of BetterModel is a snapshot build.- Returns:
- true if snapshot, false otherwise
- Since:
- 1.15.2
-
config
Returns the platform's configuration manager.- Returns:
- the configuration
- Since:
- 1.15.2
-
version
Returns the Minecraft version of the running server.- Returns:
- the Minecraft version
- Since:
- 1.15.2
-
semver
@NotNull @NotNull org.semver4j.Semver semver()Returns the semantic version of the platform.- Returns:
- the semantic version
- Since:
- 1.15.2
-
nms
Returns the NMS (Net.Minecraft.Server) handler for version-specific operations.- Returns:
- the NMS handler
- Since:
- 1.15.2
-
manager
Gets the specified manager instance. All separately existing manager getters have been refactored into this single method. Use this method to access any manager.Example:
ModelManager modelManager = platform.manager(ModelManager.class);- Type Parameters:
T- the type of the manager- Parameters:
managerClass- the class of the manager to retrieve- Returns:
- the manager instance
- Since:
- 3.3.0
-
modelManager
Deprecated.use BetterModelPlatform#manager instead.Returns the model manager.- Returns:
- the model manager
- Since:
- 1.15.2
-
playerManager
Deprecated.use BetterModelPlatform#manager instead.Returns the player manager.- Returns:
- the player manager
- Since:
- 1.15.2
-
scriptManager
Deprecated.use BetterModelPlatform#manager instead.Returns the script manager.- Returns:
- the script manager
- Since:
- 1.15.2
-
skinManager
Deprecated.use BetterModelPlatform#manager instead.Returns the skin manager.- Returns:
- the skin manager
- Since:
- 1.15.2
-
profileManager
Deprecated.use BetterModelPlatform#manager instead.Returns the profile manager.- Returns:
- the profile manager
- Since:
- 1.15.2
-
scheduler
Returns the platform's scheduler.- Returns:
- the scheduler
- Since:
- 1.15.2
-
adapter
Returns the platform-specific entity and component adapter.- Returns:
- the platform adapter
-
addReloadStartHandler
Registers a handler to be executed when a reload starts.- Parameters:
consumer- the handler, receiving thePackZipper- Since:
- 1.15.2
-
addReloadEndHandler
Registers a handler to be executed when a reload ends.- Parameters:
consumer- the handler, receiving theBetterModelPlatform.ReloadResult- Since:
- 1.15.2
-
logger
Returns the platform's logger.- Returns:
- the logger
- Since:
- 1.15.2
-
evaluator
Returns the expression evaluator.- Returns:
- the evaluator
- Since:
- 1.15.2
-
eventBus
Returns the event bus.- Returns:
- the event bus
- Since:
- 2.0.0
-
getResource
Retrieves a resource from the platform's JAR file.- Parameters:
path- the path to the resource- Returns:
- an input stream for the resource, or null if not found
- Since:
- 1.15.2
-