Generator -> GenerationSettings

This commit is contained in:
dfsek
2021-07-22 18:35:10 -07:00
parent 2f9387fbf0
commit be9e817c88
11 changed files with 41 additions and 43 deletions

View File

@@ -2,7 +2,7 @@ package com.dfsek.terra.api.world.biome;
import com.dfsek.terra.api.noise.NoiseSampler;
public interface Generator {
public interface GenerationSettings {
/**
* Gets the noise sampler instance to use for base terrain.
*

View File

@@ -24,7 +24,7 @@ public interface TerraBiome extends PropertyHolder {
*
* @return BiomeTerrain - The terrain generation instance.
*/
Generator getGenerator(World w);
GenerationSettings getGenerator(World w);
int getColor();

View File

@@ -1,7 +1,7 @@
package com.dfsek.terra.api.world.generator;
import com.dfsek.terra.api.util.mutable.MutableInteger;
import com.dfsek.terra.api.world.biome.Generator;
import com.dfsek.terra.api.world.biome.GenerationSettings;
import java.util.Map;
@@ -20,11 +20,11 @@ public interface ChunkInterpolator {
}
default double computeNoise(Map<Generator, MutableInteger> gens, double x, double y, double z) {
default double computeNoise(Map<GenerationSettings, MutableInteger> gens, double x, double y, double z) {
double n = 0;
double div = 0;
for(Map.Entry<Generator, MutableInteger> entry : gens.entrySet()) {
Generator gen = entry.getKey();
for(Map.Entry<GenerationSettings, MutableInteger> entry : gens.entrySet()) {
GenerationSettings gen = entry.getKey();
int weight = entry.getValue().get();
double noise = computeNoise(gen, x, y, z);
@@ -34,5 +34,5 @@ public interface ChunkInterpolator {
return n / div;
}
double computeNoise(Generator generator, double x, double y, double z);
double computeNoise(GenerationSettings generationSettings, double x, double y, double z);
}