Search in sources :

Example 6 with ChunkCache

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

the class PlayerNavigation method a.

@Override
public PathEntity a(BlockPosition paramBlockPosition) {
    if (!b()) {
        return null;
    }
    float f1 = i();
    this.c.methodProfiler.a("pathfind");
    BlockPosition localBlockPosition = new BlockPosition(this.b);
    int k = (int) (f1 + 8.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, paramBlockPosition, 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 7 with ChunkCache

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

the class PlayerNavigation method a2.

public PathEntity a2(Entity paramEntity) {
    if (!b()) {
        return null;
    }
    BlockPosition localBlockPosition1 = new BlockPosition(paramEntity);
    if ((this.c != null) && (!this.c.b()) && (localBlockPosition1.equals(this.q))) {
        return this.c;
    }
    this.q = localBlockPosition1;
    float f1 = h();
    this.b.methodProfiler.a("pathfind");
    BlockPosition localBlockPosition2 = new BlockPosition(this.a).up();
    int i1 = (int) (f1 + 16.0F);
    ChunkCache localChunkCache = new ChunkCache(this.b, localBlockPosition2.a(-i1, -i1, -i1), localBlockPosition2.a(i1, i1, i1), 0);
    PathEntity localPathEntity = this.r.a(localChunkCache, this.a, paramEntity, f1);
    this.b.methodProfiler.b();
    return localPathEntity;
}
Also used : ChunkCache(net.minecraft.server.v1_11_R1.ChunkCache) BlockPosition(net.minecraft.server.v1_11_R1.BlockPosition) PathEntity(net.minecraft.server.v1_11_R1.PathEntity) PathPoint(net.minecraft.server.v1_11_R1.PathPoint)

Aggregations

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