Temperature drops while altitude is growing
This commit is contained in:
@@ -2,7 +2,6 @@ package mc.world.generated_world;
|
|||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import mc.core.block.BlockFactory;
|
import mc.core.block.BlockFactory;
|
||||||
import mc.core.block.BlockType;
|
|
||||||
import mc.core.world.*;
|
import mc.core.world.*;
|
||||||
import mc.world.generated_world.region.RegionImpl;
|
import mc.world.generated_world.region.RegionImpl;
|
||||||
import mc.world.generated_world.word.Temperature;
|
import mc.world.generated_world.word.Temperature;
|
||||||
@@ -127,7 +126,7 @@ public class SeedBasedWorldGenerator implements WorldGenerator {
|
|||||||
h = Math.min(WORLD_MAX_HEIGHT, h + WORLD_MIN_HEIGHT);
|
h = Math.min(WORLD_MAX_HEIGHT, h + WORLD_MIN_HEIGHT);
|
||||||
heightMap[x][z] = (int)(h);
|
heightMap[x][z] = (int)(h);
|
||||||
grassMap[x][z] = (int) (1 + SeedRandomGenerator.random(tx, tz, world.getSeed()) * (LANDFILL_GRASS_SURFACE_THIN - 1));
|
grassMap[x][z] = (int) (1 + SeedRandomGenerator.random(tx, tz, world.getSeed()) * (LANDFILL_GRASS_SURFACE_THIN - 1));
|
||||||
double k = Math.sqrt(noiseGenerator.noise(tx * WORLD_TEMPERATURE_GRAD_SIZE, tz * WORLD_TEMPERATURE_GRAD_SIZE));
|
double k = Math.sqrt(noiseGenerator.noise(tx * WORLD_TEMPERATURE_ZONE_SIZE, tz * WORLD_TEMPERATURE_ZONE_SIZE));
|
||||||
double q = Math.sqrt(noiseGenerator.noise(tx / WORLD_TEMPERATURE_SIZE, tz / WORLD_TEMPERATURE_SIZE));
|
double q = Math.sqrt(noiseGenerator.noise(tx / WORLD_TEMPERATURE_SIZE, tz / WORLD_TEMPERATURE_SIZE));
|
||||||
temperatureMap[x][z] = (int) (WORLD_MAX_TEMPERATURE * Math.min((k * k + q * q + k * q) * k * q, 0.99));
|
temperatureMap[x][z] = (int) (WORLD_MAX_TEMPERATURE * Math.min((k * k + q * q + k * q) * k * q, 0.99));
|
||||||
if (heightMap[x][z] < WORLD_SEA_LEVEL) {
|
if (heightMap[x][z] < WORLD_SEA_LEVEL) {
|
||||||
@@ -156,6 +155,7 @@ public class SeedBasedWorldGenerator implements WorldGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
wetMap[x][z] = (int) (mid / 9 * (1 + 0.1 * SeedRandomGenerator.random(x, z, world.getSeed())));
|
wetMap[x][z] = (int) (mid / 9 * (1 + 0.1 * SeedRandomGenerator.random(x, z, world.getSeed())));
|
||||||
|
temperatureMap[x][z] = (int) Math.min(Math.max(temperatureMap[x][z] - WORLD_TEMPERATURE_HEIGHT_GRAD_SIZE * SeedRandomGenerator.random(x, z, world.getSeed()) * (heightMap[x][z] - WORLD_SEA_LEVEL), 0), WORLD_MAX_TEMPERATURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ public class SeedBasedWorldGenerator implements WorldGenerator {
|
|||||||
} catch (Exception e) {}
|
} catch (Exception e) {}
|
||||||
// ================================ DEBUG FINISH =======================================
|
// ================================ DEBUG FINISH =======================================
|
||||||
|
|
||||||
for (int x = 0; x < WorldConstants.WORLD_REGION_SIZE; x ++) {
|
/*for (int x = 0; x < WorldConstants.WORLD_REGION_SIZE; x ++) {
|
||||||
for (int z = 0; z < WorldConstants.WORLD_REGION_SIZE; z ++) {
|
for (int z = 0; z < WorldConstants.WORLD_REGION_SIZE; z ++) {
|
||||||
region.setBiome(x, z, biomes[x][z]);
|
region.setBiome(x, z, biomes[x][z]);
|
||||||
if (heightMap[x][z] < WORLD_SEA_LEVEL) {
|
if (heightMap[x][z] < WORLD_SEA_LEVEL) {
|
||||||
@@ -260,7 +260,7 @@ public class SeedBasedWorldGenerator implements WorldGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private Biome selectBiome (Temperature temperature, Wetness wetness, int height) {
|
private Biome selectBiome (Temperature temperature, Wetness wetness, int height) {
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ public final class WorldConstants {
|
|||||||
public static final double WORLD_LAND_SIZE = 53.0;
|
public static final double WORLD_LAND_SIZE = 53.0;
|
||||||
public static final double WORLD_LAKE_SIZE = 6.0;
|
public static final double WORLD_LAKE_SIZE = 6.0;
|
||||||
public static final double WORLD_TEMPERATURE_SIZE = 41.0;
|
public static final double WORLD_TEMPERATURE_SIZE = 41.0;
|
||||||
public static final double WORLD_TEMPERATURE_GRAD_SIZE = 2.99;
|
public static final double WORLD_TEMPERATURE_ZONE_SIZE = 2.99;
|
||||||
|
public static final double WORLD_TEMPERATURE_HEIGHT_GRAD_SIZE = 0.25;
|
||||||
|
|
||||||
|
|
||||||
public static final int LANDFILL_GRASS_SURFACE_THIN = 5;
|
public static final int LANDFILL_GRASS_SURFACE_THIN = 5;
|
||||||
|
|||||||
Reference in New Issue
Block a user