Record Class ExtraFaceData
java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.model.ExtraFaceData
- Record Components:
color- Color in ARGB formatlightEmission- Light emission for the face or element from 0-15 (inclusive)ambientOcclusion- If this face has AO
Holds extra data that may be injected into a face.
Used by
, invalid reference
ItemLayerModelBlockElement and BlockElementFace
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theambientOcclusionrecord component.static final com.mojang.serialization.Codec<ExtraFaceData> private final intThe field for thecolorrecord component.static final com.mojang.serialization.Codec<Integer> static final ExtraFaceDataprivate final intThe field for thelightEmissionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionExtraFaceData(int color, int lightEmission, boolean ambientOcclusion) Creates an instance of aExtraFaceDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theambientOcclusionrecord component.intcolor()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thelightEmissionrecord component.static @Nullable ExtraFaceDataread(@Nullable JsonElement obj, @Nullable ExtraFaceData fallback) Parses an ExtraFaceData from JSONfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
color
private final int colorThe field for thecolorrecord component. -
lightEmission
private final int lightEmissionThe field for thelightEmissionrecord component. -
ambientOcclusion
private final boolean ambientOcclusionThe field for theambientOcclusionrecord component. -
DEFAULT
-
COLOR
-
CODEC
-
-
Constructor Details
-
ExtraFaceData
public ExtraFaceData(int color, int lightEmission, boolean ambientOcclusion) Creates an instance of aExtraFaceDatarecord class.- Parameters:
color- the value for thecolorrecord componentlightEmission- the value for thelightEmissionrecord componentambientOcclusion- the value for theambientOcclusionrecord 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
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 thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
lightEmission
public int lightEmission()Returns the value of thelightEmissionrecord component.- Returns:
- the value of the
lightEmissionrecord component
-
ambientOcclusion
public boolean ambientOcclusion()Returns the value of theambientOcclusionrecord component.- Returns:
- the value of the
ambientOcclusionrecord component
-