use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.
the class PlayerNavigation method superF_.
protected void superF_() {
if (this.c != null) {
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));
Block var4 = var3.getBlock();
if (var4 == 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, var2.a(var2.a, var1.b + 1, var2.c));
}
}
}
}
}
use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.
the class PlayerNavigation method t.
private int t() {
if (this.a.isInWater() && this.r()) {
int var0 = MathHelper.floor(this.a.locY());
Block var1 = this.b.getType(new BlockPosition(this.a.locX(), var0, this.a.locZ())).getBlock();
int var2 = 0;
do {
if (var1 != Blocks.WATER) {
return var0;
}
++var0;
var1 = this.b.getType(new BlockPosition(this.a.locX(), var0, this.a.locZ())).getBlock();
++var2;
} while (var2 <= 16);
return MathHelper.floor(this.a.locY());
} else {
return MathHelper.floor(this.a.locY() + 0.5D);
}
}
use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method c.
protected static PathType c(IBlockAccess var0, int var1, int var2, int var3) {
BlockPosition var4 = new BlockPosition(var1, var2, var3);
IBlockData var5 = var0.getType(var4);
Block var6 = var5.getBlock();
Material var7 = var5.getMaterial();
if (var5.isAir()) {
return PathType.OPEN;
} else if (!var6.a(TagsBlock.TRAPDOORS) && var6 != Blocks.LILY_PAD) {
if (var6 == Blocks.FIRE) {
return PathType.DAMAGE_FIRE;
} else if (var6 == Blocks.CACTUS) {
return PathType.DAMAGE_CACTUS;
} else if (var6 == Blocks.SWEET_BERRY_BUSH) {
return PathType.DAMAGE_OTHER;
} else if (var6 == Blocks.HONEY_BLOCK) {
return PathType.STICKY_HONEY;
} else if (var6 == Blocks.COCOA) {
return PathType.COCOA;
} else if (var6 instanceof BlockDoor && var7 == Material.WOOD && !(Boolean) var5.get(BlockDoor.OPEN)) {
return PathType.DOOR_WOOD_CLOSED;
} else if (var6 instanceof BlockDoor && var7 == Material.ORE && !(Boolean) var5.get(BlockDoor.OPEN)) {
return PathType.DOOR_IRON_CLOSED;
} else if (var6 instanceof BlockDoor && var5.get(BlockDoor.OPEN)) {
return PathType.DOOR_OPEN;
} else if (var6 instanceof BlockMinecartTrackAbstract) {
return PathType.RAIL;
} else if (var6 instanceof BlockLeaves) {
return PathType.LEAVES;
} else if (var6.a(TagsBlock.FENCES) || var6.a(TagsBlock.WALLS) || var6 instanceof BlockFenceGate && !(Boolean) var5.get(BlockFenceGate.OPEN)) {
return PathType.FENCE;
} else {
Fluid var8 = var0.getFluid(var4);
if (var8.a(TagsFluid.WATER)) {
return PathType.WATER;
} else if (var8.a(TagsFluid.LAVA)) {
return PathType.LAVA;
} else {
return var5.a(var0, var4, PathMode.LAND) ? PathType.OPEN : PathType.BLOCKED;
}
}
} else {
return PathType.TRAPDOOR;
}
}
use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block 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 com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.
the class PlayerNavigation method b.
private boolean b(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
for (BlockPosition localBlockPosition : BlockPosition.a(new BlockPosition(paramInt1, paramInt2, paramInt3), new BlockPosition(paramInt1 + paramInt4 - 1, paramInt2 + paramInt5 - 1, paramInt3 + paramInt6 - 1))) {
double d1 = localBlockPosition.getX() + 0.5D - paramVec3D.x;
double d2 = localBlockPosition.getZ() + 0.5D - paramVec3D.z;
if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
Block localBlock = this.b.getType(localBlockPosition).getBlock();
if (!localBlock.b(this.b, localBlockPosition)) {
return false;
}
}
}
return true;
}
Aggregations