Record Class BlockModelDefinition
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.block.model.BlockModelDefinition
public record BlockModelDefinition(Optional<BlockModelDefinition.SimpleModelSelectors> simpleModels, Optional<BlockModelDefinition.MultiPartDefinition> multiPart, Optional<CustomBlockModelDefinition> customDefinition)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BlockModelDefinition> private final Optional<CustomBlockModelDefinition> The field for thecustomDefinitionrecord component.(package private) static final org.slf4j.Loggerprivate final Optional<BlockModelDefinition.MultiPartDefinition> The field for themultiPartrecord component.private final Optional<BlockModelDefinition.SimpleModelSelectors> The field for thesimpleModelsrecord component.static final com.mojang.serialization.MapCodec<BlockModelDefinition> -
Constructor Summary
ConstructorsConstructorDescriptionBlockModelDefinition(Optional<BlockModelDefinition.SimpleModelSelectors> simpleModels, Optional<BlockModelDefinition.MultiPartDefinition> multiPart) BlockModelDefinition(Optional<BlockModelDefinition.SimpleModelSelectors> simpleModels, Optional<BlockModelDefinition.MultiPartDefinition> multiPart, Optional<CustomBlockModelDefinition> customDefinition) Creates an instance of aBlockModelDefinitionrecord class.BlockModelDefinition(CustomBlockModelDefinition customDefinition) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecustomDefinitionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.instantiate(StateDefinition<Block, BlockState> pStateDefinition, Supplier<String> pSourceSupplier) instantiateVanilla(StateDefinition<Block, BlockState> p_360641_, Supplier<String> p_405739_) Returns the value of themultiPartrecord component.Returns the value of thesimpleModelsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
simpleModels
The field for thesimpleModelsrecord component. -
multiPart
The field for themultiPartrecord component. -
customDefinition
The field for thecustomDefinitionrecord component. -
LOGGER
static final org.slf4j.Logger LOGGER -
VANILLA_CODEC
-
CODEC
-
-
Constructor Details
-
BlockModelDefinition
public BlockModelDefinition(Optional<BlockModelDefinition.SimpleModelSelectors> simpleModels, Optional<BlockModelDefinition.MultiPartDefinition> multiPart) -
BlockModelDefinition
-
BlockModelDefinition
public BlockModelDefinition(Optional<BlockModelDefinition.SimpleModelSelectors> simpleModels, Optional<BlockModelDefinition.MultiPartDefinition> multiPart, Optional<CustomBlockModelDefinition> customDefinition) Creates an instance of aBlockModelDefinitionrecord class.- Parameters:
simpleModels- the value for thesimpleModelsrecord componentmultiPart- the value for themultiPartrecord componentcustomDefinition- the value for thecustomDefinitionrecord component
-
-
Method Details
-
instantiate
public Map<BlockState,BlockStateModel.UnbakedRoot> instantiate(StateDefinition<Block, BlockState> pStateDefinition, Supplier<String> pSourceSupplier) -
instantiateVanilla
public Map<BlockState,BlockStateModel.UnbakedRoot> instantiateVanilla(StateDefinition<Block, BlockState> p_360641_, Supplier<String> p_405739_) -
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). -
simpleModels
Returns the value of thesimpleModelsrecord component.- Returns:
- the value of the
simpleModelsrecord component
-
multiPart
Returns the value of themultiPartrecord component.- Returns:
- the value of the
multiPartrecord component
-
customDefinition
Returns the value of thecustomDefinitionrecord component.- Returns:
- the value of the
customDefinitionrecord component
-