Skip to content

Instantly share code, notes, and snippets.

@hube12
Created January 31, 2021 22:48
Show Gist options
  • Save hube12/8a3a17c8a094ea9169c104165108c1fe to your computer and use it in GitHub Desktop.
Save hube12/8a3a17c8a094ea9169c104165108c1fe to your computer and use it in GitHub Desktop.
protected void generateBands(long l) {
this.clayBands = new BlockState[64];
Arrays.fill(this.clayBands, TERRACOTTA);
WorldgenRandom worldgenRandom = new WorldgenRandom(l);
this.clayBandsOffsetNoise = new PerlinSimplexNoise(worldgenRandom, (List<Integer>)ImmutableList.of((Object)0));
for (int orange_bound = 0; orange_bound < 64; ++orange_bound) {
if ((orange_bound += worldgenRandom.nextInt(5) + 1) >= 64) continue;
this.clayBands[orange_bound] = ORANGE_TERRACOTTA;
}
int orange_bound = worldgenRandom.nextInt(4) + 2;
for (int yellow_bound = 0; yellow_bound < orange_bound; ++yellow_bound) {
int yellow_inner_bound = worldgenRandom.nextInt(3) + 1;
int yellow_inner_offset = worldgenRandom.nextInt(64);
for (int n = 0; yellow_inner_offset + n < 64 && n < yellow_inner_bound; ++n) {
this.clayBands[yellow_inner_offset + n] = YELLOW_TERRACOTTA;
}
}
int yellow_bound = worldgenRandom.nextInt(4) + 2;
for (int brown_bound = 0; brown_bound < yellow_bound; ++brown_bound) {
int brown_inner_bound = worldgenRandom.nextInt(3) + 2;
int brown_inner_offset = worldgenRandom.nextInt(64);
for (int n = 0; brown_inner_offset + n < 64 && n < brown_inner_bound; ++n) {
this.clayBands[brown_inner_offset + n] = BROWN_TERRACOTTA;
}
}
int brown_bound = worldgenRandom.nextInt(4) + 2;
for (int red_bound = 0; red_bound < brown_bound; ++red_bound) {
int red_inner_bound = worldgenRandom.nextInt(3) + 1;
int red_inner_offset = worldgenRandom.nextInt(64);
for (int n = 0; red_inner_offset + n < 64 && n < red_inner_bound; ++n) {
this.clayBands[red_inner_offset + n] = RED_TERRACOTTA;
}
}
int red_bound = worldgenRandom.nextInt(3) + 3;
int gray_base = 0;
for (int gray_bound = 0; gray_bound < red_bound; ++gray_bound) {
for (int i = 0; (gray_base += worldgenRandom.nextInt(16) + 4) + i < 64 && i < 1; ++i) {
this.clayBands[gray_base + i] = WHITE_TERRACOTTA;
if (gray_base + i > 1 && worldgenRandom.nextBoolean()) {
this.clayBands[gray_base + i - 1] = LIGHT_GRAY_TERRACOTTA;
}
if (gray_base + i >= 63 || !worldgenRandom.nextBoolean()) continue;
this.clayBands[gray_base + i + 1] = LIGHT_GRAY_TERRACOTTA;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment