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
Modifier and TypeFieldDescriptionprivate final boolean
The field for theambientOcclusion
record component.private final int
The field for theblockLight
record component.private final boolean
The field for thecalculateNormals
record component.static final com.mojang.serialization.Codec
<ForgeFaceData> private final int
The field for thecolor
record component.static final com.mojang.serialization.Codec
<Integer> static final ForgeFaceData
private final int
The field for theskyLight
record component. -
Constructor Summary
ConstructorDescriptionForgeFaceData
(int color, int blockLight, int skyLight, boolean ambientOcclusion) ForgeFaceData
(int color, int blockLight, int skyLight, boolean ambientOcclusion, boolean calculateNormals) Creates an instance of aForgeFaceData
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of theambientOcclusion
record component.int
Returns the value of theblockLight
record component.boolean
Returns the value of thecalculateNormals
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 ForgeFaceData
read
(com.google.gson.JsonElement obj, ForgeFaceData fallback) Parses a ForgeFaceData 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. -
calculateNormals
private final boolean calculateNormalsThe field for thecalculateNormals
record 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 aForgeFaceData
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 componentcalculateNormals
- the value for thecalculateNormals
record 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 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
-
calculateNormals
public boolean calculateNormals()Returns the value of thecalculateNormals
record component.- Returns:
- the value of the
calculateNormals
record component
-