package org.egordorichev.lasttry.entity.entities.world.generator.generators;

import org.egordorichev.lasttry.entity.component.SizeComponent;
import org.egordorichev.lasttry.entity.entities.world.World;
import org.egordorichev.lasttry.entity.entities.world.chunk.Chunk;
import org.egordorichev.lasttry.entity.entities.world.generator.WorldGenerator;

public class ForestGenerator extends WorldGenerator {
	public ForestGenerator(String name) {
		super(name);
	}

	/**
	 * Generates a forest world
	 *
	 * @return New world
	 */
	@Override
	public World generate() {
		this.world = new World(this.name, "forest");
		SizeComponent size = this.world.getComponent(SizeComponent.class);

		int width = (int) (size.width * Chunk.SIZE);
		int height = (int) (size.height * Chunk.SIZE)x;

		int groundLevel = height / 4 * 3;

		for (int y = 0; y < height; y++) {
			for (int x = 0; x < width; x++) {
				if (y < groundLevel + Math.cos(x / 4) * 4) {
					this.world.setBlock("lt:dirt", (short) x, (short) y);
				}
			}
		}

		return this.world;
	}
}
@@ -770,17 +770,16 @@
 nk.SIZE)
-x
 ;%0A%0A%09%09int

Fix unneed char