Record Class SimpleModelWrapper

java.lang.Object
java.lang.Record
net.minecraft.client.renderer.block.model.SimpleModelWrapper
All Implemented Interfaces:
BlockModelPart, BlockModelPartExtension

public record SimpleModelWrapper(QuadCollection quads, boolean useAmbientOcclusion, TextureAtlasSprite particleIcon, @Nullable RenderType renderType) extends Record implements BlockModelPart
  • Field Details

    • quads

      private final QuadCollection quads
      The field for the quads record component.
    • useAmbientOcclusion

      private final boolean useAmbientOcclusion
      The field for the useAmbientOcclusion record component.
    • particleIcon

      private final TextureAtlasSprite particleIcon
      The field for the particleIcon record component.
    • renderType

      @Nullable private final RenderType renderType
      The field for the renderType record component.
  • Constructor Details

    • SimpleModelWrapper

      @Deprecated public SimpleModelWrapper(QuadCollection quads, boolean useAmbientOcclusion, TextureAtlasSprite particleIcon)
      Deprecated.
    • SimpleModelWrapper

      public SimpleModelWrapper(QuadCollection quads, boolean useAmbientOcclusion, TextureAtlasSprite particleIcon, @Nullable RenderType renderType)
      Creates an instance of a SimpleModelWrapper record class.
      Parameters:
      quads - the value for the quads record component
      useAmbientOcclusion - the value for the useAmbientOcclusion record component
      particleIcon - the value for the particleIcon record component
      renderType - the value for the renderType record component
  • Method Details

    • bake

      public static SimpleModelWrapper bake(ModelBaker p_405335_, ResourceLocation p_405098_, ModelState p_405869_)
    • bake

      public static SimpleModelWrapper bake(ModelBaker p_405335_, ResolvedModel resolvedmodel, ModelState p_405869_)
    • getQuads

      public List<BakedQuad> getQuads(@Nullable Direction p_405263_)
      Specified by:
      getQuads in interface BlockModelPart
    • getRenderType

      public RenderType getRenderType(BlockState state)
      Description copied from interface: BlockModelPartExtension
      Gets the set of render types to use when drawing this block in the level. Supported types are those returned by RenderType.chunkBufferLayers().

      By default, defers query to ItemBlockRenderTypes.

      Specified by:
      getRenderType in interface BlockModelPartExtension
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • quads

      public QuadCollection quads()
      Returns the value of the quads record component.
      Returns:
      the value of the quads record component
    • useAmbientOcclusion

      public boolean useAmbientOcclusion()
      Returns the value of the useAmbientOcclusion record component.
      Specified by:
      useAmbientOcclusion in interface BlockModelPart
      Returns:
      the value of the useAmbientOcclusion record component
    • particleIcon

      public TextureAtlasSprite particleIcon()
      Returns the value of the particleIcon record component.
      Specified by:
      particleIcon in interface BlockModelPart
      Returns:
      the value of the particleIcon record component
    • renderType

      @Nullable public RenderType renderType()
      Returns the value of the renderType record component.
      Returns:
      the value of the renderType record component