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
Modifier and TypeFieldDescriptionprivate final MemoryModuleType
<Value> The field for thememory
record component. -
Constructor Summary
ConstructorDescriptionRegistered
(MemoryModuleType<Value> memory) Creates an instance of aRegistered
record class. -
Method Summary
Modifier and TypeMethodDescriptionMemoryAccessor
<com.mojang.datafixers.kinds.OptionalBox.Mu, Value> createAccessor
(Brain<?> p_260149_, Optional<Value> p_259303_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.memory()
Returns the value of thememory
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
memory
The field for thememory
record component.
-
-
Constructor Details
-
Registered
Creates an instance of aRegistered
record class.- Parameters:
memory
- the value for thememory
record component
-
-
Method Details
-
condition
- Specified by:
condition
in 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:
createAccessor
in interfaceMemoryCondition<com.mojang.datafixers.kinds.OptionalBox.Mu,
Value>
-
memory
Returns the value of thememory
record component.- Specified by:
memory
in interfaceMemoryCondition<com.mojang.datafixers.kinds.OptionalBox.Mu,
Value> - Returns:
- the value of the
memory
record component
-
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)
.
-