Search in sources :

Example 16 with PathPoint

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

the class PlayerNavigation method superD_.

protected void superD_() {
    if (this.c == null)
        return;
    for (int var0 = 0; var0 < this.c.e(); var0++) {
        PathPoint var1 = this.c.a(var0);
        PathPoint var2 = (var0 + 1 < this.c.e()) ? this.c.a(var0 + 1) : null;
        IBlockData var3 = this.b.getType(new BlockPosition(var1.a, var1.b, var1.c));
        if (var3.a(Blocks.CAULDRON)) {
            this.c.a(var0, var1.a(var1.a, var1.b + 1, var1.c));
            if (var2 != null && var1.b >= var2.b)
                this.c.a(var0 + 1, var1.a(var2.a, var1.b + 1, var2.c));
        }
    }
}
Also used : PathPoint(net.minecraft.server.v1_16_R3.PathPoint) IBlockData(net.minecraft.server.v1_16_R3.IBlockData) BlockPosition(net.minecraft.server.v1_16_R3.BlockPosition) BaseBlockPosition(net.minecraft.server.v1_16_R3.BaseBlockPosition) PathPoint(net.minecraft.server.v1_16_R3.PathPoint)

Example 17 with PathPoint

use of net.minecraft.server.v1_16_R3.PathPoint 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 18 with PathPoint

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

the class PlayerPathfinder method a.

public PathEntity a(ChunkCache var0, EntityHumanNPC var1, Set<BlockPosition> var2, float var3, int var4, float var5) {
    this.a.a();
    this.e.a(var0, var1);
    PathPoint var6 = this.e.b();
    Map<PathDestination, BlockPosition> var7 = var2.stream().collect(Collectors.toMap((var0x) -> {
        return this.e.a((double) var0x.getX(), (double) var0x.getY(), (double) var0x.getZ());
    }, Function.identity()));
    PathEntity var8 = this.a(var6, var7, var3, var4, var5);
    this.e.a();
    return var8;
}
Also used : Pathfinder(net.minecraft.server.v1_15_R1.Pathfinder) EntityHumanNPC(net.citizensnpcs.nms.v1_15_R1.entity.EntityHumanNPC) Iterator(java.util.Iterator) PathEntity(net.minecraft.server.v1_15_R1.PathEntity) Set(java.util.Set) Setting(net.citizensnpcs.Settings.Setting) ChunkCache(net.minecraft.server.v1_15_R1.ChunkCache) Function(java.util.function.Function) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Path(net.minecraft.server.v1_15_R1.Path) List(java.util.List) Stream(java.util.stream.Stream) Lists(com.google.common.collect.Lists) EntityInsentient(net.minecraft.server.v1_15_R1.EntityInsentient) PathDestination(net.minecraft.server.v1_15_R1.PathDestination) Map(java.util.Map) Optional(java.util.Optional) BlockPosition(net.minecraft.server.v1_15_R1.BlockPosition) Comparator(java.util.Comparator) PathPoint(net.minecraft.server.v1_15_R1.PathPoint) PathPoint(net.minecraft.server.v1_15_R1.PathPoint) BlockPosition(net.minecraft.server.v1_15_R1.BlockPosition) PathEntity(net.minecraft.server.v1_15_R1.PathEntity) PathDestination(net.minecraft.server.v1_15_R1.PathDestination)

Example 19 with PathPoint

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

the class PlayerPathfinder method a.

@Override
public PathEntity a(ChunkCache var0, EntityInsentient var1, Set<BlockPosition> var2, float var3, int var4, float var5) {
    this.a.a();
    this.e.a(var0, var1);
    PathPoint var6 = this.e.b();
    Map<PathDestination, BlockPosition> var7 = var2.stream().collect(Collectors.toMap((var0x) -> {
        return this.e.a((double) var0x.getX(), (double) var0x.getY(), (double) var0x.getZ());
    }, Function.identity()));
    PathEntity var8 = this.a(var6, var7, var3, var4, var5);
    this.e.a();
    return var8;
}
Also used : Pathfinder(net.minecraft.server.v1_15_R1.Pathfinder) EntityHumanNPC(net.citizensnpcs.nms.v1_15_R1.entity.EntityHumanNPC) Iterator(java.util.Iterator) PathEntity(net.minecraft.server.v1_15_R1.PathEntity) Set(java.util.Set) Setting(net.citizensnpcs.Settings.Setting) ChunkCache(net.minecraft.server.v1_15_R1.ChunkCache) Function(java.util.function.Function) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Path(net.minecraft.server.v1_15_R1.Path) List(java.util.List) Stream(java.util.stream.Stream) Lists(com.google.common.collect.Lists) EntityInsentient(net.minecraft.server.v1_15_R1.EntityInsentient) PathDestination(net.minecraft.server.v1_15_R1.PathDestination) Map(java.util.Map) Optional(java.util.Optional) BlockPosition(net.minecraft.server.v1_15_R1.BlockPosition) Comparator(java.util.Comparator) PathPoint(net.minecraft.server.v1_15_R1.PathPoint) PathPoint(net.minecraft.server.v1_15_R1.PathPoint) BlockPosition(net.minecraft.server.v1_15_R1.BlockPosition) PathEntity(net.minecraft.server.v1_15_R1.PathEntity) PathDestination(net.minecraft.server.v1_15_R1.PathDestination)

Example 20 with PathPoint

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

the class PlayerNavigation method b.

@Override
public void b(BlockPosition var0) {
    if (this.c != null && !this.c.b() && this.c.e() != 0) {
        PathPoint var1 = this.c.c();
        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())) {
            this.j();
        }
    }
}
Also used : PathPoint(net.minecraft.server.v1_15_R1.PathPoint) Vec3D(net.minecraft.server.v1_15_R1.Vec3D)

Aggregations

PathPoint (net.minecraft.server.v1_16_R3.PathPoint)12 PathPoint (net.minecraft.server.v1_14_R1.PathPoint)11 PathPoint (net.minecraft.server.v1_15_R1.PathPoint)11 List (java.util.List)10 Optional (java.util.Optional)9 Set (java.util.Set)9 PathPoint (net.minecraft.server.v1_11_R1.PathPoint)9 PathPoint (net.minecraft.server.v1_13_R2.PathPoint)9 Vector (org.bukkit.util.Vector)9 Lists (com.google.common.collect.Lists)8 Sets (com.google.common.collect.Sets)8 Comparator (java.util.Comparator)8 Iterator (java.util.Iterator)8 Map (java.util.Map)8 Function (java.util.function.Function)8 Collectors (java.util.stream.Collectors)8 Stream (java.util.stream.Stream)8 Setting (net.citizensnpcs.Settings.Setting)8 PathPoint (net.minecraft.server.v1_10_R1.PathPoint)8 BlockPosition (net.minecraft.server.v1_14_R1.BlockPosition)8