Record Class ActivityData<E extends LivingEntity>

java.lang.Object
java.lang.Record
net.minecraft.world.entity.ai.ActivityData<E>

public record ActivityData<E extends LivingEntity>(Activity activityType, com.google.common.collect.ImmutableList<? extends Pair<Integer, ? extends BehaviorControl<? super E extends LivingEntity>>> behaviorPriorityPairs, Set<Pair<MemoryModuleType<?>, MemoryStatus>> conditions, Set<MemoryModuleType<?>> memoriesToEraseWhenStopped) extends Record
  • Field Details

    • activityType

      private final Activity activityType
      The field for the activityType record component.
    • behaviorPriorityPairs

      private final com.google.common.collect.ImmutableList<? extends Pair<Integer, ? extends BehaviorControl<? super E extends LivingEntity>>> behaviorPriorityPairs
      The field for the behaviorPriorityPairs record component.
    • conditions

      private final Set<Pair<MemoryModuleType<?>, MemoryStatus>> conditions
      The field for the conditions record component.
    • memoriesToEraseWhenStopped

      private final Set<MemoryModuleType<?>> memoriesToEraseWhenStopped
      The field for the memoriesToEraseWhenStopped record component.
  • Constructor Details

    • ActivityData

      public ActivityData(Activity activityType, com.google.common.collect.ImmutableList<? extends Pair<Integer, ? extends BehaviorControl<? super E>>> behaviorPriorityPairs, Set<Pair<MemoryModuleType<?>, MemoryStatus>> conditions, Set<MemoryModuleType<?>> memoriesToEraseWhenStopped)
      Creates an instance of a ActivityData record class.
      Parameters:
      activityType - the value for the activityType record component
      behaviorPriorityPairs - the value for the behaviorPriorityPairs record component
      conditions - the value for the conditions record component
      memoriesToEraseWhenStopped - the value for the memoriesToEraseWhenStopped record component
  • Method Details

    • create

      public static <E extends LivingEntity> ActivityData<E> create(Activity activity, int priorityOfFirstBehavior, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> behaviorList)
    • create

      public static <E extends LivingEntity> ActivityData<E> create(Activity activity, int priorityOfFirstBehavior, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> behaviorList, MemoryModuleType<?> memoryThatMustHaveValueAndWillBeErasedAfter)
    • create

      public static <E extends LivingEntity> ActivityData<E> create(Activity activity, com.google.common.collect.ImmutableList<? extends Pair<Integer, ? extends BehaviorControl<? super E>>> behaviorPriorityPairs)
    • create

      public static <E extends LivingEntity> ActivityData<E> create(Activity activity, int priorityOfFirstBehavior, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> behaviorList, Set<Pair<MemoryModuleType<?>, MemoryStatus>> conditions)
    • create

      public static <E extends LivingEntity> ActivityData<E> create(Activity activity, com.google.common.collect.ImmutableList<? extends Pair<Integer, ? extends BehaviorControl<? super E>>> behaviorPriorityPairs, Set<Pair<MemoryModuleType<?>, MemoryStatus>> conditions)
    • create

      public static <E extends LivingEntity> ActivityData<E> create(Activity activity, com.google.common.collect.ImmutableList<? extends Pair<Integer, ? extends BehaviorControl<? super E>>> behaviorPriorityPairs, Set<Pair<MemoryModuleType<?>, MemoryStatus>> conditions, Set<MemoryModuleType<?>> memoriesToEraseWhenStopped)
    • createPriorityPairs

      public static <E extends LivingEntity> com.google.common.collect.ImmutableList<? extends Pair<Integer, ? extends BehaviorControl<? super E>>> createPriorityPairs(int priorityOfFirstBehavior, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> behaviorList)
    • 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 o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • activityType

      public Activity activityType()
      Returns the value of the activityType record component.
      Returns:
      the value of the activityType record component
    • behaviorPriorityPairs

      public com.google.common.collect.ImmutableList<? extends Pair<Integer, ? extends BehaviorControl<? super E>>> behaviorPriorityPairs()
      Returns the value of the behaviorPriorityPairs record component.
      Returns:
      the value of the behaviorPriorityPairs record component
    • conditions

      public Set<Pair<MemoryModuleType<?>, MemoryStatus>> conditions()
      Returns the value of the conditions record component.
      Returns:
      the value of the conditions record component
    • memoriesToEraseWhenStopped

      public Set<MemoryModuleType<?>> memoriesToEraseWhenStopped()
      Returns the value of the memoriesToEraseWhenStopped record component.
      Returns:
      the value of the memoriesToEraseWhenStopped record component