Class SingleVariant

java.lang.Object
net.minecraft.client.renderer.block.model.SingleVariant
All Implemented Interfaces:
BlockStateModel, BlockStateModelExtension

public class SingleVariant extends Object implements BlockStateModel
  • Field Details

  • Constructor Details

  • Method Details

    • collectParts

      public void collectParts(RandomSource p_410554_, List<BlockModelPart> p_410007_)
      Specified by:
      collectParts in interface BlockStateModel
    • createGeometryKey

      public Object createGeometryKey(BlockAndTintGetter level, BlockPos pos, BlockState state, RandomSource random)
      Description copied from interface: BlockStateModelExtension
      Collects all the data used by the model to produce renderable geometry. The returned object encapsulates which parts of the world state the model depends on.

      This allows the geometry produced previously by a model to be reused, provided that the key matches. The key can be used to compare the geometry of different models. If this model forwards to a single other model, it can directly return its geometry key. Otherwise, it should use a custom type specific to the model.

      The passed in level, pos and random parameters should not be put directly into the returned key. Only the relevant information should be extracted so that the same key is yielded as often as possible.

      The default implementation returns null, meaning the model does not implement this method. A model that wishes to override this method must therefore not return null, even if the model does not use any passed in state.

      Specified by:
      createGeometryKey in interface BlockStateModelExtension
      Returns:
      an object collecting all the data that influences the geometry of this model; can be any object as long as it implements Object.hashCode() and Object.equals(Object) correctly.
    • particleIcon

      public TextureAtlasSprite particleIcon()
      Specified by:
      particleIcon in interface BlockStateModel