0 Members and 4 Guests are viewing this topic.
I highly doubt the mighty Notch himself would descend to speak with such lowly mortals as us, when there are so many other people who can probably solve our problems
"Hey Notch do you know Axe?"
public static byte[][] createAndValidateTopMap(int w, int h) { int attempt = 0; do { byte[][] result = createTopMap(w, h); int[] count = new int[256]; for (int i = 0; i < w * h; i++) { count[result[0][i] & 0xff]++; } if (count[Tile.rock.id & 0xff] < 100) continue; if (count[Tile.sand.id & 0xff] < 100) continue; if (count[Tile.grass.id & 0xff] < 100) continue; if (count[Tile.tree.id & 0xff] < 100) continue; if (count[Tile.stairsDown.id & 0xff] < 2) continue; return result; } while (true); }