Package net.minecraftforge.client.model
Record Class ForgeFaceData
java.lang.Object
java.lang.Record
net.minecraftforge.client.model.ForgeFaceData
- 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 AOcalculateNormals- 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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theambientOcclusionrecord component.private final intThe field for theblockLightrecord component.private final booleanThe field for thecalculateNormalsrecord component.static final com.mojang.serialization.Codec<ForgeFaceData> private final intThe field for thecolorrecord component.static final com.mojang.serialization.Codec<Integer> static final ForgeFaceDataprivate final intThe field for theskyLightrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionForgeFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion) ForgeFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion, boolean calculateNormals) Creates an instance of aForgeFaceDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theambientOcclusionrecord component.intReturns the value of theblockLightrecord component.booleanReturns the value of thecalculateNormalsrecord 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 ForgeFaceDataread(com.google.gson.JsonElement obj, ForgeFaceData fallback) Parses a ForgeFaceData 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. -
calculateNormals
private final boolean calculateNormalsThe field for thecalculateNormalsrecord component. -
DEFAULT
-
COLOR
-
CODEC
-
-
Constructor Details
-
ForgeFaceData
public ForgeFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion) -
ForgeFaceData
public ForgeFaceData(int color, int blockLight, int skyLight, boolean ambientOcclusion, boolean calculateNormals) Creates an instance of aForgeFaceDatarecord class.- Parameters:
color- the value for thecolorrecord componentblockLight- the value for theblockLightrecord componentskyLight- the value for theskyLightrecord componentambientOcclusion- the value for theambientOcclusionrecord componentcalculateNormals- the value for thecalculateNormalsrecord 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
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
-
calculateNormals
public boolean calculateNormals()Returns the value of thecalculateNormalsrecord component.- Returns:
- the value of the
calculateNormalsrecord component
-