Record Class BlockRule
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.material.rule.BlockRule
- All Implemented Interfaces:
MaterialRule, RuleEvaluator
public record BlockRule(BlockState resultState)
extends Record
implements MaterialRule, RuleEvaluator
-
Nested Class Summary
Nested classes/interfaces inherited from interface MaterialRule
MaterialRule.HolderHolder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BlockRule> private final BlockStateThe field for theresultStaterecord component.Fields inherited from interface MaterialRule
DIRECT_CODEC, HOLDER_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionBlockRule(BlockState resultState) Creates an instance of aBlockRulerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<BlockRule> codec()compile(MaterialRuleContext context) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theresultStaterecord component.final StringtoString()Returns a string representation of this record class.tryApply(int blockX, int blockY, int blockZ)
-
Field Details
-
resultState
The field for theresultStaterecord component. -
CODEC
-
-
Constructor Details
-
BlockRule
Creates an instance of aBlockRulerecord class.- Parameters:
resultState- the value for theresultStaterecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceMaterialRule
-
compile
- Specified by:
compilein interfaceMaterialRule
-
tryApply
- Specified by:
tryApplyin interfaceRuleEvaluator
-
toString
-
hashCode
-
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). -
resultState
Returns the value of theresultStaterecord component.- Returns:
- the value of the
resultStaterecord component
-