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.ResolverNested classes/interfaces inherited from interface net.minecraft.client.resources.model.UnbakedModel
UnbakedModel.GuiLight -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BooleanThe field for theambientOcclusionrecord component.private final UnbakedGeometryThe field for thegeometryrecord component.static final Gsonprivate final UnbakedModel.GuiLightThe field for theguiLightrecord component.private final ResourceLocationThe field for theparentrecord component.The field for thepartVisibilityrecord component.private final RenderTypeGroupThe field for therenderTypeGrouprecord component.private final TransformationThe field for therootTransformrecord component.private final TextureSlots.DataThe field for thetextureSlotsrecord component.private final ItemTransformsThe field for thetransformsrecord 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 aBlockModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theambientOcclusionrecord component.final booleanIndicates whether some other object is "equal to" this one.voidfillAdditionalProperties(ContextMap.Builder propertiesBuilder) Appends additional properties for this model to the builder.static BlockModelfromStream(Reader pReader) Deprecated.geometry()Returns the value of thegeometryrecord component.guiLight()Returns the value of theguiLightrecord component.final inthashCode()Returns a hash code value for this object.parent()Returns the value of theparentrecord component.Returns the value of thepartVisibilityrecord component.Returns the value of therenderTypeGrouprecord component.Returns the value of therootTransformrecord component.Returns the value of thetextureSlotsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransformsrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.client.extensions.UnbakedModelExtension
resolveDependencies
-
Field Details
-
geometry
The field for thegeometryrecord component. -
guiLight
The field for theguiLightrecord component. -
ambientOcclusion
The field for theambientOcclusionrecord component. -
transforms
The field for thetransformsrecord component. -
textureSlots
The field for thetextureSlotsrecord component. -
parent
The field for theparentrecord component. -
rootTransform
The field for therootTransformrecord component. -
renderTypeGroup
The field for therenderTypeGrouprecord component. -
partVisibility
The field for thepartVisibilityrecord component. -
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 aBlockModelrecord class.- Parameters:
geometry- the value for thegeometryrecord componentguiLight- the value for theguiLightrecord componentambientOcclusion- the value for theambientOcclusionrecord componenttransforms- the value for thetransformsrecord componenttextureSlots- the value for thetextureSlotsrecord componentparent- the value for theparentrecord componentrootTransform- the value for therootTransformrecord componentrenderTypeGroup- the value for therenderTypeGrouprecord componentpartVisibility- the value for thepartVisibilityrecord component
-
-
Method Details
-
fromStream
Deprecated.Neo: useUnbakedModelParser.parse(Reader)instead -
fillAdditionalProperties
Description copied from interface:UnbakedModelExtensionAppends 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:
fillAdditionalPropertiesin 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 thegeometryrecord component.- Specified by:
geometryin interfaceUnbakedModel- Returns:
- the value of the
geometryrecord component
-
guiLight
Returns the value of theguiLightrecord component.- Specified by:
guiLightin interfaceUnbakedModel- Returns:
- the value of the
guiLightrecord component
-
ambientOcclusion
Returns the value of theambientOcclusionrecord component.- Specified by:
ambientOcclusionin interfaceUnbakedModel- Returns:
- the value of the
ambientOcclusionrecord component
-
transforms
Returns the value of thetransformsrecord component.- Specified by:
transformsin interfaceUnbakedModel- Returns:
- the value of the
transformsrecord component
-
textureSlots
Returns the value of thetextureSlotsrecord component.- Specified by:
textureSlotsin interfaceUnbakedModel- Returns:
- the value of the
textureSlotsrecord component
-
parent
Returns the value of theparentrecord component.- Specified by:
parentin interfaceUnbakedModel- Returns:
- the value of the
parentrecord component
-
rootTransform
Returns the value of therootTransformrecord component.- Returns:
- the value of the
rootTransformrecord component
-
renderTypeGroup
Returns the value of therenderTypeGrouprecord component.- Returns:
- the value of the
renderTypeGrouprecord component
-
partVisibility
Returns the value of thepartVisibilityrecord component.- Returns:
- the value of the
partVisibilityrecord component
-
UnbakedModelParser.parse(Reader)instead