Shale biome implementation
This commit is contained in:
@@ -19,7 +19,8 @@ public class TODOPlanetGenerator extends PlanetGenerator{
|
||||
float scl = 5f;
|
||||
float waterOffset = 0.07f;
|
||||
|
||||
Block[][] arr = {
|
||||
Block[][] arr =
|
||||
{
|
||||
{Blocks.water, Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.darksand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.darksandTaintedWater, Blocks.snow, Blocks.ice},
|
||||
{Blocks.water, Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.darksandTaintedWater, Blocks.snow, Blocks.snow, Blocks.ice},
|
||||
{Blocks.water, Blocks.darksandWater, Blocks.darksand, Blocks.sand, Blocks.salt, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.darksandTaintedWater, Blocks.snow, Blocks.ice, Blocks.ice},
|
||||
@@ -32,7 +33,7 @@ public class TODOPlanetGenerator extends PlanetGenerator{
|
||||
{Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.sporeMoss, Blocks.ice, Blocks.ice, Blocks.snow, Blocks.snow, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice},
|
||||
{Blocks.taintedWater, Blocks.darksandTaintedWater, Blocks.darksand, Blocks.sporeMoss, Blocks.sporeMoss, Blocks.ice, Blocks.ice, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice},
|
||||
{Blocks.darksandTaintedWater, Blocks.darksandTaintedWater, Blocks.darksand, Blocks.sporeMoss, Blocks.moss, Blocks.sporeMoss, Blocks.iceSnow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice},
|
||||
{Blocks.darksandWater, Blocks.darksand, Blocks.darksand, Blocks.ice, Blocks.iceSnow, Blocks.iceSnow, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice}
|
||||
{Blocks.darksandWater, Blocks.darksand, Blocks.snow, Blocks.ice, Blocks.iceSnow, Blocks.snow, Blocks.snow, Blocks.snow, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice, Blocks.ice}
|
||||
};
|
||||
|
||||
ObjectMap<Block, Block> dec = ObjectMap.of(
|
||||
@@ -40,11 +41,17 @@ public class TODOPlanetGenerator extends PlanetGenerator{
|
||||
Blocks.moss, Blocks.sporeCluster
|
||||
);
|
||||
|
||||
ObjectMap<Block, Block> tars = ObjectMap.of(
|
||||
Blocks.sporeMoss, Blocks.shale,
|
||||
Blocks.moss, Blocks.shale
|
||||
);
|
||||
|
||||
float water = 2f / arr[0].length;
|
||||
|
||||
|
||||
float rawHeight(Vec3 position){
|
||||
position = Tmp.v33.set(position).scl(scl);
|
||||
return (Mathf.pow((float)noise.octaveNoise3D(7, 0.48f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);
|
||||
return (Mathf.pow((float)noise.octaveNoise3D(7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,15 +84,23 @@ public class TODOPlanetGenerator extends PlanetGenerator{
|
||||
|
||||
Block getBlock(Vec3 position){
|
||||
float height = rawHeight(position);
|
||||
Tmp.v31.set(position);
|
||||
position = Tmp.v33.set(position).scl(scl);
|
||||
float rad = scl;
|
||||
float temp = Mathf.clamp(Math.abs(position.y * 2f) / (rad));
|
||||
float tnoise = (float)noise.octaveNoise3D(7, 0.48f, 1f/3f, position.x, position.y + 999f, position.z);
|
||||
float tnoise = (float)noise.octaveNoise3D(7, 0.5f, 1f/3f, position.x, position.y + 999f, position.z);
|
||||
temp = Mathf.lerp(temp, tnoise, 0.5f);
|
||||
height *= 1.2f;
|
||||
height = Mathf.clamp(height);
|
||||
|
||||
return arr[Mathf.clamp((int)(temp * arr.length), 0, arr.length - 1)][Mathf.clamp((int)(height * arr[0].length), 0, arr[0].length - 1)];
|
||||
float tar = (float)noise.octaveNoise3D(4, 0.55f, 1f/2f, position.x, position.y + 999f, position.z) * 0.3f + Tmp.v31.dst(0, 0, 1f) * 0.2f;
|
||||
|
||||
Block res = arr[Mathf.clamp((int)(temp * arr.length), 0, arr[0].length - 1)][Mathf.clamp((int)(height * arr[0].length), 0, arr[0].length - 1)];
|
||||
if(tar > 0.5f){
|
||||
return tars.get(res, res);
|
||||
}else{
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user