Class Models

java.lang.Object
dev.engine_room.flywheel.lib.model.Models

public final class Models extends Object
A collection of methods for creating models from various sources.
All Models returned from this class are cached, so calling the same method with the same parameters will return the same object.
  • Method Details

    • block

      public static Model block(net.minecraft.world.level.block.state.BlockState state)
      Get a usable model for a given block state.
      Parameters:
      state - The block state you wish to render.
      Returns:
      A model corresponding to how the given block state would appear in the level.
    • partial

      public static Model partial(PartialModel partial)
      Get a usable model for a given partial model.
      Parameters:
      partial - The partial model you wish to render.
      Returns:
      A model built from the baked model the partial model represents.
    • partial

      public static <T> Model partial(PartialModel partial, T key, BiConsumer<T,com.mojang.blaze3d.vertex.PoseStack> transformer)
      Get a usable model for a given partial model, transformed in some way.
      In general, you should try to avoid captures in the transformer function, i.e. prefer static method references over lambdas.
      Type Parameters:
      T - The type of the key.
      Parameters:
      partial - The partial model you wish to render.
      key - A key that will be used to cache the transformed model.
      transformer - A function that will transform the model in some way.
      Returns:
      A model built from the baked model the partial model represents, transformed by the given function.
    • partial

      public static Model partial(PartialModel partial, net.minecraft.core.Direction dir)
      Get a usable model for a given partial model, transformed to face a given direction.
      Direction.NORTH is considered the default direction and the corresponding transform will be a no-op.
      Parameters:
      partial - The partial model you wish to render.
      dir - The direction you wish the model to be rotated to.
      Returns:
      A model built from the baked model the partial model represents, transformed to face the given direction.