Search in sources :

Example 6 with PathNavigationRegion

use of net.minecraft.world.level.PathNavigationRegion in project Citizens2 by CitizensDev.

the class PlayerPathfinder method findPath.

@Override
public Path findPath(PathNavigationRegion var0, Mob var1, Set<BlockPos> var2, float var3, int var4, float var5) {
    this.openSet.clear();
    this.nodeEvaluator.prepare(var0, var1);
    Node var6 = this.nodeEvaluator.getStart();
    Map<Target, BlockPos> var7 = var2.stream().collect(Collectors.toMap(p -> this.nodeEvaluator.getGoal(p.getX(), p.getY(), p.getZ()), Function.identity()));
    Path var8 = findPath(var0.getProfiler(), var6, var7, var3, var4, var5);
    this.nodeEvaluator.done();
    return var8;
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Path(net.minecraft.world.level.pathfinder.Path) ProfilerFiller(net.minecraft.util.profiling.ProfilerFiller) Set(java.util.Set) Setting(net.citizensnpcs.Settings.Setting) BinaryHeap(net.minecraft.world.level.pathfinder.BinaryHeap) Function(java.util.function.Function) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) List(java.util.List) Stream(java.util.stream.Stream) Lists(com.google.common.collect.Lists) EntityHumanNPC(net.citizensnpcs.nms.v1_17_R1.entity.EntityHumanNPC) BlockPos(net.minecraft.core.BlockPos) Target(net.minecraft.world.level.pathfinder.Target) Map(java.util.Map) MetricCategory(net.minecraft.util.profiling.metrics.MetricCategory) PathFinder(net.minecraft.world.level.pathfinder.PathFinder) Optional(java.util.Optional) Comparator(java.util.Comparator) Mob(net.minecraft.world.entity.Mob) PathNavigationRegion(net.minecraft.world.level.PathNavigationRegion) Node(net.minecraft.world.level.pathfinder.Node) Path(net.minecraft.world.level.pathfinder.Path) Target(net.minecraft.world.level.pathfinder.Target) Node(net.minecraft.world.level.pathfinder.Node) BlockPos(net.minecraft.core.BlockPos)

Aggregations

BlockPos (net.minecraft.core.BlockPos)6 PathNavigationRegion (net.minecraft.world.level.PathNavigationRegion)6 Path (net.minecraft.world.level.pathfinder.Path)6 Lists (com.google.common.collect.Lists)4 Sets (com.google.common.collect.Sets)4 Comparator (java.util.Comparator)4 List (java.util.List)4 Map (java.util.Map)4 Optional (java.util.Optional)4 Set (java.util.Set)4 Function (java.util.function.Function)4 Collectors (java.util.stream.Collectors)4 Stream (java.util.stream.Stream)4 Setting (net.citizensnpcs.Settings.Setting)4 ProfilerFiller (net.minecraft.util.profiling.ProfilerFiller)4 MetricCategory (net.minecraft.util.profiling.metrics.MetricCategory)4 Mob (net.minecraft.world.entity.Mob)4 BinaryHeap (net.minecraft.world.level.pathfinder.BinaryHeap)4 Node (net.minecraft.world.level.pathfinder.Node)4 PathFinder (net.minecraft.world.level.pathfinder.PathFinder)4