Class BetterModel

java.lang.Object
kr.toxicity.model.api.BetterModel

public final class BetterModel extends Object
The main entry point for the BetterModel API.

This class provides static access to the platform instance, configuration, model managers, NMS handlers, and entity registries. It serves as a service provider for interacting with the BetterModel engine.

Since:
1.15.2
  • Method Details

    • config

      @NotNull public static @NotNull BetterModelConfig config()
      Returns the platform configuration manager.
      Returns:
      the configuration manager
      Since:
      1.15.2
    • model

      @NotNull public static @NotNull Optional<ModelRenderer> model(@NotNull @NotNull String name)
      Retrieves a model renderer by its name, wrapped in an Optional.
      Parameters:
      name - the name of the model
      Returns:
      an optional containing the renderer if found
      Since:
      1.15.2
    • modelOrNull

      @Nullable public static @Nullable ModelRenderer modelOrNull(@NotNull @NotNull String name)
      Retrieves a model renderer by its name, or null if not found.
      Parameters:
      name - the name of the model
      Returns:
      the renderer, or null
      Since:
      1.15.2
    • limb

      @NotNull public static @NotNull Optional<ModelRenderer> limb(@NotNull @NotNull String name)
      Retrieves a player limb renderer by its name, wrapped in an Optional.
      Parameters:
      name - the name of the limb model
      Returns:
      an optional containing the renderer if found
      Since:
      1.15.2
    • limbOrNull

      @Nullable public static @Nullable ModelRenderer limbOrNull(@NotNull @NotNull String name)
      Retrieves a player limb renderer by its name, or null if not found.
      Parameters:
      name - the name of the limb model
      Returns:
      the renderer, or null
      Since:
      1.15.2
    • player

      @NotNull public static @NotNull Optional<PlayerChannelHandler> player(@NotNull @NotNull UUID uuid)
      Retrieves a player channel handler by the player's UUID.
      Parameters:
      uuid - the player's UUID
      Returns:
      an optional containing the channel handler if found
      Since:
      1.15.2
    • registry

      @NotNull public static @NotNull Optional<EntityTrackerRegistry> registry(@NotNull @NotNull UUID uuid)
      Retrieves an entity tracker registry by the entity's UUID.
      Parameters:
      uuid - the entity's UUID
      Returns:
      an optional containing the registry if found
      Since:
      1.15.2
    • registry

      @NotNull public static @NotNull Optional<EntityTrackerRegistry> registry(@NotNull @NotNull PlatformEntity entity)
      Retrieves an entity tracker registry for a Bukkit entity.
      Parameters:
      entity - the Bukkit entity
      Returns:
      an optional containing the registry if found
      Since:
      1.15.2
    • registry

      @NotNull public static @NotNull Optional<EntityTrackerRegistry> registry(@NotNull @NotNull BaseEntity entity)
      Retrieves an entity tracker registry for a base entity.
      Parameters:
      entity - the base entity
      Returns:
      an optional containing the registry if found
      Since:
      1.15.2
    • registryOrNull

      @Nullable public static @Nullable EntityTrackerRegistry registryOrNull(@NotNull @NotNull UUID uuid)
      Retrieves an entity tracker registry by the entity's UUID, or null if not found.
      Parameters:
      uuid - the entity's UUID
      Returns:
      the registry, or null
      Since:
      1.15.2
    • registryOrNull

      @Nullable public static @Nullable EntityTrackerRegistry registryOrNull(@NotNull @NotNull PlatformEntity entity)
      Retrieves an entity tracker registry for a Bukkit entity, or null if not found.
      Parameters:
      entity - the Bukkit entity
      Returns:
      the registry, or null
      Since:
      1.15.2
    • registryOrNull

      @Nullable public static @Nullable EntityTrackerRegistry registryOrNull(@NotNull @NotNull BaseEntity entity)
      Retrieves an entity tracker registry for a base entity, or null if not found.
      Parameters:
      entity - the base entity
      Returns:
      the registry, or null
      Since:
      1.15.2
    • models

      @NotNull public static @NotNull @Unmodifiable Collection<ModelRenderer> models()
      Returns a collection of all loaded model renderers.
      Returns:
      an unmodifiable collection of models
      Since:
      1.15.2
    • limbs

      @NotNull public static @NotNull @Unmodifiable Collection<ModelRenderer> limbs()
      Returns a collection of all loaded player limb renderers.
      Returns:
      an unmodifiable collection of limb models
      Since:
      1.15.2
    • modelKeys

      @NotNull public static @NotNull @Unmodifiable Set<String> modelKeys()
      Returns a set of all loaded model names.
      Returns:
      an unmodifiable set of model keys
      Since:
      1.15.2
    • limbKeys

      @NotNull public static @NotNull @Unmodifiable Set<String> limbKeys()
      Returns a set of all loaded player limb model names.
      Returns:
      an unmodifiable set of limb keys
      Since:
      1.15.2
    • platform

      @NotNull public static @NotNull BetterModelPlatform platform()
      Returns the singleton instance of the BetterModel platform.
      Returns:
      the platform instance
      Throws:
      NullPointerException - if the platform has not been initialized
      Since:
      2.0.0
    • nms

      @NotNull public static @NotNull NMS nms()
      Returns the NMS handler instance.
      Returns:
      the NMS handler
      Since:
      1.15.2
    • eventBus

      @NotNull public static @NotNull BetterModelEventBus eventBus()
      Returns the event bus.
      Returns:
      the event bus
      Since:
      2.0.0
    • register

      @Internal public static void register(@NotNull @NotNull BetterModelPlatform instance)
      Registers the platform instance.

      This method is intended for internal use only during platform initialization.

      Parameters:
      instance - the platform instance
      Throws:
      RuntimeException - if an instance is already registered
      Since:
      1.15.2