use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
public static int a(IBlockAccess paramIBlockAccess, Entity paramEntity, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) {
int k = 0;
BlockPosition localBlockPosition = new BlockPosition(paramEntity);
BlockPosition.MutableBlockPosition localMutableBlockPosition = new BlockPosition.MutableBlockPosition();
for (int m = paramInt1; m < paramInt1 + paramInt4; m++) {
for (int n = paramInt2; n < paramInt2 + paramInt5; n++) {
for (int i1 = paramInt3; i1 < paramInt3 + paramInt6; i1++) {
localMutableBlockPosition.c(m, n, i1);
Block localBlock = paramIBlockAccess.getType(localMutableBlockPosition).getBlock();
if (localBlock.getMaterial() != Material.AIR) {
if ((localBlock == Blocks.TRAPDOOR) || (localBlock == Blocks.IRON_TRAPDOOR)) {
k = 1;
} else if ((localBlock == Blocks.FLOWING_WATER) || (localBlock == Blocks.WATER)) {
if (paramBoolean1) {
return -1;
}
k = 1;
} else if ((!paramBoolean3) && ((localBlock instanceof BlockDoor)) && (localBlock.getMaterial() == Material.WOOD)) {
return 0;
}
if ((paramEntity.world.getType(localMutableBlockPosition).getBlock() instanceof BlockMinecartTrackAbstract)) {
if ((!(paramEntity.world.getType(localBlockPosition).getBlock() instanceof BlockMinecartTrackAbstract)) && (!(paramEntity.world.getType(localBlockPosition.down()).getBlock() instanceof BlockMinecartTrackAbstract))) {
return -3;
}
} else if (!localBlock.b(paramIBlockAccess, localMutableBlockPosition)) {
if ((!paramBoolean2) || (!(localBlock instanceof BlockDoor)) || (localBlock.getMaterial() != Material.WOOD)) {
if (((localBlock instanceof BlockFence)) || ((localBlock instanceof BlockFenceGate)) || ((localBlock instanceof BlockCobbleWall))) {
return -3;
}
if ((localBlock == Blocks.TRAPDOOR) || (localBlock == Blocks.IRON_TRAPDOOR)) {
return -4;
}
Material localMaterial = localBlock.getMaterial();
if (localMaterial == Material.LAVA) {
if (!paramEntity.ab()) {
return -2;
}
} else {
return 0;
}
}
}
}
}
}
}
return k != 0 ? 2 : 1;
}
use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
@Override
public PathPoint a(Entity paramEntity) {
int k;
if ((this.i) && (paramEntity.V())) {
k = (int) paramEntity.getBoundingBox().b;
BlockPosition.MutableBlockPosition localMutableBlockPosition = new BlockPosition.MutableBlockPosition(MathHelper.floor(paramEntity.locX), k, MathHelper.floor(paramEntity.locZ));
Block localBlock = this.a.getType(localMutableBlockPosition).getBlock();
while ((localBlock == Blocks.FLOWING_WATER) || (localBlock == Blocks.WATER)) {
k++;
localMutableBlockPosition.c(MathHelper.floor(paramEntity.locX), k, MathHelper.floor(paramEntity.locZ));
localBlock = this.a.getType(localMutableBlockPosition).getBlock();
}
this.h = false;
} else {
k = MathHelper.floor(paramEntity.getBoundingBox().b + 0.5D);
}
return a(MathHelper.floor(paramEntity.getBoundingBox().a), k, MathHelper.floor(paramEntity.getBoundingBox().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.getBoundingBox().minY);
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.getBoundingBox().minY);
} else {
return MathHelper.floor(this.a.getBoundingBox().minY + 0.5D);
}
}
use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
@Override
public PathType a(IBlockAccess var0, int var1, int var2, int var3) {
PathType var4 = this.b(var0, var1, var2, var3);
if (var4 == PathType.OPEN && var2 >= 1) {
Block var5 = var0.getType(new BlockPosition(var1, var2 - 1, var3)).getBlock();
PathType var6 = this.b(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;
}
}
var4 = this.a(var0, var1, var2, var3, var4);
return var4;
}
use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method b.
protected PathType b(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 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) || var5.get(BlockFenceGate.OPEN))) {
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.FENCE;
}
} else {
return PathType.TRAPDOOR;
}
}
Aggregations