Record Class FeatureFlagsEnabledCondition
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.conditions.FeatureFlagsEnabledCondition
- All Implemented Interfaces:
ICondition
public record FeatureFlagsEnabledCondition(net.minecraft.world.flag.FeatureFlagSet flags)
extends Record
implements ICondition
Condition checking that a set of
feature flags
are enabled.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.neoforged.neoforge.common.conditions.ICondition
ICondition.IContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<FeatureFlagsEnabledCondition> private final net.minecraft.world.flag.FeatureFlagSet
The field for theflags
record component.Fields inherited from interface net.neoforged.neoforge.common.conditions.ICondition
LIST_CODEC
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureFlagsEnabledCondition
(net.minecraft.world.flag.FeatureFlagSet flags) Creates an instance of aFeatureFlagsEnabledCondition
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<? extends ICondition> codec()
final boolean
Indicates whether some other object is "equal to" this one.net.minecraft.world.flag.FeatureFlagSet
flags()
Returns the value of theflags
record component.final int
hashCode()
Returns a hash code value for this object.boolean
test
(ICondition.IContext context) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
flags
private final net.minecraft.world.flag.FeatureFlagSet flagsThe field for theflags
record component. -
CODEC
-
-
Constructor Details
-
FeatureFlagsEnabledCondition
public FeatureFlagsEnabledCondition(net.minecraft.world.flag.FeatureFlagSet flags) Creates an instance of aFeatureFlagsEnabledCondition
record class.- Parameters:
flags
- the value for theflags
record component
-
-
Method Details
-
test
- Specified by:
test
in interfaceICondition
-
codec
- Specified by:
codec
in interfaceICondition
-
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)
. -
flags
public net.minecraft.world.flag.FeatureFlagSet flags()Returns the value of theflags
record component.- Returns:
- the value of the
flags
record component
-