Class PrepareRamTask<E extends PathAwareEntity>

java.lang.Object
net.minecraft.entity.ai.brain.task.MultiTickTask<E>
net.minecraft.entity.ai.brain.task.PrepareRamTask<E>
Type Parameters:
E - the task owner, usually a goat
All Implemented Interfaces:
Task<E>

public class PrepareRamTask<E extends PathAwareEntity> extends MultiTickTask<E>
The task where an entity finds a target, a place to start its ram, and wait to start its ram.
Mappings:
Namespace Name
official bjd
intermediary net/minecraft/class_6336
named net/minecraft/entity/ai/brain/task/PrepareRamTask
  • Field Details

    • RUN_TIME

      public static final int RUN_TIME
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official c Lbjd;c:I
      intermediary field_33461 Lnet/minecraft/class_6336;field_33461:I
      named RUN_TIME Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;RUN_TIME:I
    • cooldownFactory

      private final ToIntFunction<E extends PathAwareEntity> cooldownFactory
      Mappings:
      Namespace Name Mixin selector
      official d Lbjd;d:Ljava/util/function/ToIntFunction;
      intermediary field_33462 Lnet/minecraft/class_6336;field_33462:Ljava/util/function/ToIntFunction;
      named cooldownFactory Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;cooldownFactory:Ljava/util/function/ToIntFunction;
    • minRamDistance

      private final int minRamDistance
      Mappings:
      Namespace Name Mixin selector
      official e Lbjd;e:I
      intermediary field_33463 Lnet/minecraft/class_6336;field_33463:I
      named minRamDistance Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;minRamDistance:I
    • maxRamDistance

      private final int maxRamDistance
      Mappings:
      Namespace Name Mixin selector
      official f Lbjd;f:I
      intermediary field_33464 Lnet/minecraft/class_6336;field_33464:I
      named maxRamDistance Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;maxRamDistance:I
    • speed

      private final float speed
      Mappings:
      Namespace Name Mixin selector
      official g Lbjd;g:F
      intermediary field_33465 Lnet/minecraft/class_6336;field_33465:F
      named speed Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;speed:F
    • targetPredicate

      private final TargetPredicate targetPredicate
      Mappings:
      Namespace Name Mixin selector
      official h Lbjd;h:Lbqk;
      intermediary field_33466 Lnet/minecraft/class_6336;field_33466:Lnet/minecraft/class_4051;
      named targetPredicate Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;targetPredicate:Lnet/minecraft/entity/ai/TargetPredicate;
    • prepareTime

      private final int prepareTime
      Mappings:
      Namespace Name Mixin selector
      official i Lbjd;i:I
      intermediary field_33467 Lnet/minecraft/class_6336;field_33467:I
      named prepareTime Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;prepareTime:I
    • soundFactory

      private final Function<E extends PathAwareEntity,SoundEvent> soundFactory
      Mappings:
      Namespace Name Mixin selector
      official j Lbjd;j:Ljava/util/function/Function;
      intermediary field_33468 Lnet/minecraft/class_6336;field_33468:Ljava/util/function/Function;
      named soundFactory Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;soundFactory:Ljava/util/function/Function;
    • prepareStartTime

      private Optional<Long> prepareStartTime
      Mappings:
      Namespace Name Mixin selector
      official k Lbjd;k:Ljava/util/Optional;
      intermediary field_33469 Lnet/minecraft/class_6336;field_33469:Ljava/util/Optional;
      named prepareStartTime Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;prepareStartTime:Ljava/util/Optional;
    • ram

      Mappings:
      Namespace Name Mixin selector
      official l Lbjd;l:Ljava/util/Optional;
      intermediary field_33470 Lnet/minecraft/class_6336;field_33470:Ljava/util/Optional;
      named ram Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;ram:Ljava/util/Optional;
  • Constructor Details

    • PrepareRamTask

      public PrepareRamTask(ToIntFunction<E> cooldownFactory, int minDistance, int maxDistance, float speed, TargetPredicate targetPredicate, int prepareTime, Function<E,SoundEvent> soundFactory)
      Creates a ram preparation task. It has a fixed run time of 160.
      Parameters:
      cooldownFactory - the factory for the cooldown, in ticks, of the ram task, given the entity
      minDistance - the min manhattan distance from the ram starting location to the ram target
      maxDistance - the max straight-line distance from the ram starting location to the ram target
      speed - the speed the entity walks at
      targetPredicate - the predicate for the ram target
      prepareTime - the prepare time, in ticks, the entity will stand between reaching the ram start position and the start of the ram
      soundFactory - the factory of the ram prepare sound given the entity
      Mappings:
      Namespace Name Mixin selector
      official <init> Lbjd;<init>(Ljava/util/function/ToIntFunction;IIFLbqk;ILjava/util/function/Function;)V
      intermediary <init> Lnet/minecraft/class_6336;<init>(Ljava/util/function/ToIntFunction;IIFLnet/minecraft/class_4051;ILjava/util/function/Function;)V
      named <init> Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;<init>(Ljava/util/function/ToIntFunction;IIFLnet/minecraft/entity/ai/TargetPredicate;ILjava/util/function/Function;)V
  • Method Details

    • run

      protected void run(ServerWorld serverWorld, PathAwareEntity pathAwareEntity, long long2)
      Overrides:
      run in class MultiTickTask<E extends PathAwareEntity>
      Mappings:
      Namespace Name Mixin selector
      official a Lbjd;a(Laip;Lbgg;J)V
      intermediary method_36260 Lnet/minecraft/class_6336;method_36260(Lnet/minecraft/class_3218;Lnet/minecraft/class_1314;J)V
      named run Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;run(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/mob/PathAwareEntity;J)V
    • finishRunning

      protected void finishRunning(ServerWorld serverWorld, E e, long long2)
      Overrides:
      finishRunning in class MultiTickTask<E extends PathAwareEntity>
      Mappings:
      Namespace Name Mixin selector
      official b Lbjd;b(Laip;Lbgg;J)V
      intermediary method_36267 Lnet/minecraft/class_6336;method_36267(Lnet/minecraft/class_3218;Lnet/minecraft/class_1314;J)V
      named finishRunning Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;finishRunning(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/mob/PathAwareEntity;J)V
    • shouldKeepRunning

      protected boolean shouldKeepRunning(ServerWorld serverWorld, PathAwareEntity pathAwareEntity, long long2)
      Overrides:
      shouldKeepRunning in class MultiTickTask<E extends PathAwareEntity>
      Mappings:
      Namespace Name Mixin selector
      official c Lbjd;c(Laip;Lbgg;J)Z
      intermediary method_36269 Lnet/minecraft/class_6336;method_36269(Lnet/minecraft/class_3218;Lnet/minecraft/class_1314;J)Z
      named shouldKeepRunning Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;shouldKeepRunning(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/mob/PathAwareEntity;J)Z
    • keepRunning

      protected void keepRunning(ServerWorld serverWorld, E e, long long2)
      Overrides:
      keepRunning in class MultiTickTask<E extends PathAwareEntity>
      Mappings:
      Namespace Name Mixin selector
      official d Lbjd;d(Laip;Lbgg;J)V
      intermediary method_36271 Lnet/minecraft/class_6336;method_36271(Lnet/minecraft/class_3218;Lnet/minecraft/class_1314;J)V
      named keepRunning Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;keepRunning(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/mob/PathAwareEntity;J)V
    • calculateRamTarget

      private Vec3d calculateRamTarget(BlockPos start, BlockPos end)
      Mappings:
      Namespace Name Mixin selector
      official a Lbjd;a(Lgt;Lgt;)Lede;
      intermediary method_36266 Lnet/minecraft/class_6336;method_36266(Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Lnet/minecraft/class_243;
      named calculateRamTarget Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;calculateRamTarget(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/Vec3d;
    • findRamStart

      private Optional<BlockPos> findRamStart(PathAwareEntity entity, LivingEntity target)
      Mappings:
      Namespace Name Mixin selector
      official a Lbjd;a(Lbgg;Lbfx;)Ljava/util/Optional;
      intermediary method_36262 Lnet/minecraft/class_6336;method_36262(Lnet/minecraft/class_1314;Lnet/minecraft/class_1309;)Ljava/util/Optional;
      named findRamStart Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;findRamStart(Lnet/minecraft/entity/mob/PathAwareEntity;Lnet/minecraft/entity/LivingEntity;)Ljava/util/Optional;
    • canReach

      private boolean canReach(PathAwareEntity entity, BlockPos target)
      Mappings:
      Namespace Name Mixin selector
      official a Lbjd;a(Lbgg;Lgt;)Z
      intermediary method_36263 Lnet/minecraft/class_6336;method_36263(Lnet/minecraft/class_1314;Lnet/minecraft/class_2338;)Z
      named canReach Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;canReach(Lnet/minecraft/entity/mob/PathAwareEntity;Lnet/minecraft/util/math/BlockPos;)Z
    • findRam

      private void findRam(PathAwareEntity entity, LivingEntity target)
      Mappings:
      Namespace Name Mixin selector
      official b Lbjd;b(Lbgg;Lbfx;)V
      intermediary method_36268 Lnet/minecraft/class_6336;method_36268(Lnet/minecraft/class_1314;Lnet/minecraft/class_1309;)V
      named findRam Lnet/minecraft/entity/ai/brain/task/PrepareRamTask;findRam(Lnet/minecraft/entity/mob/PathAwareEntity;Lnet/minecraft/entity/LivingEntity;)V