Record Class BlockModel
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.block.model.BlockModel
- All Implemented Interfaces:
ResolvableModel
,UnbakedModel
,UnbakedModelExtension
public record BlockModel(@Nullable UnbakedGeometry geometry, @Nullable UnbakedModel.GuiLight guiLight, @Nullable Boolean ambientOcclusion, @Nullable ItemTransforms transforms, TextureSlots.Data textureSlots, @Nullable ResourceLocation parent, @Nullable Transformation rootTransform, RenderTypeGroup renderTypeGroup, Map<String,Boolean> partVisibility)
extends Record
implements UnbakedModel
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.client.resources.model.ResolvableModel
ResolvableModel.Resolver
Nested classes/interfaces inherited from interface net.minecraft.client.resources.model.UnbakedModel
UnbakedModel.GuiLight
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Boolean
The field for theambientOcclusion
record component.private final UnbakedGeometry
The field for thegeometry
record component.static final com.google.gson.Gson
private final UnbakedModel.GuiLight
The field for theguiLight
record component.private final ResourceLocation
The field for theparent
record component.The field for thepartVisibility
record component.private final RenderTypeGroup
The field for therenderTypeGroup
record component.private final Transformation
The field for therootTransform
record component.private final TextureSlots.Data
The field for thetextureSlots
record component.private final ItemTransforms
The field for thetransforms
record component.Fields inherited from interface net.minecraft.client.resources.model.UnbakedModel
PARTICLE_TEXTURE_REFERENCE
-
Constructor Summary
ConstructorsConstructorDescriptionBlockModel
(UnbakedGeometry geometry, UnbakedModel.GuiLight guiLight, Boolean ambientOcclusion, ItemTransforms transforms, TextureSlots.Data textureSlots, ResourceLocation parent) BlockModel
(UnbakedGeometry geometry, UnbakedModel.GuiLight guiLight, Boolean ambientOcclusion, ItemTransforms transforms, TextureSlots.Data textureSlots, ResourceLocation parent, Transformation rootTransform, RenderTypeGroup renderTypeGroup, Map<String, Boolean> partVisibility) Creates an instance of aBlockModel
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theambientOcclusion
record component.final boolean
Indicates whether some other object is "equal to" this one.void
fillAdditionalProperties
(ContextMap.Builder propertiesBuilder) Appends additional properties for this model to the builder.static BlockModel
fromStream
(Reader p_111462_) Deprecated.geometry()
Returns the value of thegeometry
record component.guiLight()
Returns the value of theguiLight
record component.final int
hashCode()
Returns a hash code value for this object.parent()
Returns the value of theparent
record component.Returns the value of thepartVisibility
record component.Returns the value of therenderTypeGroup
record component.Returns the value of therootTransform
record component.Returns the value of thetextureSlots
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetransforms
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.client.extensions.UnbakedModelExtension
resolveDependencies
-
Field Details
-
geometry
The field for thegeometry
record component. -
guiLight
The field for theguiLight
record component. -
ambientOcclusion
The field for theambientOcclusion
record component. -
transforms
The field for thetransforms
record component. -
textureSlots
The field for thetextureSlots
record component. -
parent
The field for theparent
record component. -
rootTransform
The field for therootTransform
record component. -
renderTypeGroup
The field for therenderTypeGroup
record component. -
partVisibility
The field for thepartVisibility
record component. -
GSON
public static final com.google.gson.Gson GSON
-
-
Constructor Details
-
BlockModel
public BlockModel(@Nullable UnbakedGeometry geometry, @Nullable UnbakedModel.GuiLight guiLight, @Nullable Boolean ambientOcclusion, @Nullable ItemTransforms transforms, TextureSlots.Data textureSlots, @Nullable ResourceLocation parent) -
BlockModel
public BlockModel(@Nullable UnbakedGeometry geometry, @Nullable UnbakedModel.GuiLight guiLight, @Nullable Boolean ambientOcclusion, @Nullable ItemTransforms transforms, TextureSlots.Data textureSlots, @Nullable ResourceLocation parent, @Nullable Transformation rootTransform, RenderTypeGroup renderTypeGroup, Map<String, Boolean> partVisibility) Creates an instance of aBlockModel
record class.- Parameters:
geometry
- the value for thegeometry
record componentguiLight
- the value for theguiLight
record componentambientOcclusion
- the value for theambientOcclusion
record componenttransforms
- the value for thetransforms
record componenttextureSlots
- the value for thetextureSlots
record componentparent
- the value for theparent
record componentrootTransform
- the value for therootTransform
record componentrenderTypeGroup
- the value for therenderTypeGroup
record componentpartVisibility
- the value for thepartVisibility
record component
-
-
Method Details
-
fromStream
Deprecated.Neo: useUnbakedModelParser.parse(Reader)
instead -
fillAdditionalProperties
Description copied from interface:UnbakedModelExtension
Appends additional properties for this model to the builder.This method will already have been called on the parent models. It can modify the properties added by a parent model and/or add its own. This ensures that the properties are merged across the model parent-child chain.
The context map containing all the properties can be retrieved later using
ResolvedModelExtension.getTopAdditionalProperties()
.- Specified by:
fillAdditionalProperties
in interfaceUnbakedModelExtension
- See Also:
-
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 withObjects::equals(Object,Object)
. -
geometry
Returns the value of thegeometry
record component.- Specified by:
geometry
in interfaceUnbakedModel
- Returns:
- the value of the
geometry
record component
-
guiLight
Returns the value of theguiLight
record component.- Specified by:
guiLight
in interfaceUnbakedModel
- Returns:
- the value of the
guiLight
record component
-
ambientOcclusion
Returns the value of theambientOcclusion
record component.- Specified by:
ambientOcclusion
in interfaceUnbakedModel
- Returns:
- the value of the
ambientOcclusion
record component
-
transforms
Returns the value of thetransforms
record component.- Specified by:
transforms
in interfaceUnbakedModel
- Returns:
- the value of the
transforms
record component
-
textureSlots
Returns the value of thetextureSlots
record component.- Specified by:
textureSlots
in interfaceUnbakedModel
- Returns:
- the value of the
textureSlots
record component
-
parent
Returns the value of theparent
record component.- Specified by:
parent
in interfaceUnbakedModel
- Returns:
- the value of the
parent
record component
-
rootTransform
Returns the value of therootTransform
record component.- Returns:
- the value of the
rootTransform
record component
-
renderTypeGroup
Returns the value of therenderTypeGroup
record component.- Returns:
- the value of the
renderTypeGroup
record component
-
partVisibility
Returns the value of thepartVisibility
record component.- Returns:
- the value of the
partVisibility
record component
-
UnbakedModelParser.parse(Reader)
instead