Class ExtraModelKey<T>

java.lang.Object
net.fabricmc.fabric.api.client.model.loading.v1.ExtraModelKey<T>
Type Parameters:
T - The type of the baked model.

public final class ExtraModelKey<T> extends Object
A unique key representing an extra model, not tied to a block state or item model.

Extra models can be registered with a ModelLoadingPlugin (see ModelLoadingPlugin.Context.addModel(ExtraModelKey, UnbakedExtraModel)). Once baking is complete, they may then be queried from the model manager using FabricBakedModelManager.getModel(ExtraModelKey).

See Also:
  • Method Details

    • create

      @Contract("-> new") public static <T> ExtraModelKey<T> create()
      Create a new unique model key.
      Type Parameters:
      T - The type of the baked model.
      Returns:
      The newly created model key.
    • create

      @Contract("_ -> new") public static <T> ExtraModelKey<T> create(Supplier<String> name)
      Create a new unique model key.
      Type Parameters:
      T - The type of the baked model.
      Parameters:
      name - The name of this model key, shown in error messages.
      Returns:
      The newly created model key.
    • toString

      public String toString()
      Overrides:
      toString in class Object