Record Class FeatureFlagsEnabledCondition
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.conditions.FeatureFlagsEnabledCondition
- All Implemented Interfaces:
ICondition
public record FeatureFlagsEnabledCondition(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 FeatureFlagSetThe field for theflagsrecord component.Fields inherited from interface net.neoforged.neoforge.common.conditions.ICondition
LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aFeatureFlagsEnabledConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends ICondition> codec()final booleanIndicates whether some other object is "equal to" this one.flags()Returns the value of theflagsrecord component.final inthashCode()Returns a hash code value for this object.booleantest(ICondition.IContext context) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
flags
The field for theflagsrecord component. -
CODEC
-
-
Constructor Details
-
FeatureFlagsEnabledCondition
Creates an instance of aFeatureFlagsEnabledConditionrecord class.- Parameters:
flags- the value for theflagsrecord component
-
-
Method Details
-
test
- Specified by:
testin interfaceICondition
-
codec
- Specified by:
codecin 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
Returns the value of theflagsrecord component.- Returns:
- the value of the
flagsrecord component
-