Record Class BlockModel

java.lang.Object
java.lang.Record
net.minecraft.client.renderer.block.model.BlockModel
All Implemented Interfaces:
ResolvableModel, UnbakedModel, UnbakedModelExtension

public record BlockModel(@Nullable UnbakedGeometry geometry, @Nullable UnbakedModel.GuiLight guiLight, @Nullable Boolean ambientOcclusion, @Nullable ItemTransforms transforms, TextureSlots.Data textureSlots, @Nullable ResourceLocation parent, @Nullable Transformation rootTransform, RenderTypeGroup renderTypeGroup, Map<String,Boolean> partVisibility) extends Record implements UnbakedModel
  • Field Details

    • geometry

      @Nullable private final UnbakedGeometry geometry
      The field for the geometry record component.
    • guiLight

      @Nullable private final UnbakedModel.GuiLight guiLight
      The field for the guiLight record component.
    • ambientOcclusion

      @Nullable private final Boolean ambientOcclusion
      The field for the ambientOcclusion record component.
    • transforms

      @Nullable private final ItemTransforms transforms
      The field for the transforms record component.
    • textureSlots

      private final TextureSlots.Data textureSlots
      The field for the textureSlots record component.
    • parent

      @Nullable private final ResourceLocation parent
      The field for the parent record component.
    • rootTransform

      @Nullable private final Transformation rootTransform
      The field for the rootTransform record component.
    • renderTypeGroup

      private final RenderTypeGroup renderTypeGroup
      The field for the renderTypeGroup record component.
    • partVisibility

      private final Map<String,Boolean> partVisibility
      The field for the partVisibility record component.
    • GSON

      public static final com.google.gson.Gson GSON
  • Constructor Details

    • BlockModel

      public BlockModel(@Nullable UnbakedGeometry geometry, @Nullable UnbakedModel.GuiLight guiLight, @Nullable Boolean ambientOcclusion, @Nullable ItemTransforms transforms, TextureSlots.Data textureSlots, @Nullable ResourceLocation parent)
    • BlockModel

      public BlockModel(@Nullable UnbakedGeometry geometry, @Nullable UnbakedModel.GuiLight guiLight, @Nullable Boolean ambientOcclusion, @Nullable ItemTransforms transforms, TextureSlots.Data textureSlots, @Nullable ResourceLocation parent, @Nullable Transformation rootTransform, RenderTypeGroup renderTypeGroup, Map<String,Boolean> partVisibility)
      Creates an instance of a BlockModel record class.
      Parameters:
      geometry - the value for the geometry record component
      guiLight - the value for the guiLight record component
      ambientOcclusion - the value for the ambientOcclusion record component
      transforms - the value for the transforms record component
      textureSlots - the value for the textureSlots record component
      parent - the value for the parent record component
      rootTransform - the value for the rootTransform record component
      renderTypeGroup - the value for the renderTypeGroup record component
      partVisibility - the value for the partVisibility record component
  • Method Details

    • fromStream

      @Deprecated public static BlockModel fromStream(Reader p_111462_)
      Deprecated.
    • fillAdditionalProperties

      public void fillAdditionalProperties(ContextMap.Builder propertiesBuilder)
      Description copied from interface: UnbakedModelExtension
      Appends additional properties for this model to the builder.

      This method will already have been called on the parent models. It can modify the properties added by a parent model and/or add its own. This ensures that the properties are merged across the model parent-child chain.

      The context map containing all the properties can be retrieved later using ResolvedModelExtension.getTopAdditionalProperties().

      Specified by:
      fillAdditionalProperties in interface UnbakedModelExtension
      See Also:
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • geometry

      @Nullable public UnbakedGeometry geometry()
      Returns the value of the geometry record component.
      Specified by:
      geometry in interface UnbakedModel
      Returns:
      the value of the geometry record component
    • guiLight

      @Nullable public UnbakedModel.GuiLight guiLight()
      Returns the value of the guiLight record component.
      Specified by:
      guiLight in interface UnbakedModel
      Returns:
      the value of the guiLight record component
    • ambientOcclusion

      @Nullable public Boolean ambientOcclusion()
      Returns the value of the ambientOcclusion record component.
      Specified by:
      ambientOcclusion in interface UnbakedModel
      Returns:
      the value of the ambientOcclusion record component
    • transforms

      @Nullable public ItemTransforms transforms()
      Returns the value of the transforms record component.
      Specified by:
      transforms in interface UnbakedModel
      Returns:
      the value of the transforms record component
    • textureSlots

      public TextureSlots.Data textureSlots()
      Returns the value of the textureSlots record component.
      Specified by:
      textureSlots in interface UnbakedModel
      Returns:
      the value of the textureSlots record component
    • parent

      @Nullable public ResourceLocation parent()
      Returns the value of the parent record component.
      Specified by:
      parent in interface UnbakedModel
      Returns:
      the value of the parent record component
    • rootTransform

      @Nullable public Transformation rootTransform()
      Returns the value of the rootTransform record component.
      Returns:
      the value of the rootTransform record component
    • renderTypeGroup

      public RenderTypeGroup renderTypeGroup()
      Returns the value of the renderTypeGroup record component.
      Returns:
      the value of the renderTypeGroup record component
    • partVisibility

      public Map<String,Boolean> partVisibility()
      Returns the value of the partVisibility record component.
      Returns:
      the value of the partVisibility record component