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
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theambientOcclusionrecord component.private final intThe field for theblockLightrecord 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 theskyLightrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionExtraFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion) Creates an instance of aExtraFaceDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theambientOcclusionrecord component.intReturns the value of theblockLightrecord 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.static ExtraFaceDataread(com.google.gson.JsonElement obj, ExtraFaceData fallback) Parses an ExtraFaceData from JSONintskyLight()Returns the value of theskyLightrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
color
private final int colorThe field for thecolorrecord component. -
blockLight
private final int blockLightThe field for theblockLightrecord component. -
skyLight
private final int skyLightThe field for theskyLightrecord component. -
ambientOcclusion
private final boolean ambientOcclusionThe field for theambientOcclusionrecord component. -
DEFAULT
-
COLOR
-
CODEC
-
-
Constructor Details
-
ExtraFaceData
public ExtraFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion) Creates an instance of aExtraFaceDatarecord class.- Parameters:
color- the value for thecolorrecord componentblockLight- the value for theblockLightrecord componentskyLight- the value for theskyLightrecord componentambientOcclusion- the value for theambientOcclusionrecord component
-
-
Method Details
-
read
@Nullable public static ExtraFaceData read(@Nullable com.google.gson.JsonElement obj, @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 thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
blockLight
public int blockLight()Returns the value of theblockLightrecord component.- Returns:
- the value of the
blockLightrecord component
-
skyLight
public int skyLight()Returns the value of theskyLightrecord component.- Returns:
- the value of the
skyLightrecord component
-
ambientOcclusion
public boolean ambientOcclusion()Returns the value of theambientOcclusionrecord component.- Returns:
- the value of the
ambientOcclusionrecord component
-