drastically simplify generator API

This commit is contained in:
dfsek
2021-12-02 19:45:22 -07:00
parent 71a39ba05b
commit e533555b52
26 changed files with 103 additions and 236 deletions

View File

@@ -1,6 +1,7 @@
package com.dfsek.terra.api.world;
import com.dfsek.terra.api.Handle;
import com.dfsek.terra.api.config.ConfigPack;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
@@ -15,4 +16,6 @@ public interface World extends Handle {
ChunkGenerator getGenerator();
BiomeProvider getBiomeProvider();
ConfigPack getPack();
}

View File

@@ -7,27 +7,21 @@
package com.dfsek.terra.api.world.chunk.generation;
import com.dfsek.terra.api.properties.PropertyHolder;
import com.dfsek.terra.api.world.World;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import com.dfsek.terra.api.block.state.BlockState;
import com.dfsek.terra.api.util.math.Sampler;
import com.dfsek.terra.api.util.vector.Vector3;
import com.dfsek.terra.api.util.vector.integer.Vector3Int;
import com.dfsek.terra.api.world.ServerWorld;
import com.dfsek.terra.api.world.WritableWorld;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
import com.dfsek.terra.api.world.chunk.generation.stage.GenerationStage;
public interface ChunkGenerator {
void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WritableWorld world,
int chunkZ, int chunkX);
Sampler createSampler(int chunkX, int chunkZ, BiomeProvider provider, World world, int elevationSmooth);
List<GenerationStage> getGenerationStages();

View File

@@ -1,17 +0,0 @@
/*
* Copyright (c) 2020-2021 Polyhedral Development
*
* The Terra API is licensed under the terms of the MIT License. For more details,
* reference the LICENSE file in the common/api directory.
*/
package com.dfsek.terra.api.world.chunk.generation.util.math;
import com.dfsek.terra.api.util.math.Sampler;
public interface SamplerProvider {
Sampler get(int x, int z);
Sampler getChunk(int cx, int cz);
}