mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
implement carving
This commit is contained in:
+8
-3
@@ -8,6 +8,8 @@
|
|||||||
package com.dfsek.terra.addons.chunkgenerator.generation.generators;
|
package com.dfsek.terra.addons.chunkgenerator.generation.generators;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.chunkgenerator.config.BiomeNoiseProperties;
|
||||||
|
|
||||||
import net.jafama.FastMath;
|
import net.jafama.FastMath;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@@ -70,6 +72,7 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
|||||||
int cz = zOrig + z;
|
int cz = zOrig + z;
|
||||||
|
|
||||||
Biome biome = grid.getBiome(cx, cz, seed);
|
Biome biome = grid.getBiome(cx, cz, seed);
|
||||||
|
BiomeNoiseProperties properties = biome.getContext().get(BiomeNoiseProperties.class);
|
||||||
|
|
||||||
PaletteInfo paletteInfo = biome.getContext().get(PaletteInfo.class);
|
PaletteInfo paletteInfo = biome.getContext().get(PaletteInfo.class);
|
||||||
|
|
||||||
@@ -79,9 +82,11 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
|||||||
BlockState data;
|
BlockState data;
|
||||||
for(int y = world.getMaxHeight() - 1; y >= world.getMinHeight(); y--) {
|
for(int y = world.getMaxHeight() - 1; y >= world.getMinHeight(); y--) {
|
||||||
if(sampler.sample(x, y, z) > 0) {
|
if(sampler.sample(x, y, z) > 0) {
|
||||||
data = PaletteUtil.getPalette(x, y, z, sampler, paletteInfo).get(paletteLevel, cx, y, cz,
|
if(properties.carving().noise(seed, cx, y, cz) < 0) {
|
||||||
seed);
|
data = PaletteUtil.getPalette(x, y, z, sampler, paletteInfo).get(paletteLevel, cx, y, cz,
|
||||||
chunk.setBlock(x, y, z, data);
|
seed);
|
||||||
|
chunk.setBlock(x, y, z, data);
|
||||||
|
}
|
||||||
|
|
||||||
paletteLevel++;
|
paletteLevel++;
|
||||||
} else if(y <= sea) {
|
} else if(y <= sea) {
|
||||||
|
|||||||
Reference in New Issue
Block a user