Record Class MemoryCondition.Present<Value>
java.lang.Object
java.lang.Record
net.minecraft.world.entity.ai.behavior.declarative.MemoryCondition.Present<Value>
- All Implemented Interfaces:
MemoryCondition<com.mojang.datafixers.kinds.IdF.Mu,
Value>
- Enclosing interface:
MemoryCondition<F extends com.mojang.datafixers.kinds.K1,
Value>
public static record MemoryCondition.Present<Value>(MemoryModuleType<Value> memory)
extends Record
implements MemoryCondition<com.mojang.datafixers.kinds.IdF.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
ConstructorDescriptionPresent
(MemoryModuleType<Value> memory) Creates an instance of aPresent
record class. -
Method Summary
Modifier and TypeMethodDescriptionMemoryAccessor<com.mojang.datafixers.kinds.IdF.Mu,
Value> createAccessor
(Brain<?> p_259253_, Optional<Value> p_260268_) 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
-
Present
Creates an instance of aPresent
record class.- Parameters:
memory
- the value for thememory
record component
-
-
Method Details
-
condition
- Specified by:
condition
in interfaceMemoryCondition<com.mojang.datafixers.kinds.IdF.Mu,
Value>
-
createAccessor
public MemoryAccessor<com.mojang.datafixers.kinds.IdF.Mu,Value> createAccessor(Brain<?> p_259253_, Optional<Value> p_260268_) - Specified by:
createAccessor
in interfaceMemoryCondition<com.mojang.datafixers.kinds.IdF.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 thememory
record component.- Specified by:
memory
in interfaceMemoryCondition<com.mojang.datafixers.kinds.IdF.Mu,
Value> - Returns:
- the value of the
memory
record component
-