Record Class SurfaceRules.BlockRuleSource
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.SurfaceRules.BlockRuleSource
- All Implemented Interfaces:
- Function<SurfaceRules.Context,,- SurfaceRules.SurfaceRule> - SurfaceRules.RuleSource
- Enclosing class:
- SurfaceRules
static record SurfaceRules.BlockRuleSource(BlockState resultState, SurfaceRules.StateRule rule)
extends Record
implements SurfaceRules.RuleSource
- 
Field SummaryFieldsModifier and TypeFieldDescription(package private) static final KeyDispatchDataCodec<SurfaceRules.BlockRuleSource>private final BlockStateThe field for theresultStaterecord component.private final SurfaceRules.StateRuleThe field for therulerecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionBlockRuleSource(BlockState p_189517_) BlockRuleSource(BlockState resultState, SurfaceRules.StateRule rule) Creates an instance of aBlockRuleSourcerecord class.
- 
Method SummaryModifier and TypeMethodDescriptionapply(SurfaceRules.Context p_189523_) KeyDispatchDataCodec<? extends SurfaceRules.RuleSource>codec()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.rule()Returns the value of therulerecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
resultStateThe field for theresultStaterecord component.
- 
ruleThe field for therulerecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
BlockRuleSourceBlockRuleSource(BlockState p_189517_) 
- 
BlockRuleSourceBlockRuleSource(BlockState resultState, SurfaceRules.StateRule rule) Creates an instance of aBlockRuleSourcerecord class.- Parameters:
- resultState- the value for the- resultStaterecord component
- rule- the value for the- rulerecord component
 
 
- 
- 
Method Details- 
codec- Specified by:
- codecin interface- SurfaceRules.RuleSource
 
- 
apply- Specified by:
- applyin interface- Function<SurfaceRules.Context,- SurfaceRules.SurfaceRule> 
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
resultStateReturns the value of theresultStaterecord component.- Returns:
- the value of the resultStaterecord component
 
- 
ruleReturns the value of therulerecord component.- Returns:
- the value of the rulerecord component
 
 
-