记录类 ForgeFaceData

java.lang.Object
java.lang.Record
net.minecraftforge.client.model.ForgeFaceData
记录组件:
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
calculateNormals - If we should manually calculate the normals for this block or inherit facing normals like vanilla

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

Used by ItemLayerModel, BlockElement and BlockElementFace

  • 字段详细资料

    • color

      private final int color
      color 记录组件的字段。
    • blockLight

      private final int blockLight
      blockLight 记录组件的字段。
    • skyLight

      private final int skyLight
      skyLight 记录组件的字段。
    • ambientOcclusion

      private final boolean ambientOcclusion
      ambientOcclusion 记录组件的字段。
    • calculateNormals

      private final boolean calculateNormals
      calculateNormals 记录组件的字段。
    • 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
  • 构造器详细资料

    • ForgeFaceData

      public ForgeFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion)
    • ForgeFaceData

      public ForgeFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion, boolean calculateNormals)
      创建 ForgeFaceData 记录类的实例。
      参数:
      color - color 记录组件的值
      blockLight - blockLight 记录组件的值
      skyLight - skyLight 记录组件的值
      ambientOcclusion - ambientOcclusion 记录组件的值
      calculateNormals - calculateNormals 记录组件的值
  • 方法详细资料

    • 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
      参数:
      obj - The JsonObject to parse from, weakly-typed to JsonElement to reduce logic complexity.
      fallback - What to return if the first parameter is null.
      返回:
      The parsed ForgeFaceData, or the fallback parameter if the first parmeter is null.
      抛出:
      com.google.gson.JsonParseException
    • toString

      public final String toString()
      返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。
      指定者:
      toString 在类中 Record
      返回:
      此对象的字符串表示形式
    • hashCode

      public final int hashCode()
      返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。
      指定者:
      hashCode 在类中 Record
      返回:
      此对象的哈希代码值
    • equals

      public final boolean equals(Object o)
      指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用 '==' 进行比较。
      指定者:
      equals 在类中 Record
      参数:
      o - 要与之进行比较的对象
      返回:
      如果此对象与 o 参数相同,则为 true;否则为 false
    • color

      public int color()
      返回 color 记录组件的值。
      返回:
      color 记录组件的值
    • blockLight

      public int blockLight()
      返回 blockLight 记录组件的值。
      返回:
      blockLight 记录组件的值
    • skyLight

      public int skyLight()
      返回 skyLight 记录组件的值。
      返回:
      skyLight 记录组件的值
    • ambientOcclusion

      public boolean ambientOcclusion()
      返回 ambientOcclusion 记录组件的值。
      返回:
      ambientOcclusion 记录组件的值
    • calculateNormals

      public boolean calculateNormals()
      返回 calculateNormals 记录组件的值。
      返回:
      calculateNormals 记录组件的值