mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
clean up ChunkGenerator
This commit is contained in:
+2
-3
@@ -26,7 +26,7 @@ import com.dfsek.terra.api.world.World;
|
||||
import com.dfsek.terra.api.world.biome.GenerationSettings;
|
||||
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.generator.ChunkData;
|
||||
import com.dfsek.terra.api.world.generator.ProtoChunk;
|
||||
import com.dfsek.terra.api.world.generator.ChunkGenerator;
|
||||
import com.dfsek.terra.api.world.generator.GenerationStage;
|
||||
import com.dfsek.terra.api.world.generator.Palette;
|
||||
@@ -48,7 +48,7 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("try")
|
||||
public ChunkData generateChunkData(@NotNull World world, Random random, int chunkX, int chunkZ, ChunkData chunk) {
|
||||
public void generateChunkData(@NotNull World world, Random random, int chunkX, int chunkZ, ProtoChunk chunk) {
|
||||
try(ProfileFrame ignore = platform.getProfiler().profile("chunk_base_3d")) {
|
||||
BiomeProvider grid = world.getBiomeProvider();
|
||||
|
||||
@@ -92,7 +92,6 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
return chunk;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -7,6 +7,8 @@
|
||||
|
||||
package com.dfsek.terra.api.world.generator;
|
||||
|
||||
import com.dfsek.terra.api.util.vector.integer.Vector3Int;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
@@ -22,7 +24,7 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
|
||||
|
||||
public interface ChunkGenerator {
|
||||
ChunkData generateChunkData(@NotNull World world, Random random, int x, int z, ChunkData original);
|
||||
void generateChunkData(@NotNull World world, Random random, int x, int z, ProtoChunk original);
|
||||
Sampler createSampler(int chunkX, int chunkZ, BiomeProvider provider, World world, int elevationSmooth);
|
||||
|
||||
ConfigPack getConfigPack();
|
||||
@@ -36,4 +38,8 @@ public interface ChunkGenerator {
|
||||
default BlockState getBlock(World world, Vector3 vector3) {
|
||||
return getBlock(world, vector3.getBlockX(), vector3.getBlockY(), vector3.getBlockZ());
|
||||
}
|
||||
|
||||
default BlockState getBlock(World world, Vector3Int vector3) {
|
||||
return getBlock(world, vector3.getX(), vector3.getY(), vector3.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ package com.dfsek.terra.api.world.generator;
|
||||
import com.dfsek.terra.api.world.ChunkAccess;
|
||||
|
||||
|
||||
public interface ChunkData extends ChunkAccess {
|
||||
public interface ProtoChunk extends ChunkAccess {
|
||||
/**
|
||||
* Get the maximum height for the chunk.
|
||||
* <p>
|
||||
Reference in New Issue
Block a user