Search in sources :

Example 1 with PathEntity

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

the class PlayerNavigation method supera.

public PathEntity supera(BlockPosition paramBlockPosition) {
    if (!b()) {
        return null;
    }
    if ((this.c != null) && (!this.c.b()) && (paramBlockPosition.equals(this.r))) {
        return this.c;
    }
    this.r = paramBlockPosition;
    float f1 = h();
    BlockPosition localBlockPosition = new BlockPosition(this.a);
    int i1 = (int) (f1 + 8.0F);
    ChunkCache localChunkCache = new ChunkCache(this.b, localBlockPosition.a(-i1, -i1, -i1), localBlockPosition.a(i1, i1, i1), 0);
    PathEntity localPathEntity = this.s.a(localChunkCache, this.a, this.r, f1);
    return localPathEntity;
}
Also used : ChunkCache(net.minecraft.server.v1_10_R1.ChunkCache) BlockPosition(net.minecraft.server.v1_10_R1.BlockPosition) PathEntity(net.minecraft.server.v1_10_R1.PathEntity) PathPoint(net.minecraft.server.v1_10_R1.PathPoint)

Example 2 with PathEntity

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

the class PlayerPathfinder method a.

private PathEntity a(PathPoint paramPathPoint1, PathPoint paramPathPoint2) {
    int i = 1;
    PathPoint localPathPoint = paramPathPoint2;
    while (localPathPoint.h != null) {
        i++;
        localPathPoint = localPathPoint.h;
    }
    PathPoint[] arrayOfPathPoint = new PathPoint[i];
    localPathPoint = paramPathPoint2;
    arrayOfPathPoint[(--i)] = localPathPoint;
    while (localPathPoint.h != null) {
        localPathPoint = localPathPoint.h;
        arrayOfPathPoint[(--i)] = localPathPoint;
    }
    return new PathEntity(arrayOfPathPoint);
}
Also used : PathPoint(net.minecraft.server.v1_10_R1.PathPoint) PathEntity(net.minecraft.server.v1_10_R1.PathEntity) PathPoint(net.minecraft.server.v1_10_R1.PathPoint)

Example 3 with PathEntity

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

the class PlayerNavigation method a.

@Override
public PathEntity a(Entity paramEntity) {
    if (!b()) {
        return null;
    }
    float f1 = i();
    this.c.methodProfiler.a("pathfind");
    BlockPosition localBlockPosition = new BlockPosition(this.b).up();
    int k = (int) (f1 + 16.0F);
    ChunkCache localChunkCache = new ChunkCache(this.c, localBlockPosition.a(-k, -k, -k), localBlockPosition.a(k, k, k), 0);
    PathEntity localPathEntity = this.j.a(localChunkCache, this.b, paramEntity, f1);
    this.c.methodProfiler.b();
    return localPathEntity;
}
Also used : ChunkCache(net.minecraft.server.v1_8_R3.ChunkCache) BlockPosition(net.minecraft.server.v1_8_R3.BlockPosition) PathEntity(net.minecraft.server.v1_8_R3.PathEntity) PathPoint(net.minecraft.server.v1_8_R3.PathPoint)

Example 4 with PathEntity

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

the class PlayerNavigation method a.

@Override
public boolean a(PathEntity paramPathEntity, double paramDouble) {
    if (paramPathEntity == null) {
        this.c = null;
        return false;
    }
    if (!paramPathEntity.a(this.c)) {
        this.c = paramPathEntity;
    }
    q_();
    if (this.c.d() <= 0) {
        return false;
    }
    this.d = paramDouble;
    Vec3D localVec3D = c();
    this.j = this.e;
    this.k = localVec3D;
    return true;
}
Also used : Vec3D(net.minecraft.server.v1_12_R1.Vec3D)

Example 5 with PathEntity

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

the class PlayerNavigation method b2.

private PathEntity b2(BlockPosition paramBlockPosition) {
    if (!b()) {
        return null;
    }
    if ((this.c != null) && (!this.c.b()) && (paramBlockPosition.equals(this.q))) {
        return this.c;
    }
    this.q = paramBlockPosition;
    float f1 = i();
    this.b.methodProfiler.a("pathfind");
    BlockPosition localBlockPosition = new BlockPosition(this.a);
    int i1 = (int) (f1 + 8.0F);
    ChunkCache localChunkCache = new ChunkCache(this.b, localBlockPosition.a(-i1, -i1, -i1), localBlockPosition.a(i1, i1, i1), 0);
    PathEntity localPathEntity = this.r.a(localChunkCache, this.a, this.q, f1);
    this.b.methodProfiler.b();
    return localPathEntity;
}
Also used : ChunkCache(net.minecraft.server.v1_12_R1.ChunkCache) BlockPosition(net.minecraft.server.v1_12_R1.BlockPosition) PathEntity(net.minecraft.server.v1_12_R1.PathEntity) PathPoint(net.minecraft.server.v1_12_R1.PathPoint)

Aggregations

PathEntity (net.minecraft.server.v1_10_R1.PathEntity)5 PathPoint (net.minecraft.server.v1_10_R1.PathPoint)5 PathEntity (net.minecraft.server.v1_11_R1.PathEntity)5 PathPoint (net.minecraft.server.v1_11_R1.PathPoint)5 PathEntity (net.minecraft.server.v1_12_R1.PathEntity)4 PathPoint (net.minecraft.server.v1_12_R1.PathPoint)4 PathEntity (net.minecraft.server.v1_8_R3.PathEntity)4 PathPoint (net.minecraft.server.v1_8_R3.PathPoint)4 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)2 ChunkCache (net.minecraft.server.v1_10_R1.ChunkCache)2 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)2 ChunkCache (net.minecraft.server.v1_11_R1.ChunkCache)2 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)2 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)2 ChunkCache (net.minecraft.server.v1_8_R3.ChunkCache)2 ChunkCache (net.minecraft.server.v1_12_R1.ChunkCache)1 Vec3D (net.minecraft.server.v1_12_R1.Vec3D)1