Skip to content

Commit

Permalink
Add sandy biome, desert biome no longer has water
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jan 15, 2023
1 parent c839f35 commit 0c53f8e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
19 changes: 17 additions & 2 deletions MCGalaxy/Generator/MapGenBiome.cs
Expand Up @@ -22,7 +22,7 @@ namespace MCGalaxy.Generator
{
public enum MapGenBiomeName
{
Forest, Arctic, Desert, Hell, Swamp, Mine
Forest, Arctic, Desert, Hell, Swamp, Mine, Sandy
}

/// <summary> Contains environment settings and the types of blocks that are used to generate a map </summary>
Expand Down Expand Up @@ -60,6 +60,7 @@ public struct MapGenBiome
case MapGenBiomeName.Hell: return Hell;
case MapGenBiomeName.Swamp: return Swamp;
case MapGenBiomeName.Mine: return Mine;
case MapGenBiomeName.Sandy: return Sandy;
}
return Forest;
}
Expand Down Expand Up @@ -104,7 +105,7 @@ public struct MapGenBiome
Surface = Block.Sand,
Ground = Block.Sand,
Cliff = Block.Gravel,
Water = Block.StillWater,
Water = Block.Air,
Bedrock = Block.Stone,
BeachSandy = Block.Sand,
BeachRocky = Block.Gravel,
Expand Down Expand Up @@ -155,5 +156,19 @@ public struct MapGenBiome
SkyColor = "#444444",
FogColor = "#777777",
};

public static MapGenBiome Sandy = new MapGenBiome()
{
Surface = Block.Sand,
Ground = Block.Sand,
Cliff = Block.Gravel,
Water = Block.StillWater,
Bedrock = Block.Stone,
BeachSandy = Block.Sand,
BeachRocky = Block.Gravel,
CloudColor = "#52C6F7",
Border = Block.Sand,
TreeType = "Palm",
};
}
}
2 changes: 1 addition & 1 deletion MCGalaxy/Generator/Realistic/RealisticMapGen.cs
Expand Up @@ -372,7 +372,7 @@ public sealed class RealisticMapGen
byte[] blocks = lvl.blocks;

// first layer used to be bedrock, but is now skipped over
// (since map generation would just replace it anyways)
// (since map generation will just replace it anyways)
index += oneY;

for (int y = 1; y < height; ++y)
Expand Down
5 changes: 3 additions & 2 deletions MCGalaxy/Generator/fCraft/fCraftMapGen.cs
Expand Up @@ -50,13 +50,15 @@ public sealed class fCraftMapGen

void ApplyBiome(Level map) {
MapGenBiome biome = MapGenBiome.Get(args.Biome);
bGroundSurface = biome.Surface;
bGroundSurface = biome.Surface;
bWater = biome.Water;
bGround = biome.Ground;
bSeaFloor = biome.BeachSandy;
bBedrock = biome.Bedrock;
bCliff = biome.Cliff;

args.AddWater = biome.Water != Block.Air;

// TODO: temp hack, need a better solution
if (args.Biome == MapGenBiomeName.Arctic) groundThickness = 1;

Expand Down Expand Up @@ -412,7 +414,6 @@ public sealed class fCraftMapGen

args.Biome = theme;
args.AddTrees = theme == MapGenBiomeName.Forest;
args.AddWater = theme != MapGenBiomeName.Desert;
args.WaterLevel = (lvl.Height - 1) / 2;

new fCraftMapGen(args).Generate(lvl);
Expand Down
2 changes: 1 addition & 1 deletion MCGalaxy/Generator/fCraft/fCraftMapGenArgs.cs
Expand Up @@ -69,7 +69,7 @@ public sealed class fCraftMapGenArgs

case MapGenTemplate.Atoll:
return new fCraftMapGenArgs {
//Theme = MapGenThemeName.Desert,
//Biome = MapGenBiomeName.Sandy, TODO maybe?
MaxHeight = 2,
MaxDepth = 39,
UseBias = true,
Expand Down

0 comments on commit 0c53f8e

Please sign in to comment.