@Override public BlockRegion getRandom() { int minX = min.getBlockX(), maxX = max.getBlockX(); int minY = min.getBlockY(), maxY = max.getBlockY(); int minZ = min.getBlockZ(), maxZ = max.getBlockZ(); int x = OtherUtil.getRandom(minX, maxX); int y = OtherUtil.getRandom(minY, maxY); int z = OtherUtil.getRandom(minZ, maxZ); return new BlockRegion(null, x, y, z); }
@Override public BlockRegion getRandom() { // TODO: Optimise this code BlockRegion result; do { result = OtherUtil.getRandom(regions).getRandom(); } while (!isInside(result)); return result; }