mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-13 19:26:14 +00:00
move more things to new modules
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package com.dfsek.terra.api.config;
|
||||
|
||||
import com.dfsek.tectonic.config.ConfigTemplate;
|
||||
|
||||
public interface AbstractableTemplate extends ConfigTemplate {
|
||||
String getID();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.dfsek.terra.api.config;
|
||||
|
||||
import com.dfsek.tectonic.config.ConfigTemplate;
|
||||
import com.dfsek.tectonic.exception.LoadException;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
|
||||
public interface ConfigFactory<C extends ConfigTemplate, O> {
|
||||
O build(C config, TerraPlugin main) throws LoadException;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.dfsek.terra.api.structure;
|
||||
|
||||
import com.dfsek.terra.api.util.ProbabilityCollection;
|
||||
import com.dfsek.terra.api.util.Range;
|
||||
|
||||
public interface ConfiguredStructure {
|
||||
ProbabilityCollection<Structure> getStructure();
|
||||
|
||||
Range getSpawnStart();
|
||||
|
||||
StructureSpawn getSpawn();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.dfsek.terra.api.structure;
|
||||
|
||||
import com.dfsek.terra.api.vector.Vector3;
|
||||
|
||||
public interface StructureSpawn {
|
||||
/**
|
||||
* Get nearest spawn point
|
||||
*
|
||||
* @param x X coordinate
|
||||
* @param z Z coordinate
|
||||
* @param seed Seed for RNG
|
||||
* @return Vector representing nearest spawnpoint
|
||||
*/
|
||||
Vector3 getNearestSpawn(int x, int z, long seed);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.dfsek.terra.api.util.seeded;
|
||||
|
||||
import com.dfsek.terra.api.util.ProbabilityCollection;
|
||||
import com.dfsek.terra.api.world.biome.Biome;
|
||||
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||
|
||||
public interface BiomeBuilder extends SeededBuilder<TerraBiome> {
|
||||
ProbabilityCollection<Biome> getVanillaBiomes();
|
||||
}
|
||||
@@ -7,4 +7,18 @@ public interface NoiseSeeded extends SeededBuilder<NoiseSampler> {
|
||||
NoiseSampler apply(Long seed);
|
||||
|
||||
int getDimensions();
|
||||
|
||||
static NoiseSeeded zero(int dimensions) {
|
||||
return new NoiseSeeded() {
|
||||
@Override
|
||||
public NoiseSampler apply(Long seed) {
|
||||
return NoiseSampler.zero();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDimensions() {
|
||||
return dimensions;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.dfsek.terra.api.world.biome.generation.pipeline;
|
||||
|
||||
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||
|
||||
public interface BiomeExpander {
|
||||
TerraBiome getBetween(double x, double z, TerraBiome... others);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.dfsek.terra.api.world.biome.generation.pipeline;
|
||||
|
||||
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||
|
||||
public interface BiomeHolder {
|
||||
BiomeHolder expand(BiomeExpander expander);
|
||||
|
||||
void mutate(BiomeMutator mutator);
|
||||
|
||||
void fill(BiomeSource source);
|
||||
|
||||
TerraBiome getBiome(int x, int z);
|
||||
|
||||
TerraBiome getBiomeRaw(int x, int z);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.dfsek.terra.api.world.biome.generation.pipeline;
|
||||
|
||||
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||
|
||||
public interface BiomeMutator {
|
||||
TerraBiome mutate(ViewPoint viewPoint, double x, double z);
|
||||
|
||||
class ViewPoint {
|
||||
private final BiomeHolder biomes;
|
||||
private final int offX;
|
||||
private final int offZ;
|
||||
|
||||
public ViewPoint(BiomeHolder biomes, int offX, int offZ) {
|
||||
this.biomes = biomes;
|
||||
this.offX = offX;
|
||||
this.offZ = offZ;
|
||||
}
|
||||
|
||||
|
||||
public TerraBiome getBiome(int x, int z) {
|
||||
return biomes.getBiomeRaw(x + offX, z + offZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.dfsek.terra.api.world.biome.generation.pipeline;
|
||||
|
||||
public interface Stage {
|
||||
boolean isExpansion();
|
||||
|
||||
BiomeHolder apply(BiomeHolder in);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user