mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-16 13:23:07 +00:00
Generator -> GenerationSettings
This commit is contained in:
@@ -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.
|
||||
*
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user