<commit_before>package ethanjones.cubes.world.generator.smooth;

import ethanjones.cubes.block.Blocks;
import ethanjones.cubes.world.generator.TerrainGenerator;
import ethanjones.cubes.world.reference.BlockReference;
import ethanjones.cubes.world.server.WorldServer;
import ethanjones.cubes.world.storage.Area;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Random;

public class SmoothWorld extends TerrainGenerator {

  private static Random random = new Random();

  private final long baseSeed;
  private final Feature temperature;
  private final Feature rainfall;
  private final Feature height;
  private final Feature heightVariation;
  private final Feature trees;

  public SmoothWorld() {
    this(random.nextLong());
  }

  public SmoothWorld(long baseSeed) {
    this.baseSeed = baseSeed;
    temperature = new Feature(baseSeed + 1, 4, 1);
    rainfall = new Feature(baseSeed + 2, 4, 1);
    height = new Feature(baseSeed + 3, 4, 1);
    heightVariation = new Feature(baseSeed + 4, 4, 2);
    trees = new Feature(baseSeed + 5, 1, 3);
  }

  public static void main(String[] args) throws IOException {
    SmoothWorld smoothWorld = new SmoothWorld(0);
    BufferedImage image = new BufferedImage(4096, 4096, BufferedImage.TYPE_INT_RGB);
    for (int y = 0; y < 4096; y++) {
      for (int x = 0; x < 4096; x++) {
        double value = smoothWorld.height.eval(x, y);
        int c = (int) (255 * value);
        image.setRGB(x, y, new Color(c, c, c).getRGB());
      }
    }
    ImageIO.write(image, "png", new File("noise.png"));
    for (int y = 0; y < 4096; y++) {
      for (int x = 0; x < 4096; x++) {
        double value = smoothWorld.heightVariation.eval(x, y);
        int c = (int) (255 * value);
        image.setRGB(x, y, new Color(c, c, c).getRGB());
      }
    }
    ImageIO.write(image, "png", new File("noise2.png"));
  }

  @Override
  public void generate(Area area) {
    for (int x = 0; x < Area.SIZE_BLOCKS; x++) {<commit_msg>Log Smooth World Seed<commit_after>package ethanjones.cubes.world.generator.smooth;

import ethanjones.cubes.block.Blocks;
import ethanjones.cubes.core.logging.Log;
import ethanjones.cubes.world.generator.TerrainGenerator;
import ethanjones.cubes.world.reference.BlockReference;
import ethanjones.cubes.world.server.WorldServer;
import ethanjones.cubes.world.storage.Area;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Random;

public class SmoothWorld extends TerrainGenerator {

  private static Random random = new Random();

  private final long baseSeed;
  private final Feature temperature;
  private final Feature rainfall;
  private final Feature height;
  private final Feature heightVariation;
  private final Feature trees;

  public SmoothWorld() {
    this(random.nextLong());
  }

  public SmoothWorld(long baseSeed) {
    this.baseSeed = baseSeed;
    Log.info("Smooth World Seed: " + baseSeed);
    temperature = new Feature(baseSeed + 1, 4, 1);
    rainfall = new Feature(baseSeed + 2, 4, 1);
    height = new Feature(baseSeed + 3, 4, 1);
    heightVariation = new Feature(baseSeed + 4, 4, 2);
    trees = new Feature(baseSeed + 5, 1, 3);
  }

  public static void main(String[] args) throws IOException {
    SmoothWorld smoothWorld = new SmoothWorld(0);
    BufferedImage image = new BufferedImage(4096, 4096, BufferedImage.TYPE_INT_RGB);
    for (int y = 0; y < 4096; y++) {
      for (int x = 0; x < 4096; x++) {
        double value = smoothWorld.height.eval(x, y);
        int c = (int) (255 * value);
        image.setRGB(x, y, new Color(c, c, c).getRGB());
      }
    }
    ImageIO.write(image, "png", new File("noise.png"));
    for (int y = 0; y < 4096; y++) {
      for (int x = 0; x < 4096; x++) {
        double value = smoothWorld.heightVariation.eval(x, y);
        int c = (int) (255 * value);
        image.setRGB(x, y, new Color(c, c, c).getRGB());
      }
    }
    ImageIO.write(image, "png", new File("noise2.png"));
  }

  @Override
  public void generate(Area area) {
    for (int x = 0; x < Area.SIZE_BLOCKS; x++) {
{'fraction_non_alphanumeric': 0.1288416075650118, 'fraction_numerical': 0.02458628841607565, 'mean_word_length': 3.4490010515247107, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '981262', 'n_tokens_mistral': 1511, 'n_tokens_neox': 1403, 'n_words': 393}