public boolean isStackValid(int i, int j, int k) { Block yNegBlock = worldObj.getBlock(i, j - 1, k); if (yNegBlock != TFCBlocks.Molten && worldObj.getBlock(i, j - 1, k).getMaterial() != Material.rock && !worldObj.getBlock(i, j - 1, k).isNormalCube() && yNegBlock != TFCBlocks.BlastFurnace && TFC_Core.isTopFaceSolid(worldObj, i, j - 1, k)) { return false; } maxValidStackSize = 0; for (int num = 0; num < 5; num++) { if (!((BlockBlastFurnace) TFCBlocks.BlastFurnace).checkStackAt(worldObj, i, j + num, k)) break; maxValidStackSize++; } if (maxValidStackSize == 0) return false; return true; }
private boolean checkVertical(World world, int x, int y, int z, boolean flip) { int dir = world.getBlockMetadata(x, y, z) & 3; if (flip) dir = flipDir(dir); boolean b = false; boolean t = false; if ((world.getBlock(x, y - 1, z).getMaterial() == Material.rock || world.getBlock(x, y - 1, z).getMaterial() == Material.iron) && world.getBlock(x, y - 1, z).isOpaqueCube()) b = true; if (!b && world.getBlock(x, y - 1, z) == TFCBlocks.Detailed || world.getBlock(x, y - 1, z) == TFCBlocks.stoneSlabs) { switch (dir) { case 0: if (TFC_Core.isNorthFaceSolid(world, x, y - 1, z) && TFC_Core.isEastFaceSolid(world, x, y - 1, z) && TFC_Core.isWestFaceSolid(world, x, y - 1, z)) b = true; break; case 1: if (TFC_Core.isEastFaceSolid(world, x, y - 1, z) && TFC_Core.isNorthFaceSolid(world, x, y - 1, z) && TFC_Core.isSouthFaceSolid(world, x, y - 1, z)) b = true; break; case 2: if (TFC_Core.isSouthFaceSolid(world, x, y - 1, z) && TFC_Core.isEastFaceSolid(world, x, y - 1, z) && TFC_Core.isWestFaceSolid(world, x, y - 1, z)) b = true; break; case 3: if (TFC_Core.isWestFaceSolid(world, x, y - 1, z) && TFC_Core.isNorthFaceSolid(world, x, y - 1, z) && TFC_Core.isSouthFaceSolid(world, x, y - 1, z)) b = true; break; } if (!TFC_Core.isTopFaceSolid(world, x, y - 1, z)) b = false; } if ((world.getBlock(x, y + 1, z).getMaterial() == Material.rock || world.getBlock(x, y + 1, z).getMaterial() == Material.iron) && world.getBlock(x, y + 1, z).isOpaqueCube()) t = true; if (!t && world.getBlock(x, y + 1, z) == TFCBlocks.Detailed || world.getBlock(x, y + 1, z) == TFCBlocks.stoneSlabs) { switch (dir) { case 0: if (TFC_Core.isNorthFaceSolid(world, x, y + 1, z) && TFC_Core.isEastFaceSolid(world, x, y + 1, z) && TFC_Core.isWestFaceSolid(world, x, y + 1, z)) t = true; break; case 1: if (TFC_Core.isEastFaceSolid(world, x, y + 1, z) && TFC_Core.isNorthFaceSolid(world, x, y + 1, z) && TFC_Core.isSouthFaceSolid(world, x, y + 1, z)) t = true; break; case 2: if (TFC_Core.isSouthFaceSolid(world, x, y + 1, z) && TFC_Core.isEastFaceSolid(world, x, y + 1, z) && TFC_Core.isWestFaceSolid(world, x, y + 1, z)) t = true; break; case 3: if (TFC_Core.isWestFaceSolid(world, x, y + 1, z) && TFC_Core.isNorthFaceSolid(world, x, y + 1, z) && TFC_Core.isSouthFaceSolid(world, x, y + 1, z)) t = true; break; } if (!TFC_Core.isBottomFaceSolid(world, x, y + 1, z) || !TFC_Core.isTopFaceSolid(world, x, y + 1, z)) t = false; } if (b && t) return true; return false; }
private boolean checkHorizontal(World world, int x, int y, int z, boolean flip) { int dir = world.getBlockMetadata(x, y, z) & 3; if (flip) dir = flipDir(dir); int[] map = sidesMap[dir]; boolean l = false; boolean r = false; if ((world.getBlock(x - map[0], y, z - map[1]).getMaterial() == Material.rock || world.getBlock(x - map[0], y, z - map[1]).getMaterial() == Material.iron) && world.getBlock(x - map[0], y, z - map[1]).isOpaqueCube()) l = true; if (!l && world.getBlock(x - map[0], y, z - map[1]) == TFCBlocks.Detailed || world.getBlock(x - map[0], y, z - map[1]) == TFCBlocks.stoneSlabs) { switch (dir) { case 0: if (TFC_Core.isNorthFaceSolid(world, x - map[0], y, z - map[1]) && TFC_Core.isEastFaceSolid(world, x - map[0], y, z - map[1])) l = true; break; case 1: if (TFC_Core.isEastFaceSolid(world, x - map[0], y, z - map[1]) && TFC_Core.isSouthFaceSolid(world, x - map[0], y, z - map[1])) l = true; break; case 2: if (TFC_Core.isSouthFaceSolid(world, x - map[0], y, z - map[1]) && TFC_Core.isEastFaceSolid(world, x - map[0], y, z - map[1])) l = true; break; case 3: if (TFC_Core.isWestFaceSolid(world, x - map[0], y, z - map[1]) && TFC_Core.isSouthFaceSolid(world, x - map[0], y, z - map[1])) l = true; break; } if (!TFC_Core.isBottomFaceSolid(world, x - map[0], y, z - map[1])) l = false; if (!TFC_Core.isTopFaceSolid(world, x - map[0], y, z - map[1])) l = false; } if ((world.getBlock(x + map[0], y, z + map[1]).getMaterial() == Material.rock || world.getBlock(x + map[0], y, z + map[1]).getMaterial() == Material.iron) && world.getBlock(x + map[0], y, z + map[1]).isOpaqueCube()) r = true; if (!r && world.getBlock(x + map[0], y, z + map[1]) == TFCBlocks.Detailed || world.getBlock(x + map[0], y, z + map[1]) == TFCBlocks.stoneSlabs) { switch (dir) { case 0: if (TFC_Core.isNorthFaceSolid(world, x + map[0], y, z + map[1]) && TFC_Core.isWestFaceSolid(world, x + map[0], y, z + map[1])) r = true; break; case 1: if (TFC_Core.isEastFaceSolid(world, x + map[0], y, z + map[1]) && TFC_Core.isNorthFaceSolid(world, x + map[0], y, z + map[1])) r = true; break; case 2: if (TFC_Core.isSouthFaceSolid(world, x + map[0], y, z + map[1]) && TFC_Core.isWestFaceSolid(world, x + map[0], y, z + map[1])) r = true; break; case 3: if (TFC_Core.isWestFaceSolid(world, x + map[0], y, z + map[1]) && TFC_Core.isNorthFaceSolid(world, x + map[0], y, z + map[1])) r = true; break; } } if (!TFC_Core.isBottomFaceSolid(world, x + map[0], y, z + map[1])) r = false; if (!TFC_Core.isTopFaceSolid(world, x + map[0], y, z + map[1])) r = false; if (l && r) return true; return false; }