WIP crystal biome

This commit is contained in:
Anuken
2022-01-18 20:35:43 -05:00
parent f3811d6710
commit 19ddc1dd65
39 changed files with 148 additions and 23 deletions

View File

@@ -364,6 +364,21 @@ public abstract class BasicGenerator implements WorldGenerator{
return false;
}
public boolean near(int cx, int cy, int rad, Block block){
for(int x = -rad; x <= rad; x++){
for(int y = -rad; y <= rad; y++){
int wx = cx + x, wy = cy + y;
if(Structs.inBounds(wx, wy, width, height) && Mathf.within(x, y, rad)){
Tile other = tiles.getn(wx, wy);
if(other.block() == block){
return true;
}
}
}
}
return false;
}
public void decoration(float chance){
pass((x, y) -> {
for(int i = 0; i < 4; i++){

View File

@@ -24,7 +24,8 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
public float heightScl = 0.9f, octaves = 8, persistence = 0.7f, heightPow = 3f, heightMult = 1.6f;
Block[][] arr = {
{Blocks.regolith, Blocks.regolith, Blocks.yellowStone, Blocks.rhyolite, Blocks.basalt}
//{Blocks.regolith, Blocks.regolith, Blocks.yellowStone, Blocks.rhyolite, Blocks.basalt}
{Blocks.regolith, Blocks.regolith, Blocks.yellowStone, Blocks.crystallineStone, Blocks.basalt}
};
@Override
@@ -210,9 +211,17 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
}
//TODO design ore generation so it doesn't overlap
if(noise(x + 999, y + 600, 4, 0.63f, 50f, 1f) < 0.2f/* && floor == Blocks.yellowStone*/){
ore = Blocks.oreThorium;
if(noise(x + 999, y + 600 - x, 4, 0.63f, 50f, 1f) < 0.25f && floor == Blocks.crystallineStone){
ore = Blocks.oreCrystalThorium;
}
if(noise(x + 999, y + 600 - x, 5, 0.8f, 50f, 1f) < 0.38f && floor == Blocks.crystallineStone){
floor = Blocks.crystalFloor;
}
}
if(block == Blocks.air && floor == Blocks.crystallineStone && rand.chance(0.08) && nearWall(x, y) && !near(x, y, 4, Blocks.crystalCluster)){
block = Blocks.crystalCluster;
}
});