use of net.minecraft.server.v1_15_R1.Fluid in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method b.
protected PathType b(IBlockAccess var1, int var2, int var3, int var4) {
BlockPosition var5 = new BlockPosition(var2, var3, var4);
IBlockData var6 = var1.getType(var5);
Block var7 = var6.getBlock();
Material var8 = var6.getMaterial();
if (var6.isAir()) {
return PathType.OPEN;
} else if (var7 != Blocks.OAK_TRAPDOOR && var7 != Blocks.IRON_TRAPDOOR && var7 != Blocks.LILY_PAD) {
if (var7 == Blocks.FIRE) {
return PathType.DAMAGE_FIRE;
} else if (var7 == Blocks.CACTUS) {
return PathType.DAMAGE_CACTUS;
} else if (var7 instanceof BlockDoor && var8 == Material.WOOD && !var6.get(BlockDoor.OPEN).booleanValue()) {
return PathType.DOOR_WOOD_CLOSED;
} else if (var7 instanceof BlockDoor && var8 == Material.ORE && !var6.get(BlockDoor.OPEN).booleanValue()) {
return PathType.DOOR_IRON_CLOSED;
} else if (var7 instanceof BlockDoor && var6.get(BlockDoor.OPEN).booleanValue()) {
return PathType.DOOR_OPEN;
} else if (var7 instanceof BlockMinecartTrackAbstract) {
return PathType.RAIL;
} else if (var7 instanceof BlockFence || var7 instanceof BlockCobbleWall || var7 instanceof BlockFenceGate && !var6.get(BlockFenceGate.OPEN).booleanValue()) {
return PathType.FENCE;
} else {
Fluid var9;
try {
var9 = var1.getFluid(var5);
} catch (NoSuchMethodError ex) {
try {
var9 = (Fluid) GET_FLUID.invoke(var1, var5);
} catch (Throwable ex2) {
ex2.printStackTrace();
return PathType.BLOCKED;
}
}
if (var9.a(TagsFluid.WATER)) {
return PathType.WATER;
} else if (var9.a(TagsFluid.LAVA)) {
return PathType.LAVA;
} else {
return var6.a(var1, var5, PathMode.LAND) ? PathType.OPEN : PathType.BLOCKED;
}
}
} else {
return PathType.TRAPDOOR;
}
}
Aggregations