@SuppressWarnings("unchecked") public static boolean isVillageNearby(World world, BlockPos pos, int radius) { FRLog.debug("Checking Villages..."); if (world.villageCollectionObj != null) for (Village village : (List<Village>) world.villageCollectionObj.getVillageList()) { if (Math.sqrt(village.getCenter().distanceSq(pos)) < (village.getVillageRadius() + radius)) return true; } return false; }