use of net.minecraft.server.v1_15_R1.ChunkCache in project Citizens2 by CitizensDev.
the class PlayerNavigation method supera.
public PathEntity supera(BlockPosition paramBlockPosition) {
if (!b()) {
return null;
}
if ((this.c != null) && (!this.c.b()) && (paramBlockPosition.equals(this.r))) {
return this.c;
}
this.r = paramBlockPosition;
float f1 = h();
BlockPosition localBlockPosition = new BlockPosition(this.a);
int i1 = (int) (f1 + 8.0F);
ChunkCache localChunkCache = new ChunkCache(this.b, localBlockPosition.a(-i1, -i1, -i1), localBlockPosition.a(i1, i1, i1), 0);
PathEntity localPathEntity = this.s.a(localChunkCache, this.a, this.r, f1);
return localPathEntity;
}
use of net.minecraft.server.v1_15_R1.ChunkCache in project Citizens2 by CitizensDev.
the class PlayerNavigation method b2.
private PathEntity b2(BlockPosition paramBlockPosition) {
if (!b()) {
return null;
}
if ((this.c != null) && (!this.c.b()) && (paramBlockPosition.equals(this.q))) {
return this.c;
}
this.q = paramBlockPosition;
float f1 = i();
this.b.methodProfiler.a("pathfind");
BlockPosition localBlockPosition = new BlockPosition(this.a);
int i1 = (int) (f1 + 8.0F);
ChunkCache localChunkCache = new ChunkCache(this.b, localBlockPosition.a(-i1, -i1, -i1), localBlockPosition.a(i1, i1, i1), 0);
PathEntity localPathEntity = this.r.a(localChunkCache, this.a, this.q, f1);
this.b.methodProfiler.b();
return localPathEntity;
}
use of net.minecraft.server.v1_15_R1.ChunkCache in project Citizens2 by CitizensDev.
the class PlayerNavigation method a.
@Override
protected PathEntity a(Set<BlockPosition> var0, int var1, boolean var2, int var3) {
if (var0.isEmpty())
return null;
if (this.a.locY() < 0.0D)
return null;
if (!a())
return null;
if (this.c != null && !this.c.c() && var0.contains(this.p))
return this.c;
this.b.getMethodProfiler().enter("pathfind");
float var4 = (float) this.a.b(GenericAttributes.FOLLOW_RANGE);
BlockPosition var5 = var2 ? this.a.getChunkCoordinates().up() : this.a.getChunkCoordinates();
int var6 = (int) (var4 + var1);
ChunkCache var7 = new ChunkCache(this.b, var5.b(-var6, -var6, -var6), var5.b(var6, var6, var6));
PathEntity var8 = this.s.a(var7, this.a, var0, var4, var3, this.r);
this.b.getMethodProfiler().exit();
if (var8 != null && var8.m() != null) {
this.p = var8.m();
this.q = var3;
e();
}
return var8;
}
use of net.minecraft.server.v1_15_R1.ChunkCache in project Citizens2 by CitizensDev.
the class PlayerPathfinder method a.
public PathEntity a(ChunkCache var0, EntityHumanNPC var1, Set<BlockPosition> var2, float var3, int var4, float var5) {
this.a.a();
this.e.a(var0, var1);
PathPoint var6 = this.e.b();
Map<PathDestination, BlockPosition> var7 = var2.stream().collect(Collectors.toMap((var0x) -> {
return this.e.a((double) var0x.getX(), (double) var0x.getY(), (double) var0x.getZ());
}, Function.identity()));
PathEntity var8 = this.a(var6, var7, var3, var4, var5);
this.e.a();
return var8;
}
use of net.minecraft.server.v1_15_R1.ChunkCache in project Citizens2 by CitizensDev.
the class PlayerPathfinder method a.
@Override
public PathEntity a(ChunkCache var0, EntityInsentient var1, Set<BlockPosition> var2, float var3, int var4, float var5) {
this.a.a();
this.e.a(var0, var1);
PathPoint var6 = this.e.b();
Map<PathDestination, BlockPosition> var7 = var2.stream().collect(Collectors.toMap((var0x) -> {
return this.e.a((double) var0x.getX(), (double) var0x.getY(), (double) var0x.getZ());
}, Function.identity()));
PathEntity var8 = this.a(var6, var7, var3, var4, var5);
this.e.a();
return var8;
}
Aggregations