net.minecraft.entity.ai.brain.task

public class MoveItemsTask

extends MultiTickTask<PathAwareEntity>

All mapped superinterfaces:

Task

net.minecraft.world.entity.ai.behavior.TransportItemsBetweenContainers
net.minecraft.class_11568
net.minecraft.entity.ai.brain.task.MoveItemsTask

Field summary

Modifier and TypeField
public static final int
TARGET_INTERACTION_TIME
field_61225
INTERACTION_TICKS
private static final int
VISITED_POSITIONS_MEMORY_TIME
field_61226
VISITED_POSITION_EXPIRY
private static final int
TRANSPORTED_ITEM_MAX_STACK_SIZE
field_61227
MAX_STACK_SIZE_AT_ONCE
private static final int
MAX_VISITED_POSITIONS
field_61228
VISITS_UNTIL_COOLDOWN
private static final int
MAX_UNREACHABLE_POSITIONS
field_62427
field_62427
private static final int
PASSENGER_MOB_TARGET_SEARCH_DISTANCE
field_63014
field_63014
private static final int
IDLE_COOLDOWN
field_61229
COOLDOWN_EXPIRY
private static final double
CLOSE_ENOUGH_TO_START_QUEUING_DISTANCE
field_61230
QUEUING_RANGE
private static final double
CLOSE_ENOUGH_TO_START_INTERACTING_WITH_TARGET_DISTANCE
field_61231
INTERACTION_RANGE
private static final double
CLOSE_ENOUGH_TO_START_INTERACTING_WITH_TARGET_PATH_END_DISTANCE
field_62428
field_62428
private static final double
CLOSE_ENOUGH_TO_CONTINUE_INTERACTING_WITH_TARGET
field_62911
field_62911
private final float
speedModifier
field_61233
speed
private final int
horizontalSearchDistance
field_61234
horizontalRange
private final int
verticalSearchDistance
field_61235
verticalRange
private final Predicate<BlockState>
sourceBlockType
field_61236
inputContainerPredicate
private final Predicate<BlockState>
destinationBlockType
field_61237
outputContainerPredicate
private final Predicate<MoveItemsTask$Storage>
shouldQueueForTarget
field_61238
storagePredicate
private final Consumer<PathAwareEntity>
onStartTravelling
field_61239
travellingCallback
private final Map<MoveItemsTask$InteractionState, MoveItemsTask$InteractionCallback>
onTargetInteractionActions
field_61240
interactionCallbacks
private MoveItemsTask$Storage
target
field_61241
targetStorage
private MoveItemsTask$NavigationState
state
field_61242
navigationState
private MoveItemsTask$InteractionState
interactionState
field_61243
interactionState
private int
ticksSinceReachingTarget
field_61244
interactionTicks

Constructor summary

ModifierConstructor
public (float speed, Predicate<BlockState> inputContainerPredicate, Predicate<BlockState> outputChestPredicate, int horizontalRange, int verticalRange, Map<MoveItemsTask$InteractionState, MoveItemsTask$InteractionCallback> interactionCallbacks, Consumer<PathAwareEntity> travellingCallback, Predicate<MoveItemsTask$Storage> storagePredicate)

Method summary

