Search in sources :

Example 11 with Vec3D

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

Example 12 with Vec3D

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

Example 13 with Vec3D

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

Example 14 with Vec3D

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

Example 15 with Vec3D

use of net.minecraft.server.v1_15_R1.Vec3D in project Citizens2 by CitizensDev.

the class PlayerNavigation method l.

@Override
protected void l() {
    Vec3D var0 = this.b();
    this.l = this.a.getWidth() > 0.75F ? this.a.getWidth() / 2.0F : 0.75F - this.a.getWidth() / 2.0F;
    Vec3D var1 = this.c.g();
    if (Math.abs(this.a.locX() - (var1.x + 0.5D)) < this.l && Math.abs(this.a.locZ() - (var1.z + 0.5D)) < this.l && Math.abs(this.a.locY() - var1.y) < 1.0D) {
        this.c.c(this.c.f() + 1);
    }
    this.a(var0);
}
Also used : Vec3D(net.minecraft.server.v1_15_R1.Vec3D)

Aggregations

Vec3D (net.minecraft.server.v1_16_R3.Vec3D)11 Vec3D (net.minecraft.server.v1_15_R1.Vec3D)10 Vec3D (net.minecraft.server.v1_14_R1.Vec3D)9 Vec3D (net.minecraft.server.v1_12_R1.Vec3D)7 Vec3D (net.minecraft.server.v1_10_R1.Vec3D)5 Vec3D (net.minecraft.server.v1_11_R1.Vec3D)5 Vec3D (net.minecraft.server.v1_8_R3.Vec3D)4 Gravity (net.citizensnpcs.trait.Gravity)3 BlockPosition (net.minecraft.server.v1_15_R1.BlockPosition)3 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)2 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)2 AxisAlignedBB (net.minecraft.server.v1_12_R1.AxisAlignedBB)2 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)2 PacketPlayOutEntityLook (net.minecraft.server.v1_15_R1.PacketPlayOutEntity.PacketPlayOutEntityLook)2 PathPoint (net.minecraft.server.v1_15_R1.PathPoint)2 AxisAlignedBB (net.minecraft.server.v1_16_R3.AxisAlignedBB)2 BaseBlockPosition (net.minecraft.server.v1_16_R3.BaseBlockPosition)2 BlockPosition (net.minecraft.server.v1_16_R3.BlockPosition)2 PathPoint (net.minecraft.server.v1_16_R3.PathPoint)2 AxisAlignedBB (net.minecraft.server.v1_8_R3.AxisAlignedBB)2