use of net.minecraft.server.v1_14_R1.BlockPosition in project Citizens2 by CitizensDev.
the class PlayerNavigation method superD_.
protected void superD_() {
if (this.c == null)
return;
for (int var0 = 0; var0 < this.c.e(); var0++) {
PathPoint var1 = this.c.a(var0);
PathPoint var2 = (var0 + 1 < this.c.e()) ? this.c.a(var0 + 1) : null;
IBlockData var3 = this.b.getType(new BlockPosition(var1.a, var1.b, var1.c));
if (var3.a(Blocks.CAULDRON)) {
this.c.a(var0, var1.a(var1.a, var1.b + 1, var1.c));
if (var2 != null && var1.b >= var2.b)
this.c.a(var0 + 1, var1.a(var2.a, var1.b + 1, var2.c));
}
}
}
use of net.minecraft.server.v1_14_R1.BlockPosition in project Citizens2 by CitizensDev.
the class PlayerNavigation method c.
@Override
public void c() {
this.e++;
if (this.m)
j();
if (m())
return;
if (a()) {
l();
} else if (this.c != null && !this.c.c()) {
Vec3D vec3D1 = b();
Vec3D vec3D2 = this.c.a(this.a);
if (vec3D1.y > vec3D2.y && !this.a.isOnGround() && MathHelper.floor(vec3D1.x) == MathHelper.floor(vec3D2.x) && MathHelper.floor(vec3D1.z) == MathHelper.floor(vec3D2.z))
this.c.a();
}
if (m())
return;
Vec3D var0 = this.c.a(this.a);
BlockPosition var1 = new BlockPosition(var0);
this.a.getControllerMove().a(var0.x, this.b.getType(var1.down()).isAir() ? var0.y : PathfinderNormal.a(this.b, var1), var0.z, this.d);
}
use of net.minecraft.server.v1_14_R1.BlockPosition in project Citizens2 by CitizensDev.
the class PlayerNavigation method u.
private int u() {
if (!this.a.isInWater() || !r())
return MathHelper.floor(this.a.locY() + 0.5D);
int var0 = MathHelper.floor(this.a.locY());
Block var1 = this.b.getType(new BlockPosition(this.a.locX(), var0, this.a.locZ())).getBlock();
int var2 = 0;
while (var1 == Blocks.WATER) {
var0++;
var1 = this.b.getType(new BlockPosition(this.a.locX(), var0, this.a.locZ())).getBlock();
if (++var2 > 16)
return MathHelper.floor(this.a.locY());
}
return var0;
}
use of net.minecraft.server.v1_14_R1.BlockPosition 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_14_R1.BlockPosition in project Citizens2 by CitizensDev.
the class PlayerNavigation method a.
@Override
public PathEntity a(BlockPosition var0, int var1) {
if (this.b.getType(var0).isAir()) {
BlockPosition var2 = var0.down();
while (var2.getY() > 0 && this.b.getType(var2).isAir()) var2 = var2.down();
if (var2.getY() > 0)
return supera(var2.up(), var1);
while (var2.getY() < this.b.getBuildHeight() && this.b.getType(var2).isAir()) var2 = var2.up();
var0 = var2;
}
if (this.b.getType(var0).getMaterial().isBuildable()) {
BlockPosition var2 = var0.up();
while (var2.getY() < this.b.getBuildHeight() && this.b.getType(var2).getMaterial().isBuildable()) var2 = var2.up();
return supera(var2, var1);
}
return supera(var0, var1);
}
Aggregations