Record Class ExtraFaceData

java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.model.ExtraFaceData
Record Components:
color - Color in ARGB format
lightEmission - Light emission for the face or element from 0-15 (inclusive)
ambientOcclusion - If this face has AO

public record ExtraFaceData(int color, int lightEmission, boolean ambientOcclusion) extends Record
Holds extra data that may be injected into a face.

Used by

invalid reference
ItemLayerModel
, BlockElement and BlockElementFace
  • Field Details

    • color

      private final int color
      The field for the color record component.
    • lightEmission

      private final int lightEmission
      The field for the lightEmission record component.
    • ambientOcclusion

      private final boolean ambientOcclusion
      The field for the ambientOcclusion record component.
    • DEFAULT

      public static final ExtraFaceData DEFAULT
    • COLOR

      public static final com.mojang.serialization.Codec<Integer> COLOR
    • CODEC

      public static final com.mojang.serialization.Codec<ExtraFaceData> CODEC
  • Constructor Details

    • ExtraFaceData

      public ExtraFaceData(int color, int lightEmission, boolean ambientOcclusion)
      Creates an instance of a ExtraFaceData record class.
      Parameters:
      color - the value for the color record component
      lightEmission - the value for the lightEmission record component
      ambientOcclusion - the value for the ambientOcclusion record component
  • Method Details

    • read

      public static @Nullable ExtraFaceData read(@Nullable JsonElement obj, @Nullable ExtraFaceData fallback) throws JsonParseException
      Parses an ExtraFaceData from JSON
      Parameters:
      obj - The JsonObject to parse from, weakly-typed to JsonElement to reduce logic complexity.
      fallback - What to return if the first parameter is null.
      Returns:
      The parsed ExtraFaceData, or the fallback parameter if the first parmeter is null.
      Throws:
      JsonParseException
    • 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 '=='.
      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.
    • color

      public int color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • lightEmission

      public int lightEmission()
      Returns the value of the lightEmission record component.
      Returns:
      the value of the lightEmission record component
    • ambientOcclusion

      public boolean ambientOcclusion()
      Returns the value of the ambientOcclusion record component.
      Returns:
      the value of the ambientOcclusion record component