Interface Material<D extends InstanceData>

All Known Implementing Classes:
BatchedMaterial, InstancedMaterial

public interface Material<D extends InstanceData>
  • Method Details

    • model

      Instancer<D> model(Object key, Supplier<Model> modelSupplier)
      Get an instancer for the given model. Calling this method twice with the same key will return the same instancer.
      Parameters:
      key - An object that uniquely identifies the model.
      modelSupplier - A factory that creates the Model that you want to render. Each time Supplier.get() is called, a new Model must be created.
      Returns:
      An instancer for the given model, capable of rendering many copies for little cost.
    • getModel

      default Instancer<D> getModel(PartialModel partial, net.minecraft.world.level.block.state.BlockState referenceState)
    • getModel

      default Instancer<D> getModel(PartialModel partial)
    • getModel

      default Instancer<D> getModel(PartialModel partial, net.minecraft.world.level.block.state.BlockState referenceState, net.minecraft.core.Direction dir)
    • getModel

      default Instancer<D> getModel(PartialModel partial, net.minecraft.world.level.block.state.BlockState referenceState, net.minecraft.core.Direction dir, Supplier<com.mojang.blaze3d.vertex.PoseStack> modelTransform)
    • getModel

      default Instancer<D> getModel(net.minecraft.world.level.block.state.BlockState toRender)