Record Class RuleBasedBlockStateProvider
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.stateproviders.RuleBasedBlockStateProvider
public record RuleBasedBlockStateProvider(@Nullable BlockStateProvider fallback, List<RuleBasedBlockStateProvider.Rule> rules)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RuleBasedBlockStateProvider> private final @Nullable BlockStateProviderThe field for thefallbackrecord component.private final List<RuleBasedBlockStateProvider.Rule> The field for therulesrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRuleBasedBlockStateProvider(Optional<BlockStateProvider> fallback, List<RuleBasedBlockStateProvider.Rule> rules) RuleBasedBlockStateProvider(@Nullable BlockStateProvider fallback, List<RuleBasedBlockStateProvider.Rule> rules) Creates an instance of aRuleBasedBlockStateProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic RuleBasedBlockStateProviderstatic RuleBasedBlockStateProvideralways(BlockStateProvider provider) final booleanIndicates whether some other object is "equal to" this one.@Nullable BlockStateProviderfallback()Returns the value of thefallbackrecord component.@Nullable BlockStategetState(WorldGenLevel level, RandomSource random, BlockPos pos) final inthashCode()Returns a hash code value for this object.static RuleBasedBlockStateProviderifTrueThenProvide(BlockPredicate ifTrue, Block thenProvide) static RuleBasedBlockStateProviderifTrueThenProvide(BlockPredicate ifTrue, BlockStateProvider thenProvide) rules()Returns the value of therulesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
fallback
The field for thefallbackrecord component. -
rules
The field for therulesrecord component. -
CODEC
-
-
Constructor Details
-
RuleBasedBlockStateProvider
private RuleBasedBlockStateProvider(Optional<BlockStateProvider> fallback, List<RuleBasedBlockStateProvider.Rule> rules) -
RuleBasedBlockStateProvider
public RuleBasedBlockStateProvider(@Nullable BlockStateProvider fallback, List<RuleBasedBlockStateProvider.Rule> rules) Creates an instance of aRuleBasedBlockStateProviderrecord class.- Parameters:
fallback- the value for thefallbackrecord componentrules- the value for therulesrecord component
-
-
Method Details
-
always
-
always
-
ifTrueThenProvide
public static RuleBasedBlockStateProvider ifTrueThenProvide(BlockPredicate ifTrue, Block thenProvide) -
ifTrueThenProvide
public static RuleBasedBlockStateProvider ifTrueThenProvide(BlockPredicate ifTrue, BlockStateProvider thenProvide) -
getState
-
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). -
fallback
Returns the value of thefallbackrecord component.- Returns:
- the value of the
fallbackrecord component
-
rules
Returns the value of therulesrecord component.- Returns:
- the value of the
rulesrecord component
-