Record Class RuleBasedBlockStateProvider
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.stateproviders.RuleBasedBlockStateProvider
public record RuleBasedBlockStateProvider(BlockStateProvider fallback, List<RuleBasedBlockStateProvider.Rule> rules)
extends Record
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RuleBasedBlockStateProvider>
private final BlockStateProvider
The field for thefallback
record component.private final List<RuleBasedBlockStateProvider.Rule>
The field for therules
record component. -
Constructor Summary
ConstructorDescriptionRuleBasedBlockStateProvider
(BlockStateProvider fallback, List<RuleBasedBlockStateProvider.Rule> rules) Creates an instance of aRuleBasedBlockStateProvider
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.fallback()
Returns the value of thefallback
record component.getState
(WorldGenLevel p_225933_, RandomSource p_225934_, BlockPos p_225935_) final int
hashCode()
Returns a hash code value for this object.rules()
Returns the value of therules
record component.static RuleBasedBlockStateProvider
static RuleBasedBlockStateProvider
simple
(BlockStateProvider p_225941_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
fallback
The field for thefallback
record component. -
rules
The field for therules
record component. -
CODEC
-
-
Constructor Details
-
RuleBasedBlockStateProvider
public RuleBasedBlockStateProvider(BlockStateProvider fallback, List<RuleBasedBlockStateProvider.Rule> rules) Creates an instance of aRuleBasedBlockStateProvider
record class.- Parameters:
fallback
- the value for thefallback
record componentrules
- the value for therules
record component
-
-
Method Details
-
simple
-
simple
-
getState
-
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)
. -
fallback
Returns the value of thefallback
record component.- Returns:
- the value of the
fallback
record component
-
rules
Returns the value of therules
record component.- Returns:
- the value of the
rules
record component
-