use of net.minecraft.server.v1_14_R1.Vec3D 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.Vec3D in project Citizens2 by CitizensDev.
the class PlayerNavigation method l.
@Override
protected void l() {
Vec3D var0 = b();
this.l = (this.a.getWidth() > 0.75F) ? (this.a.getWidth() / 2.0F) : (0.75F - this.a.getWidth() / 2.0F);
BaseBlockPosition var1 = this.c.g();
double var2 = Math.abs(this.a.locX() - var1.getX() + 0.5D);
double var4 = Math.abs(this.a.locY() - var1.getY());
double var6 = Math.abs(this.a.locZ() - var1.getZ() + 0.5D);
boolean var8 = (var2 < this.l && var6 < this.l && var4 < 1.0D);
boolean b2 = Math.abs(this.a.locX() - (var1.getX() + 0.5D)) < this.l && Math.abs(this.a.locZ() - (var1.getZ() + 0.5D)) < this.l && // old-style calc
Math.abs(this.a.locY() - var1.getY()) < 1.0D;
if (var8 || b2 || (this.a.b((this.c.h()).l) && b(var0)))
this.c.a();
a(var0);
}
use of net.minecraft.server.v1_14_R1.Vec3D 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_14_R1.Vec3D in project Citizens2 by CitizensDev.
the class EntityHumanNPC method moveOnCurrentHeading.
private void moveOnCurrentHeading() {
if (jumping) {
if (onGround && jumpTicks == 0) {
jump();
jumpTicks = 10;
}
} else {
jumpTicks = 0;
}
aR *= 0.98F;
aT *= 0.98F;
// movement method
moveWithFallDamage(new Vec3D(this.aR, this.aS, this.aT));
NMS.setHeadYaw(getBukkitEntity(), yaw);
if (jumpTicks > 0) {
jumpTicks--;
}
}
use of net.minecraft.server.v1_14_R1.Vec3D in project Citizens2 by CitizensDev.
the class PlayerNavigation method c.
@Override
public void c() {
++this.e;
if (this.m) {
this.j();
}
if (!this.m()) {
Vec3D var0;
if (this.a()) {
this.l();
} else if (this.c != null && this.c.f() < this.c.e()) {
var0 = this.b();
Vec3D var1 = this.c.a(this.a, this.c.f());
if (var0.y > var1.y && !this.a.onGround && MathHelper.floor(var0.x) == MathHelper.floor(var1.x) && MathHelper.floor(var0.z) == MathHelper.floor(var1.z)) {
this.c.c(this.c.f() + 1);
}
}
if (!this.m()) {
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);
}
}
}
Aggregations