use of net.minecraft.server.v1_16_R3.BlockPosition 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;
}
use of net.minecraft.server.v1_16_R3.BlockPosition 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;
}
use of net.minecraft.server.v1_16_R3.BlockPosition 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);
}
}
}
use of net.minecraft.server.v1_16_R3.BlockPosition in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method b.
public static PathType b(IBlockAccess var0, int var1, int var2, int var3) {
PathType var4 = c(var0, var1, var2, var3);
if (var4 == PathType.OPEN && var2 >= 1) {
Block var5 = var0.getType(new BlockPosition(var1, var2 - 1, var3)).getBlock();
PathType var6 = c(var0, var1, var2 - 1, var3);
var4 = var6 != PathType.WALKABLE && var6 != PathType.OPEN && var6 != PathType.WATER && var6 != PathType.LAVA ? PathType.WALKABLE : PathType.OPEN;
if (var6 == PathType.DAMAGE_FIRE || var5 == Blocks.MAGMA_BLOCK || var5 == Blocks.CAMPFIRE) {
var4 = PathType.DAMAGE_FIRE;
}
if (var6 == PathType.DAMAGE_CACTUS) {
var4 = PathType.DAMAGE_CACTUS;
}
if (var6 == PathType.DAMAGE_OTHER) {
var4 = PathType.DAMAGE_OTHER;
}
if (var6 == PathType.STICKY_HONEY) {
var4 = PathType.STICKY_HONEY;
}
}
if (var4 == PathType.WALKABLE) {
var4 = a(var0, var1, var2, var3, var4);
}
return var4;
}
use of net.minecraft.server.v1_16_R3.BlockPosition in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
@Override
public PathType a(IBlockAccess var0, int var1, int var2, int var3, EntityInsentient var4, int var5, int var6, int var7, boolean var8, boolean var9) {
EnumSet<PathType> var10 = EnumSet.noneOf(PathType.class);
PathType var11 = PathType.BLOCKED;
double var12 = var4.getWidth() / 2.0D;
BlockPosition var14 = new BlockPosition(var4);
var11 = this.a(var0, var1, var2, var3, var5, var6, var7, var8, var9, var10, var11, var14);
if (var10.contains(PathType.FENCE)) {
return PathType.FENCE;
} else {
PathType var15 = PathType.BLOCKED;
Iterator<PathType> var17 = var10.iterator();
while (var17.hasNext()) {
PathType var18 = var17.next();
if (var4.a(var18) < 0.0F) {
return var18;
}
if (var4.a(var18) >= var4.a(var15)) {
var15 = var18;
}
}
if (var11 == PathType.OPEN && var4.a(var15) == 0.0F) {
return PathType.OPEN;
} else {
return var15;
}
}
}
Aggregations