/* * Returns the location of vanilla door within the bounds of NPCHouse npch. */ public static BlockPos findDoor(World worldIn, NPCHouse npch) { Block a = Blocks.acacia_door; Block b = Blocks.birch_door; Block c = Blocks.dark_oak_door; Block d = Blocks.iron_door; Block e = Blocks.jungle_door; Block f = Blocks.oak_door; Block g = Blocks.spruce_door; List<Block> doors = new ArrayList(); doors.add(a); doors.add(b); doors.add(c); doors.add(d); doors.add(e); doors.add(f); doors.add(g); BlockPos door = npch.getCorner(0); for (Block temp : doors) { door = BlockHelper.findInBox(worldIn, npch, temp); if (!door.equals(npch.getCorner(0))) { return door; } } return door; }
/* * Returns true if the given block can be found inside the NPCHouse npch. */ public static boolean isInBox(World worldIn, NPCHouse npch, Block block) { BlockPos pos = BlockHelper.findInBox(worldIn, npch, block); int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); int a = npch.getCorner(0).getX(); int b = npch.getCorner(0).getY(); int c = npch.getCorner(0).getZ(); if ((a == x) && (b == y) && (c == z)) { return false; } return true; }