use of net.minecraft.server.v1_10_R1.BlockMinecartTrackAbstract in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
@Override
public PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, EntityInsentient paramEntityInsentient, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1, boolean paramBoolean2) {
EnumSet<PathType> localEnumSet = EnumSet.noneOf(PathType.class);
PathType localObject1 = PathType.BLOCKED;
BlockPosition localBlockPosition = new BlockPosition(paramEntityInsentient);
for (int i = 0; i < paramInt4; i++) {
for (int k = 0; k < paramInt5; k++) {
for (int m = 0; m < paramInt6; m++) {
int n = i + paramInt1;
int i1 = k + paramInt2;
int i2 = m + paramInt3;
PathType localPathType2 = a(paramIBlockAccess, n, i1, i2);
if ((localPathType2 == PathType.DOOR_WOOD_CLOSED) && (paramBoolean1) && (paramBoolean2)) {
localPathType2 = PathType.WALKABLE;
}
if ((localPathType2 == PathType.DOOR_OPEN) && (!paramBoolean2)) {
localPathType2 = PathType.BLOCKED;
}
if ((localPathType2 == PathType.RAIL) && (!(paramIBlockAccess.getType(localBlockPosition).getBlock() instanceof BlockMinecartTrackAbstract)) && (!(paramIBlockAccess.getType(localBlockPosition.down()).getBlock() instanceof BlockMinecartTrackAbstract))) {
localPathType2 = PathType.FENCE;
}
if ((i == 0) && (k == 0) && (m == 0)) {
localObject1 = localPathType2;
}
localEnumSet.add(localPathType2);
}
}
}
if (localEnumSet.contains(PathType.FENCE)) {
return PathType.FENCE;
}
PathType localObject2 = PathType.BLOCKED;
for (PathType localPathType1 : localEnumSet) {
if (paramEntityInsentient.a(localPathType1) < 0.0F) {
return localPathType1;
}
if (paramEntityInsentient.a(localPathType1) >= paramEntityInsentient.a(localObject2)) {
localObject2 = localPathType1;
}
}
if ((localObject1 == PathType.OPEN) && (paramEntityInsentient.a(localObject2) == 0.0F)) {
return PathType.OPEN;
}
return localObject2;
}
use of net.minecraft.server.v1_10_R1.BlockMinecartTrackAbstract in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
@Override
public PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, EntityHumanNPC paramEntityInsentient, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1, boolean paramBoolean2) {
EnumSet<PathType> localEnumSet = EnumSet.noneOf(PathType.class);
PathType localObject1 = PathType.BLOCKED;
BlockPosition localBlockPosition = new BlockPosition(paramEntityInsentient);
for (int i = 0; i < paramInt4; i++) {
for (int k = 0; k < paramInt5; k++) {
for (int m = 0; m < paramInt6; m++) {
int n = i + paramInt1;
int i1 = k + paramInt2;
int i2 = m + paramInt3;
PathType localPathType2 = a(paramIBlockAccess, n, i1, i2);
if ((localPathType2 == PathType.DOOR_WOOD_CLOSED) && (paramBoolean1) && (paramBoolean2)) {
localPathType2 = PathType.WALKABLE;
}
if ((localPathType2 == PathType.DOOR_OPEN) && (!paramBoolean2)) {
localPathType2 = PathType.BLOCKED;
}
if ((localPathType2 == PathType.RAIL) && (!(paramIBlockAccess.getType(localBlockPosition).getBlock() instanceof BlockMinecartTrackAbstract)) && (!(paramIBlockAccess.getType(localBlockPosition.down()).getBlock() instanceof BlockMinecartTrackAbstract))) {
localPathType2 = PathType.FENCE;
}
if ((i == 0) && (k == 0) && (m == 0)) {
localObject1 = localPathType2;
}
localEnumSet.add(localPathType2);
}
}
}
if (localEnumSet.contains(PathType.FENCE)) {
return PathType.FENCE;
}
PathType localObject2 = PathType.BLOCKED;
for (PathType localPathType1 : localEnumSet) {
if (paramEntityInsentient.a(localPathType1) < 0.0F) {
return localPathType1;
}
if (paramEntityInsentient.a(localPathType1) >= paramEntityInsentient.a(localObject2)) {
localObject2 = localPathType1;
}
}
if ((localObject1 == PathType.OPEN) && (paramEntityInsentient.a(localObject2) == 0.0F)) {
return PathType.OPEN;
}
return localObject2;
}
use of net.minecraft.server.v1_10_R1.BlockMinecartTrackAbstract in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method a.
public PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1, boolean paramBoolean2, EnumSet<PathType> paramEnumSet, PathType paramPathType, BlockPosition paramBlockPosition) {
for (int i = 0; i < paramInt4; i++) {
for (int k = 0; k < paramInt5; k++) {
for (int m = 0; m < paramInt6; m++) {
int n = i + paramInt1;
int i1 = k + paramInt2;
int i2 = m + paramInt3;
PathType localPathType = a(paramIBlockAccess, n, i1, i2);
if ((localPathType == PathType.DOOR_WOOD_CLOSED) && (paramBoolean1) && (paramBoolean2)) {
localPathType = PathType.WALKABLE;
}
if ((localPathType == PathType.DOOR_OPEN) && (!paramBoolean2)) {
localPathType = PathType.BLOCKED;
}
if ((localPathType == PathType.RAIL) && (!(paramIBlockAccess.getType(paramBlockPosition).getBlock() instanceof BlockMinecartTrackAbstract)) && (!(paramIBlockAccess.getType(paramBlockPosition.down()).getBlock() instanceof BlockMinecartTrackAbstract))) {
localPathType = PathType.FENCE;
}
if ((i == 0) && (k == 0) && (m == 0)) {
paramPathType = localPathType;
}
paramEnumSet.add(localPathType);
}
}
}
return paramPathType;
}
use of net.minecraft.server.v1_10_R1.BlockMinecartTrackAbstract in project Citizens2 by CitizensDev.
the class PlayerPathfinderNormal method b.
private PathType b(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3) {
BlockPosition localBlockPosition = new BlockPosition(paramInt1, paramInt2, paramInt3);
IBlockData localIBlockData = paramIBlockAccess.getType(localBlockPosition);
Block localBlock = localIBlockData.getBlock();
Material localMaterial = localIBlockData.getMaterial();
if (localMaterial == Material.AIR) {
return PathType.OPEN;
}
if ((localBlock == Blocks.TRAPDOOR) || (localBlock == Blocks.IRON_TRAPDOOR) || (localBlock == Blocks.WATERLILY)) {
return PathType.TRAPDOOR;
}
if (localBlock == Blocks.FIRE) {
return PathType.DAMAGE_FIRE;
}
if (localBlock == Blocks.CACTUS) {
return PathType.DAMAGE_CACTUS;
}
if (((localBlock instanceof BlockDoor)) && (localMaterial == Material.WOOD) && (!localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
return PathType.DOOR_WOOD_CLOSED;
}
if (((localBlock instanceof BlockDoor)) && (localMaterial == Material.ORE) && (!localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
return PathType.DOOR_IRON_CLOSED;
}
if (((localBlock instanceof BlockDoor)) && (localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
return PathType.DOOR_OPEN;
}
if ((localBlock instanceof BlockMinecartTrackAbstract)) {
return PathType.RAIL;
}
if (((localBlock instanceof BlockFence)) || ((localBlock instanceof BlockCobbleWall)) || (((localBlock instanceof BlockFenceGate)) && (!localIBlockData.get(BlockFenceGate.OPEN).booleanValue()))) {
return PathType.FENCE;
}
if (localMaterial == Material.WATER) {
return PathType.WATER;
}
if (localMaterial == Material.LAVA) {
return PathType.LAVA;
}
if (localBlock.b(paramIBlockAccess, localBlockPosition)) {
return PathType.OPEN;
}
return PathType.BLOCKED;
}
Aggregations