Begin work on structure /locate, fix voxel geometry and add test commands, begin work on simplex caves

This commit is contained in:
dfsek
2020-10-04 02:23:35 -07:00
parent 188cf612fb
commit c80e65cce9
18 changed files with 583 additions and 46 deletions

View File

@@ -2,6 +2,7 @@ package com.dfsek.terra.population;
import com.dfsek.terra.TerraProfiler;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.carving.SimplexCarver;
import com.dfsek.terra.config.ConfigPack;
import com.dfsek.terra.config.base.ConfigUtil;
import com.dfsek.terra.config.genconfig.CarverConfig;
@@ -31,6 +32,7 @@ public class CavePopulator extends BlockPopulator {
if(ConfigUtil.masterDisableCaves) return;
try(ProfileFuture ignored = TerraProfiler.fromWorld(world).measure("CaveTime")) {
ConfigPack config = TerraWorld.getWorld(world).getConfig();
for(CarverConfig c : config.getCarvers().values()) {
Map<Location, Material> shiftCandidate = new HashMap<>();
Set<Block> updateNeeded = new HashSet<>();
@@ -78,6 +80,10 @@ public class CavePopulator extends BlockPopulator {
b.setBlockData(orig, true);
}
}
for(Map.Entry<Vector, CarvingData.CarvingType> e : new SimplexCarver(chunk.getX(), chunk.getZ()).carve(chunk.getX(), chunk.getZ(), world).getCarvedBlocks().entrySet()) {
Vector v = e.getKey();
chunk.getBlock(v.getBlockX(), v.getBlockY(), v.getBlockZ()).setBlockData(AIR, false);
}
}
}