Interface BetterModelPlatform

All Superinterfaces:
ModelEventApplication

public interface BetterModelPlatform extends 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:
  • Method Details

    • dataFolder

      @NotNull @NotNull File dataFolder()
      Returns the data folder for the BetterModel plugin. This is where configuration files, data files, and other plugin-specific resources are stored.
      Returns:
      the data folder as a File object.
      Since:
      2.0.0
    • jarType

      @NotNull @NotNull BetterModelPlatform.JarType jarType()
      Returns the type of JAR file this platform is running on (e.g., SPIGOT, PAPER, FABRIC).
      Returns:
      the BetterModelPlatform.JarType enum representing the platform's JAR type.
      Since:
      2.0.0
    • reload

      @NotNull default @NotNull BetterModelPlatform.ReloadResult 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

      @NotNull @NotNull BetterModelPlatform.ReloadResult reload(@NotNull @NotNull ReloadInfo info)
      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

      @NotNull @NotNull BetterModelConfig config()
      Returns the platform's configuration manager.
      Returns:
      the configuration
      Since:
      1.15.2
    • version

      @NotNull @NotNull MinecraftVersion 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

      @NotNull @NotNull NMS nms()
      Returns the NMS (Net.Minecraft.Server) handler for version-specific operations.
      Returns:
      the NMS handler
      Since:
      1.15.2
    • manager

      @NotNull <T extends Manager> T manager(@NotNull @NotNull Class<T> managerClass)
      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 @NotNull default @NotNull ModelManager modelManager()
      Deprecated.
      use BetterModelPlatform#manager instead.
      Returns the model manager.
      Returns:
      the model manager
      Since:
      1.15.2
    • playerManager

      @Deprecated @NotNull default @NotNull PlayerManager playerManager()
      Deprecated.
      use BetterModelPlatform#manager instead.
      Returns the player manager.
      Returns:
      the player manager
      Since:
      1.15.2
    • scriptManager

      @Deprecated @NotNull default @NotNull ScriptManager scriptManager()
      Deprecated.
      use BetterModelPlatform#manager instead.
      Returns the script manager.
      Returns:
      the script manager
      Since:
      1.15.2
    • skinManager

      @Deprecated @NotNull default @NotNull SkinManager skinManager()
      Deprecated.
      use BetterModelPlatform#manager instead.
      Returns the skin manager.
      Returns:
      the skin manager
      Since:
      1.15.2
    • profileManager

      @Deprecated @NotNull default @NotNull ProfileManager profileManager()
      Deprecated.
      use BetterModelPlatform#manager instead.
      Returns the profile manager.
      Returns:
      the profile manager
      Since:
      1.15.2
    • scheduler

      @NotNull @NotNull ModelScheduler scheduler()
      Returns the platform's scheduler.
      Returns:
      the scheduler
      Since:
      1.15.2
    • adapter

      @NotNull @NotNull PlatformAdapter adapter()
      Returns the platform-specific entity and component adapter.
      Returns:
      the platform adapter
    • addReloadStartHandler

      void addReloadStartHandler(@NotNull @NotNull Consumer<PackZipper> consumer)
      Registers a handler to be executed when a reload starts.
      Parameters:
      consumer - the handler, receiving the PackZipper
      Since:
      1.15.2
    • addReloadEndHandler

      void addReloadEndHandler(@NotNull @NotNull Consumer<BetterModelPlatform.ReloadResult> consumer)
      Registers a handler to be executed when a reload ends.
      Parameters:
      consumer - the handler, receiving the BetterModelPlatform.ReloadResult
      Since:
      1.15.2
    • logger

      @NotNull @NotNull BetterModelLogger logger()
      Returns the platform's logger.
      Returns:
      the logger
      Since:
      1.15.2
    • evaluator

      @NotNull @NotNull BetterModelEvaluator evaluator()
      Returns the expression evaluator.
      Returns:
      the evaluator
      Since:
      1.15.2
    • eventBus

      @NotNull @NotNull BetterModelEventBus eventBus()
      Returns the event bus.
      Returns:
      the event bus
      Since:
      2.0.0
    • getResource

      @Nullable @Nullable InputStream getResource(@NotNull @NotNull String path)
      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