Record Class ForgeFaceData

java.lang.Object
java.lang.Record
net.minecraftforge.client.model.ForgeFaceData
Record Components:
color - Color in ARGB format
blockLight - Block Light for this face from 0-15 (inclusive)
skyLight - Sky Light for this face from 0-15 (inclusive)
ambientOcclusion - If this face has AO

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

Used by ItemLayerModel, BlockElement and BlockElementFace

  • Field Details

    • color

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

      private final int blockLight
      The field for the blockLight record component.
    • skyLight

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

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

      public static final ForgeFaceData DEFAULT
    • COLOR

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

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

    • ForgeFaceData

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

    • read

      @Nullable public static ForgeFaceData read(@Nullable com.google.gson.JsonElement obj, @Nullable ForgeFaceData fallback) throws com.google.gson.JsonParseException
      Parses a ForgeFaceData 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 ForgeFaceData, or the fallback parameter if the first parmeter is null.
      Throws:
      com.google.gson.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
    • blockLight

      public int blockLight()
      Returns the value of the blockLight record component.
      Returns:
      the value of the blockLight record component
    • skyLight

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

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