Search in sources :

Example 21 with Vec3D

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

the class PlayerNavigation method a.

private boolean a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
    int j = paramInt1 - paramInt4 / 2;
    int k = paramInt3 - paramInt6 / 2;
    if (!b(j, paramInt2, k, paramInt4, paramInt5, paramInt6, paramVec3D, paramDouble1, paramDouble2)) {
        return false;
    }
    for (int m = j; m < j + paramInt4; m++) {
        for (int n = k; n < k + paramInt6; n++) {
            double d1 = m + 0.5D - paramVec3D.x;
            double d2 = n + 0.5D - paramVec3D.z;
            if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
                PathType localPathType = this.h.a(this.b, m, paramInt2 - 1, n, this.a, paramInt4, paramInt5, paramInt6, true, true);
                if (localPathType == PathType.WATER) {
                    return false;
                }
                if (localPathType == PathType.LAVA) {
                    return false;
                }
                if (localPathType == PathType.OPEN) {
                    return false;
                }
                localPathType = this.h.a(this.b, m, paramInt2, n, this.a, paramInt4, paramInt5, paramInt6, true, true);
                float f = this.a.a(localPathType);
                if ((f < 0.0F) || (f >= 8.0F)) {
                    return false;
                }
                if ((localPathType == PathType.DAMAGE_FIRE) || (localPathType == PathType.DANGER_FIRE) || (localPathType == PathType.DAMAGE_OTHER)) {
                    return false;
                }
            }
        }
    }
    return true;
}
Also used : PathType(net.minecraft.server.v1_12_R1.PathType) PathPoint(net.minecraft.server.v1_12_R1.PathPoint)

Aggregations

Vec3D (net.minecraft.server.v1_10_R1.Vec3D)5 Vec3D (net.minecraft.server.v1_11_R1.Vec3D)5 Vec3D (net.minecraft.server.v1_12_R1.Vec3D)5 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)3 PathPoint (net.minecraft.server.v1_12_R1.PathPoint)3 Vec3D (net.minecraft.server.v1_8_R3.Vec3D)3 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)2 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)2 AxisAlignedBB (net.minecraft.server.v1_10_R1.AxisAlignedBB)1 EntityHuman (net.minecraft.server.v1_10_R1.EntityHuman)1 EntityPolarBear (net.minecraft.server.v1_10_R1.EntityPolarBear)1 PathPoint (net.minecraft.server.v1_10_R1.PathPoint)1 AxisAlignedBB (net.minecraft.server.v1_11_R1.AxisAlignedBB)1 EntityHuman (net.minecraft.server.v1_11_R1.EntityHuman)1 EntityPolarBear (net.minecraft.server.v1_11_R1.EntityPolarBear)1 PathPoint (net.minecraft.server.v1_11_R1.PathPoint)1 AxisAlignedBB (net.minecraft.server.v1_12_R1.AxisAlignedBB)1 Block (net.minecraft.server.v1_12_R1.Block)1 EntityBird (net.minecraft.server.v1_12_R1.EntityBird)1 EntityPolarBear (net.minecraft.server.v1_12_R1.EntityPolarBear)1