Record Class MemoryCondition.Registered<Value>
java.lang.Object
java.lang.Record
net.minecraft.world.entity.ai.behavior.declarative.MemoryCondition.Registered<Value>
- All Implemented Interfaces:
MemoryCondition<com.mojang.datafixers.kinds.OptionalBox.Mu,Value>
- Enclosing interface:
- MemoryCondition<F extends com.mojang.datafixers.kinds.K1,
Value>
public static record MemoryCondition.Registered<Value>(MemoryModuleType<Value> memory)
extends Record
implements MemoryCondition<com.mojang.datafixers.kinds.OptionalBox.Mu,Value>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.entity.ai.behavior.declarative.MemoryCondition
MemoryCondition.Absent<Value>, MemoryCondition.Present<Value>, MemoryCondition.Registered<Value> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MemoryModuleType<Value>The field for thememoryrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRegistered(MemoryModuleType<Value> memory) Creates an instance of aRegisteredrecord class. -
Method Summary
Modifier and TypeMethodDescriptionMemoryAccessor<com.mojang.datafixers.kinds.OptionalBox.Mu,Value> createAccessor(Brain<?> p_260149_, Optional<Value> p_259303_) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.memory()Returns the value of thememoryrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
memory
The field for thememoryrecord component.
-
-
Constructor Details
-
Registered
Creates an instance of aRegisteredrecord class.- Parameters:
memory- the value for thememoryrecord component
-
-
Method Details
-
condition
- Specified by:
conditionin interfaceMemoryCondition<com.mojang.datafixers.kinds.OptionalBox.Mu,Value>
-
createAccessor
public MemoryAccessor<com.mojang.datafixers.kinds.OptionalBox.Mu,Value> createAccessor(Brain<?> p_260149_, Optional<Value> p_259303_) - Specified by:
createAccessorin interfaceMemoryCondition<com.mojang.datafixers.kinds.OptionalBox.Mu,Value>
-
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). -
memory
Returns the value of thememoryrecord component.- Specified by:
memoryin interfaceMemoryCondition<com.mojang.datafixers.kinds.OptionalBox.Mu,Value> - Returns:
- the value of the
memoryrecord component
-