use of net.minecraft.server.v1_13_R2.PathPoint in project Citizens2 by CitizensDev.
the class PlayerNavigation method b.
@Override
public void b(BlockPosition var0) {
if (this.c == null || this.c.c() || this.c.e() == 0)
return;
PathPoint var1 = this.c.d();
Vec3D var2 = new Vec3D((var1.a + this.a.locX()) / 2.0D, (var1.b + this.a.locY()) / 2.0D, (var1.c + this.a.locZ()) / 2.0D);
if (var0.a(var2, (this.c.e() - this.c.f())))
j();
}
use of net.minecraft.server.v1_13_R2.PathPoint 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_13_R2.PathPoint 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;
}
use of net.minecraft.server.v1_13_R2.PathPoint in project Citizens2 by CitizensDev.
the class PlayerNavigation method b.
@Override
public void b(BlockPosition var0) {
if (this.c != null && !this.c.b() && this.c.e() != 0) {
PathPoint var1 = this.c.c();
Vec3D var2 = new Vec3D((var1.a + this.a.locX()) / 2.0D, (var1.b + this.a.locY()) / 2.0D, (var1.c + this.a.locZ()) / 2.0D);
if (var0.a(var2, this.c.e() - this.c.f())) {
this.j();
}
}
}
use of net.minecraft.server.v1_13_R2.PathPoint in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method b.
@Override
public PathPoint b() {
int var0;
BlockPosition var1;
if (this.e() && this.b.isInWater()) {
var0 = MathHelper.floor(this.b.locY());
MutableBlockPosition varx = new MutableBlockPosition(this.b.locX(), var0, this.b.locZ());
for (IBlockData var2 = this.a.getType(varx); var2.getBlock() == Blocks.WATER || var2.getFluid() == FluidTypes.WATER.a(false); var2 = this.a.getType(varx)) {
++var0;
varx.c(this.b.locX(), var0, this.b.locZ());
}
--var0;
} else if (this.b.onGround) {
var0 = MathHelper.floor(this.b.locY() + 0.5D);
} else {
for (var1 = new BlockPosition(this.b); (this.a.getType(var1).isAir() || this.a.getType(var1).a(this.a, var1, PathMode.LAND)) && var1.getY() > 0; var1 = var1.down()) {
}
var0 = var1.up().getY();
}
var1 = new BlockPosition(this.b);
PathType var2 = this.a(this.b, var1.getX(), var0, var1.getZ());
if (this.b.a(var2) < 0.0F) {
Set<BlockPosition> var3 = Sets.newHashSet();
var3.add(new BlockPosition(this.b.getBoundingBox().minX, var0, this.b.getBoundingBox().minZ));
var3.add(new BlockPosition(this.b.getBoundingBox().minX, var0, this.b.getBoundingBox().maxZ));
var3.add(new BlockPosition(this.b.getBoundingBox().maxX, var0, this.b.getBoundingBox().minZ));
var3.add(new BlockPosition(this.b.getBoundingBox().maxX, var0, this.b.getBoundingBox().maxZ));
Iterator<BlockPosition> var5 = var3.iterator();
while (var5.hasNext()) {
BlockPosition varb = var5.next();
PathType var6 = this.a(this.b, varb);
if (this.b.a(var6) >= 0.0F) {
return this.a(varb.getX(), varb.getY(), varb.getZ());
}
}
}
return this.a(var1.getX(), var0, var1.getZ());
}
Aggregations