Class StorageCellModels

java.lang.Object
appeng.api.client.StorageCellModels

@ThreadSafe public final class StorageCellModels extends Object
A registry for 3D models used to render storage cells in the world, when they are inserted into a drive or similar machines.
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.resources.ResourceLocation
    Returns the default model, which can be used when no explicit model is registered.
    static net.minecraft.resources.ResourceLocation
    model(net.minecraft.world.level.ItemLike itemLike)
    The ResourceLocation of the model used to render the given storage cell Item when inserted into a drive or similar.
    static Map<net.minecraft.world.item.Item,net.minecraft.resources.ResourceLocation>
    A copy of all registered mappings.
    static void
    registerModel(net.minecraft.world.level.ItemLike itemLike, net.minecraft.resources.ResourceLocation model)
    Register a new model for a storage cell item.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • registerModel

      public static void registerModel(net.minecraft.world.level.ItemLike itemLike, net.minecraft.resources.ResourceLocation model)
      Register a new model for a storage cell item.

      You are responsible for ensuring that the given model is actually loaded by the game. See net.minecraftforge.client.model.ModelLoader#addSpecialModel. This method only maps an Item to a ResourceLocation which can be looked up from the ModelBakery. No validation about missing models will be done. Will throw an exception in case a model is already registered for an item. For examples look at our cell part models within the drive model directory.

      Parameters:
      itemLike - The cell item
      model - The ResourceLocation representing the model.
    • model

      @Nullable public static net.minecraft.resources.ResourceLocation model(net.minecraft.world.level.ItemLike itemLike)
      The ResourceLocation of the model used to render the given storage cell Item when inserted into a drive or similar.
      Parameters:
      itemLike -
      Returns:
      null, if no model is registered.
    • models

      public static Map<net.minecraft.world.item.Item,net.minecraft.resources.ResourceLocation> models()
      A copy of all registered mappings.
    • getDefaultModel

      public static net.minecraft.resources.ResourceLocation getDefaultModel()
      Returns the default model, which can be used when no explicit model is registered.