Record Class ExtraFaceData
java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.model.ExtraFaceData
- Record Components:
color
- Color in ARGB formatblockLight
- 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 ExtraFaceData(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 Summary
Modifier and TypeFieldDescriptionprivate final boolean
The field for theambientOcclusion
record component.private final int
The field for theblockLight
record component.static final com.mojang.serialization.Codec
<ExtraFaceData> private final int
The field for thecolor
record component.static final com.mojang.serialization.Codec
<Integer> static final ExtraFaceData
private final int
The field for theskyLight
record component. -
Constructor Summary
ConstructorDescriptionExtraFaceData
(int color, int blockLight, int skyLight, boolean ambientOcclusion) Creates an instance of aExtraFaceData
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of theambientOcclusion
record component.int
Returns the value of theblockLight
record component.int
color()
Returns the value of thecolor
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static @Nullable ExtraFaceData
read
(@Nullable com.google.gson.JsonElement obj, @Nullable ExtraFaceData fallback) Parses an ExtraFaceData from JSONint
skyLight()
Returns the value of theskyLight
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
color
private final int colorThe field for thecolor
record component. -
blockLight
private final int blockLightThe field for theblockLight
record component. -
skyLight
private final int skyLightThe field for theskyLight
record component. -
ambientOcclusion
private final boolean ambientOcclusionThe field for theambientOcclusion
record component. -
DEFAULT
-
COLOR
-
CODEC
-
-
Constructor Details
-
ExtraFaceData
public ExtraFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion) Creates an instance of aExtraFaceData
record class.- Parameters:
color
- the value for thecolor
record componentblockLight
- the value for theblockLight
record componentskyLight
- the value for theskyLight
record componentambientOcclusion
- the value for theambientOcclusion
record component
-
-
Method Details
-
read
@Nullable public static @Nullable ExtraFaceData read(@Nullable @Nullable com.google.gson.JsonElement obj, @Nullable @Nullable ExtraFaceData fallback) throws com.google.gson.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:
com.google.gson.JsonParseException
-
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. -
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. -
equals
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 '=='. -
color
public int color()Returns the value of thecolor
record component.- Returns:
- the value of the
color
record component
-
blockLight
public int blockLight()Returns the value of theblockLight
record component.- Returns:
- the value of the
blockLight
record component
-
skyLight
public int skyLight()Returns the value of theskyLight
record component.- Returns:
- the value of the
skyLight
record component
-
ambientOcclusion
public boolean ambientOcclusion()Returns the value of theambientOcclusion
record component.- Returns:
- the value of the
ambientOcclusion
record component
-