Search in sources :

Example 1 with BaseBlockPosition

use of net.minecraft.server.v1_16_R3.BaseBlockPosition 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);
}
Also used : BaseBlockPosition(net.minecraft.server.v1_16_R3.BaseBlockPosition) Vec3D(net.minecraft.server.v1_16_R3.Vec3D)

Example 2 with BaseBlockPosition

use of net.minecraft.server.v1_16_R3.BaseBlockPosition in project Citizens2 by CitizensDev.

the class PlayerNavigation method a.

@Override
protected void a(Vec3D var0) {
    if (this.e - this.f > 100) {
        if (var0.distanceSquared(this.g) < 2.25D) {
            this.t = true;
            o();
        } else {
            this.t = false;
        }
        this.f = this.e;
        this.g = var0;
    }
    if (this.c != null && !this.c.c()) {
        BaseBlockPosition var1 = this.c.g();
        if (var1.equals(this.h)) {
            this.i += SystemUtils.getMonotonicMillis() - this.j;
        } else {
            this.h = var1;
            double var2 = var0.f(Vec3D.c(this.h));
            this.k = (this.a.dN() > 0.0F) ? (var2 / this.a.dN() * 1000.0D) : 0.0D;
        }
        if (this.k > 0.0D && this.i > this.k * 3.0D) {
            e();
            o();
        }
        this.j = SystemUtils.getMonotonicMillis();
    }
}
Also used : BaseBlockPosition(net.minecraft.server.v1_16_R3.BaseBlockPosition)

Aggregations

BaseBlockPosition (net.minecraft.server.v1_16_R3.BaseBlockPosition)2 Vec3D (net.minecraft.server.v1_16_R3.Vec3D)1