Record Class RegisteredCondition<T>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.conditions.RegisteredCondition<T>
- All Implemented Interfaces:
ICondition
public record RegisteredCondition<T>(ResourceKey<T> registryKey)
extends Record
implements ICondition
-
Nested Class Summary
Nested classes/interfaces inherited from interface ICondition
ICondition.IContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RegisteredCondition<?>> private final ResourceKey<T> The field for theregistryKeyrecord component.Fields inherited from interface ICondition
LIST_CODEC -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRegisteredCondition(Identifier registryType, Identifier registryName) RegisteredCondition(ResourceKey<T> registryKey) Creates an instance of aRegisteredConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends ICondition> 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 theregistryKeyrecord component.booleantest(ICondition.IContext context) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
registryKey
The field for theregistryKeyrecord component. -
CODEC
-
-
Constructor Details
-
RegisteredCondition
-
RegisteredCondition
Creates an instance of aRegisteredConditionrecord class.- Parameters:
registryKey- the value for theregistryKeyrecord component
-
-
Method Details
-
test
- Specified by:
testin interfaceICondition
-
codec
- Specified by:
codecin interfaceICondition
-
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). -
registryKey
Returns the value of theregistryKeyrecord component.- Returns:
- the value of the
registryKeyrecord component
-