use of net.minecraft.server.v1_14_R1.BlockPosition.PooledBlockPosition in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
public static PathType a(IBlockAccess var0, int var1, int var2, int var3, PathType var4) {
PooledBlockPosition var5 = PooledBlockPosition.r();
Throwable var6 = null;
try {
for (int var7 = -1; var7 <= 1; ++var7) {
for (int var8 = -1; var8 <= 1; ++var8) {
for (int var9 = -1; var9 <= 1; ++var9) {
if (var7 != 0 || var9 != 0) {
Block var10 = var0.getType(var5.d(var7 + var1, var8 + var2, var9 + var3)).getBlock();
if (var10 == Blocks.CACTUS) {
var4 = PathType.DANGER_CACTUS;
} else if (var10 != Blocks.FIRE && var10 != Blocks.LAVA) {
if (var10 == Blocks.SWEET_BERRY_BUSH) {
var4 = PathType.DANGER_OTHER;
}
} else {
var4 = PathType.DANGER_FIRE;
}
}
}
}
}
} catch (Throwable var18) {
var6 = var18;
throw var18;
} finally {
if (var5 != null) {
if (var6 != null) {
try {
var5.close();
} catch (Throwable var17) {
var6.addSuppressed(var17);
}
} else {
var5.close();
}
}
}
return var4;
}
use of net.minecraft.server.v1_14_R1.BlockPosition.PooledBlockPosition in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
public PathType a(IBlockAccess var0, int var1, int var2, int var3, PathType var4) {
if (var4 == PathType.WALKABLE) {
PooledBlockPosition var5 = PooledBlockPosition.r();
Throwable tt = null;
try {
for (int var7 = -1; var7 <= 1; ++var7) {
for (int var8 = -1; var8 <= 1; ++var8) {
if (var7 != 0 || var8 != 0) {
Block var9 = var0.getType(var5.d(var7 + var1, var2, var8 + var3)).getBlock();
if (var9 == Blocks.CACTUS) {
var4 = PathType.DANGER_CACTUS;
} else if (var9 == Blocks.FIRE) {
var4 = PathType.DANGER_FIRE;
} else if (var9 == Blocks.SWEET_BERRY_BUSH) {
var4 = PathType.DANGER_OTHER;
}
}
}
}
} catch (Throwable var18) {
tt = var18;
throw var18;
} finally {
if (var5 != null) {
if (tt != null) {
try {
var5.close();
} catch (Throwable var17) {
tt.addSuppressed(var17);
}
} else {
var5.close();
}
}
}
}
return var4;
}
Aggregations