Modifier and TypeMethod
protected void
start(ServerLevel level, PathfinderMob body, long timestamp)
method_74863(class_3218 arg0, class_1314 arg1, long arg2)
run(ServerWorld arg0, PathAwareEntity arg1, long arg2)
protected boolean
checkExtraStartConditions(ServerLevel level, PathfinderMob body)
method_74017(class_3218 arg0, class_1314 arg1)
shouldRun(ServerWorld arg0, PathAwareEntity arg1)
protected boolean
canStillUse(ServerLevel level, PathfinderMob body, long timestamp)
method_72400(class_3218 arg0, class_1314 arg1, long arg2)
shouldKeepRunning(ServerWorld arg0, PathAwareEntity arg1, long arg2)
protected boolean
timedOut(long timestamp)
method_18915(long arg0)
isTimeLimitExceeded(long arg0)
protected void
tick(ServerLevel level, PathfinderMob body, long timestamp)
method_72425(class_3218 arg0, class_1314 arg1, long arg2)
keepRunning(ServerWorld arg0, PathAwareEntity arg1, long arg2)
private boolean
updateInvalidTarget(ServerLevel level, PathfinderMob body)
method_72399(class_3218 arg0, class_1314 arg1)
tick(ServerWorld world, PathAwareEntity entity)
private void
onQueuingForTarget(TransportItemsBetweenContainers$TransportItemTarget target, Level level, PathfinderMob body)
method_72432(class_11568$class_11572 arg0, class_1937 arg1, class_1314 arg2)
tickQueuing(MoveItemsTask$Storage storage, World world, PathAwareEntity entity)
protected void
onTravelToTarget(TransportItemsBetweenContainers$TransportItemTarget target, Level level, PathfinderMob body)
method_72419(class_11568$class_11572 arg0, class_1937 arg1, class_1314 arg2)
tickTravelling(MoveItemsTask$Storage storage, World world, PathAwareEntity entity)
private Vec3d
getCenterPos(PathfinderMob body)
method_74870(class_1314 arg0)
atCenterY(PathAwareEntity entity)
protected void
onReachedTarget(TransportItemsBetweenContainers$TransportItemTarget target, Level level, PathfinderMob body)
method_72416(class_11568$class_11572 arg0, class_1937 arg1, class_1314 arg2)
tickInteracting(MoveItemsTask$Storage storage, World world, PathAwareEntity entity)
private void
startQueuing(PathfinderMob body)
method_72427(class_1314 arg0)
transitionToQueuing(PathAwareEntity entity)
private void
resumeTravelling(PathfinderMob body)
method_72436(class_1314 arg0)
onCannotUseStorage(PathAwareEntity entity)
private void
walkTowardsTarget(PathfinderMob body)
method_72440(class_1314 arg0)
walkTowardsTargetStorage(PathAwareEntity entity)
private void
startOnReachedTargetInteraction(TransportItemsBetweenContainers$TransportItemTarget target, PathfinderMob body)
method_72430(class_11568$class_11572 arg0, class_1314 arg1)
transitionToInteracting(MoveItemsTask$Storage storage, PathAwareEntity entity)
private void
onStartTravelling(PathfinderMob body)
method_72442(class_1314 arg0)
transitionToTravelling(PathAwareEntity entity)
private BiConsumer<PathAwareEntity, Inventory>
onReachedInteraction(TransportItemsBetweenContainers$ContainerInteractionState state)
method_72412(class_11568$class_11569 arg0)
createSetInteractionStateCallback(MoveItemsTask$InteractionState state)
private void
setTransportingState(TransportItemsBetweenContainers$TransportItemState state)
method_72414(class_11568$class_11571 arg0)
setNavigationState(MoveItemsTask$NavigationState state)
private void
setInteractionState(TransportItemsBetweenContainers$ContainerInteractionState state)
method_72429(class_11568$class_11569 arg0)
setInteractionState(MoveItemsTask$InteractionState state)
private void
onTargetInteraction(TransportItemsBetweenContainers$TransportItemTarget target, PathfinderMob body)
method_72438(class_11568$class_11572 arg0, class_1314 arg1)
setLookTarget(MoveItemsTask$Storage storage, PathAwareEntity entity)
private void
doReachedTargetInteraction(PathfinderMob body, Container container, BiConsumer<PathfinderMob, Container> onPickupSuccess, BiConsumer<PathfinderMob, Container> onPickupFailure, BiConsumer<PathfinderMob, Container> onPlaceSuccess, BiConsumer<PathfinderMob, Container> onPlaceFailure)
method_72406(class_1314 arg0, class_1263 arg1, BiConsumer<class_1314, class_1263> arg2, BiConsumer<class_1314, class_1263> arg3, BiConsumer<class_1314, class_1263> arg4, BiConsumer<class_1314, class_1263> arg5)
selectInteractionState(PathAwareEntity entity, Inventory inventory, BiConsumer<PathAwareEntity, Inventory> pickupItemCallback, BiConsumer<PathAwareEntity, Inventory> pickupNoItemCallback, BiConsumer<PathAwareEntity, Inventory> placeItemCallback, BiConsumer<PathAwareEntity, Inventory> placeNoItemCallback)
private Optional<MoveItemsTask$Storage>
getTransportTarget(ServerLevel level, PathfinderMob body)
method_74957(class_3218 arg0, class_1314 arg1)
findStorage(ServerWorld world, PathAwareEntity entity)
private MoveItemsTask$Storage
isTargetValidToPick(PathfinderMob body, Level level, BlockEntity blockEntity, Set<GlobalPos> visitedPositions, Set<GlobalPos> unreachablePositions, AABB targetBlockSearchArea)
method_72409(class_1314 arg0, class_1937 arg1, class_2586 arg2, Set<class_4208> arg3, Set<class_4208> arg4, class_238 arg5)
getStorageFor(PathAwareEntity entity, World world, BlockEntity blockEntity, Set<GlobalPos> visitedPositions, Set<GlobalPos> unreachablePositions, Box box)
private boolean
isContainerLocked(TransportItemsBetweenContainers$TransportItemTarget transportItemTarget)
method_74093(class_11568$class_11572 arg0)
isLocked(MoveItemsTask$Storage storage)
private boolean
hasValidTarget(Level level, PathfinderMob body)
method_72420(class_1937 arg0, class_1314 arg1)
hasValidTargetStorage(World world, PathAwareEntity entity)
private boolean
hasValidTravellingPath(Level level, TransportItemsBetweenContainers$TransportItemTarget target, PathfinderMob body)
method_74958(class_1937 arg0, class_11568$class_11572 arg1, class_1314 arg2)
canNavigateTo(World world, MoveItemsTask$Storage storage, PathAwareEntity entity)
private Vec3d
getPositionToReachTargetFrom(Path path, PathfinderMob body)
method_74868(class_11 arg0, class_1314 arg1)
getTargetPos(Path path, PathAwareEntity entity)
private Vec3d
setMiddleYPosition(PathfinderMob body, Vec3 pos)
method_74864(class_1314 arg0, class_243 arg1)
atCenterY(PathAwareEntity entity, Vec3d pos)
private boolean
isTargetBlocked(Level level, TransportItemsBetweenContainers$TransportItemTarget target)
method_74663(class_1937 arg0, class_11568$class_11572 arg1)
isChestBlocked(World world, MoveItemsTask$Storage storage)
private boolean
targetHasNotChanged(Level level, TransportItemsBetweenContainers$TransportItemTarget target)
method_72421(class_1937 arg0, class_11568$class_11572 arg1)
isUnchanged(World world, MoveItemsTask$Storage storage)
private Stream<MoveItemsTask$Storage>
getConnectedTargets(TransportItemsBetweenContainers$TransportItemTarget target, Level level)
method_72418(class_11568$class_11572 arg0, class_1937 arg1)
getContainerStorages(MoveItemsTask$Storage storage, World world)
private Box
getTargetSearchArea(PathfinderMob mob)
method_72444(class_1314 arg0)
getSearchBoundingBox(PathAwareEntity entity)
private int
getHorizontalSearchDistance(PathfinderMob mob)
method_74871(class_1314 arg0)
getHorizontalRange(PathAwareEntity entity)
private int
getVerticalSearchDistance(PathfinderMob mob)
method_74872(class_1314 arg0)
getVerticalRange(PathAwareEntity entity)
private static Set<GlobalPos>
getVisitedPositions(PathfinderMob mob)
method_72446(class_1314 arg0)
getVisitedPositions(PathAwareEntity entity)
private static Set<GlobalPos>
getUnreachablePositions(PathfinderMob mob)
method_74022(class_1314 arg0)
getUnreachablePositions(PathAwareEntity entity)
private boolean
isPositionAlreadyVisited(Set<GlobalPos> visitedPositions, Set<GlobalPos> unreachablePositions, TransportItemsBetweenContainers$TransportItemTarget target, Level level)
method_72422(Set<class_4208> arg0, Set<class_4208> arg1, class_11568$class_11572 arg2, class_1937 arg3)
hasVisited(Set<GlobalPos> visitedPositions, Set<GlobalPos> checkedPositions, MoveItemsTask$Storage storage, World visited)
private static boolean
hasFinishedPath(PathfinderMob body)
method_74023(class_1314 arg0)
hasFinishedNavigation(PathAwareEntity entity)
protected void
setVisitedBlockPos(PathfinderMob body, Level level, BlockPos target)
method_72408(class_1314 arg0, class_1937 arg1, class_2338 arg2)
markVisited(PathAwareEntity entity, World world, BlockPos pos)
protected void
markVisitedBlockPosAsUnreachable(PathfinderMob body, Level level, BlockPos target)
method_74021(class_1314 arg0, class_1937 arg1, class_2338 arg2)
markUnreachable(PathAwareEntity entity, World world, BlockPos blockPos)
private boolean
isWantedBlock(PathfinderMob mob, BlockState block)
method_72410(class_1314 arg0, class_2680 arg1)
testContainer(PathAwareEntity entity, BlockState state)
private static double
getInteractionRange(PathfinderMob body)
method_74024(class_1314 arg0)
getSightRange(PathAwareEntity entity)
private boolean
isWithinTargetDistance(double distance, TransportItemsBetweenContainers$TransportItemTarget target, Level level, PathfinderMob body, Vec3 fromPos)
method_72398(double arg0, class_11568$class_11572 arg1, class_1937 arg2, class_1314 arg3, class_243 arg4)
isWithinRange(double range, MoveItemsTask$Storage storage, World world, PathAwareEntity entity, Vec3d pos)
private boolean
targetIsReachableFromPosition(Level level, boolean canReachTarget, Vec3 pos, TransportItemsBetweenContainers$TransportItemTarget target, PathfinderMob body)
method_74018(class_1937 arg0, boolean arg1, class_243 arg2, class_11568$class_11572 arg3, class_1314 arg4)
isVisible(World world, boolean nextToStorage, Vec3d pos, MoveItemsTask$Storage storage, PathAwareEntity entity)
private boolean
canSeeAnyTargetSide(TransportItemsBetweenContainers$TransportItemTarget target, Level level, PathfinderMob body, Vec3 eyePosition)
method_74865(class_11568$class_11572 arg0, class_1937 arg1, class_1314 arg2, class_243 arg3)
isVisible(MoveItemsTask$Storage storage, World world, PathAwareEntity entity, Vec3d pos)
private boolean
isAnotherMobInteractingWithTarget(TransportItemsBetweenContainers$TransportItemTarget target, Level level)
method_72431(class_11568$class_11572 arg0, class_1937 arg1)
matchesStoragePredicate(MoveItemsTask$Storage storage, World world)
private static boolean
isPickingUpItems(PathfinderMob body)
method_72448(class_1314 arg0)
canPickUpItem(PathAwareEntity entity)
private static boolean
matchesGettingItemsRequirement(Container container)
method_72402(class_1263 arg0)
hasItem(Inventory inventory)
private static boolean
matchesLeavingItemsRequirement(PathfinderMob body, Container container)
method_72405(class_1314 arg0, class_1263 arg1)
canInsert(PathAwareEntity entity, Inventory inventory)
private static boolean
hasItemMatchingHandItem(PathfinderMob body, Container container)
method_72428(class_1314 arg0, class_1263 arg1)
hasExistingStack(PathAwareEntity entity, Inventory inventory)
private void
pickUpItems(PathfinderMob body, Container container)
method_72437(class_1314 arg0, class_1263 arg1)
takeStack(PathAwareEntity entity, Inventory inventory)
private void
putDownItem(PathfinderMob body, Container container)
method_72441(class_1314 arg0, class_1263 arg1)
placeStack(PathAwareEntity entity, Inventory inventory)
private static ItemStack
pickupItemFromContainer(Container container)
method_72426(class_1263 arg0)
extractStack(Inventory inventory)
private static ItemStack
addItemsToContainer(PathfinderMob body, Container container)
method_72443(class_1314 arg0, class_1263 arg1)
insertStack(PathAwareEntity entity, Inventory inventory)
protected void
stopTargetingCurrentTarget(PathfinderMob body)
method_72434(class_1314 arg0)
invalidateTargetStorage(PathAwareEntity entity)
protected void
clearMemoriesAfterMatchingTargetFound(PathfinderMob body)
method_72403(class_1314 arg0)
resetVisitedPositions(PathAwareEntity entity)
private void
enterCooldownAfterNoMatchingTargetFound(PathfinderMob body)
method_72449(class_1314 arg0)
cooldown(PathAwareEntity entity)
protected void
stop(ServerLevel level, PathfinderMob body, long timestamp)
method_72435(class_3218 arg0, class_1314 arg1, long arg2)
finishRunning(ServerWorld arg0, PathAwareEntity arg1, long arg2)
private void
stopInPlace(PathfinderMob mob)
method_72450(class_1314 arg0)
resetNavigation(PathAwareEntity entity)
protected boolean
checkExtraStartConditions(ServerLevel level, LivingEntity body)
method_18919(class_3218 arg0, class_1309 arg1)
shouldRun(ServerWorld arg0, LivingEntity arg1)
protected boolean
canStillUse(ServerLevel level, LivingEntity body, long timestamp)
method_18927(class_3218 arg0, class_1309 arg1, long arg2)
shouldKeepRunning(ServerWorld arg0, LivingEntity arg1, long arg2)
protected void
stop(ServerLevel level, LivingEntity body, long timestamp)
method_18926(class_3218 arg0, class_1309 arg1, long arg2)
finishRunning(ServerWorld arg0, LivingEntity arg1, long arg2)
protected void
tick(ServerLevel level, LivingEntity body, long timestamp)
method_18924(class_3218 arg0, class_1309 arg1, long arg2)
keepRunning(ServerWorld arg0, LivingEntity arg1, long arg2)
protected void
start(ServerLevel level, LivingEntity body, long timestamp)
method_18920(class_3218 arg0, class_1309 arg1, long arg2)
run(ServerWorld arg0, LivingEntity arg1, long arg2)
private static boolean
lambda$canSeeAnyTargetSide$2(TransportItemsBetweenContainers$TransportItemTarget arg0, BlockHitResult arg1)
method_74866(class_11568$class_11572 arg0, class_3965 arg1)
method_74866(MoveItemsTask$Storage arg0, BlockHitResult hitResult)
private static BlockHitResult
lambda$canSeeAnyTargetSide$1(Level arg0, Vec3 arg1, PathfinderMob arg2, Vec3 arg3)
method_74867(class_1937 arg0, class_243 arg1, class_1314 arg2, class_243 arg3)
method_74867(World arg0, Vec3d arg1, PathAwareEntity arg2, Vec3d storagePos)
private static Vec3d
lambda$canSeeAnyTargetSide$0(Vec3 arg0, Direction arg1)
method_74869(class_243 arg0, class_2350 arg1)
method_74869(Vec3d arg0, Direction direction)
private static boolean
lambda$isPositionAlreadyVisited$1(Set arg0, Set arg1, GlobalPos arg2)
method_74019(Set arg0, Set arg1, class_4208 arg2)
method_74019(Set arg0, Set arg1, GlobalPos pos)
private static GlobalPos
lambda$isPositionAlreadyVisited$0(Level arg0, TransportItemsBetweenContainers$TransportItemTarget arg1)
method_72433(class_1937 arg0, class_11568$class_11572 arg1)
method_72433(World arg0, MoveItemsTask$Storage checkedStorage)
private void
lambda$onTargetInteraction$0(PathfinderMob arg0, TransportItemsBetweenContainers$TransportItemTarget arg1, TransportItemsBetweenContainers$OnTargetReachedInteraction arg2)
method_72407(class_1314 arg0, class_11568$class_11572 arg1, class_11568$class_11570 arg2)
method_72407(PathAwareEntity arg0, MoveItemsTask$Storage arg1, MoveItemsTask$InteractionCallback consumer)
private void
lambda$onReachedInteraction$0(TransportItemsBetweenContainers$ContainerInteractionState arg0, PathfinderMob arg1, Container arg2)
method_72413(class_11568$class_11569 arg0, class_1314 arg1, class_1263 arg2)
method_72413(MoveItemsTask$InteractionState arg0, PathAwareEntity entity, Inventory inventory)
private void
lambda$onReachedTarget$1(PathfinderMob arg0, PathfinderMob arg1, Container arg2)
method_72445(class_1314 arg0, class_1314 arg1, class_1263 arg2)
method_72445(PathAwareEntity entity, PathAwareEntity entityx, Inventory inventory)
private void
lambda$onReachedTarget$0(PathfinderMob arg0, PathfinderMob arg1, Container arg2)
method_72447(class_1314 arg0, class_1314 arg1, class_1263 arg2)
method_72447(PathAwareEntity entity, PathAwareEntity entityx, Inventory inventory)