use of net.minecraft.world.level.PathNavigationRegion in project Citizens2 by CitizensDev.
the class PlayerPathfinder method findPath.
public Path findPath(PathNavigationRegion var0, EntityHumanNPC 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;
}
use of net.minecraft.world.level.PathNavigationRegion in project Citizens2 by CitizensDev.
the class PlayerNavigation method createPath.
@Override
protected Path createPath(Set<BlockPos> var0, int var1, boolean var2, int var3, float var4) {
if (var0.isEmpty() || (this.mob.getY() < this.level.getMinBuildHeight()) || !canUpdatePath())
return null;
if (this.path != null && !this.path.isDone() && var0.contains(this.targetPos))
return this.path;
this.level.getProfiler().push("pathfind");
BlockPos var5 = var2 ? this.mob.blockPosition().up() : this.mob.blockPosition();
int var6 = (int) (var4 + var1);
PathNavigationRegion var7 = new PathNavigationRegion(this.level, var5.c(-var6, -var6, -var6), var5.c(var6, var6, var6));
Path var8 = this.pathFinder.findPath(var7, this.mob, var0, var4, var3, this.maxVisitedNodesMultiplier);
this.level.getProfiler().pop();
if (var8 != null && var8.getTarget() != null) {
this.targetPos = var8.getTarget();
this.reachRange = var3;
resetStuckTimeout();
}
return var8;
}
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;
}
use of net.minecraft.world.level.PathNavigationRegion in project Citizens2 by CitizensDev.
the class PlayerPathfinder method findPath.
public Path findPath(PathNavigationRegion var0, EntityHumanNPC 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;
}
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;
}
Aggregations