Record Class MemoryQuery.Optional<Value>

java.lang.Object
java.lang.Record
net.minecraft.entity.ai.brain.MemoryQuery.Optional<Value>
Record Components:
memory -
All Implemented Interfaces:
MemoryQuery<com.mojang.datafixers.kinds.OptionalBox.Mu,Value>
Enclosing interface:
MemoryQuery<F extends com.mojang.datafixers.kinds.K1,Value>

public static record MemoryQuery.Optional<Value>(MemoryModuleType<Value> memory) extends Record implements MemoryQuery<com.mojang.datafixers.kinds.OptionalBox.Mu,Value>
A query that always succeeds. The value is an optional that contains the value if it is present in the memory.
See Also:
Mappings:
Namespace Name
official bkz$c
intermediary net/minecraft/class_7907$class_7910
named net/minecraft/entity/ai/brain/MemoryQuery$Optional
official a
intermediary comp_1151
named memory
  • Field Details

  • Constructor Details

  • Method Details

    • getState

      public MemoryModuleState getState()
      Specified by:
      getState in interface MemoryQuery<com.mojang.datafixers.kinds.OptionalBox.Mu,Value>
      Mappings:
      Namespace Name Mixin selector
      official b Lbkz;b()Lbow;
      intermediary method_47254 Lnet/minecraft/class_7907;method_47254()Lnet/minecraft/class_4141;
      named getState Lnet/minecraft/entity/ai/brain/MemoryQuery;getState()Lnet/minecraft/entity/ai/brain/MemoryModuleState;
    • toQueryResult

      public MemoryQueryResult<com.mojang.datafixers.kinds.OptionalBox.Mu,Value> toQueryResult(Brain<?> brain, Optional<Value> value)
      Mappings:
      Namespace Name Mixin selector
      official a Lbkz;a(Lbgu;Ljava/util/Optional;)Lbky;
      intermediary method_47253 Lnet/minecraft/class_7907;method_47253(Lnet/minecraft/class_4095;Ljava/util/Optional;)Lnet/minecraft/class_7906;
      named toQueryResult Lnet/minecraft/entity/ai/brain/MemoryQuery;toQueryResult(Lnet/minecraft/entity/ai/brain/Brain;Ljava/util/Optional;)Lnet/minecraft/entity/ai/brain/MemoryQueryResult;
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • memory

      public MemoryModuleType<Value> memory()
      Specified by:
      memory in interface MemoryQuery<com.mojang.datafixers.kinds.OptionalBox.Mu,Value>
      Mappings:
      Namespace Name Mixin selector
      official a Lbkz;a()Lbov;
      intermediary comp_1151 Lnet/minecraft/class_7907;comp_1151()Lnet/minecraft/class_4140;
      named memory Lnet/minecraft/entity/ai/brain/MemoryQuery;memory()Lnet/minecraft/entity/ai/brain/MemoryModuleType;