diff options
author | madmaxoft <github@xoft.cz> | 2013-11-28 21:51:18 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-11-28 21:51:18 +0100 |
commit | 057821d9b7f1a563e0ee3cf1a3d462a28c8e0d58 (patch) | |
tree | 4078512b062b4f78dffa5ce8f6130faa089e2f74 | |
parent | Added new biomes to old height generators. (diff) | |
download | cuberite-057821d9b7f1a563e0ee3cf1a3d462a28c8e0d58.tar cuberite-057821d9b7f1a563e0ee3cf1a3d462a28c8e0d58.tar.gz cuberite-057821d9b7f1a563e0ee3cf1a3d462a28c8e0d58.tar.bz2 cuberite-057821d9b7f1a563e0ee3cf1a3d462a28c8e0d58.tar.lz cuberite-057821d9b7f1a563e0ee3cf1a3d462a28c8e0d58.tar.xz cuberite-057821d9b7f1a563e0ee3cf1a3d462a28c8e0d58.tar.zst cuberite-057821d9b7f1a563e0ee3cf1a3d462a28c8e0d58.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockID.h | 4 | ||||
-rw-r--r-- | src/Generating/CompoGen.cpp | 90 | ||||
-rw-r--r-- | src/Generating/CompoGen.h | 2 | ||||
-rw-r--r-- | src/Generating/DistortedHeightmap.cpp | 49 |
4 files changed, 145 insertions, 0 deletions
diff --git a/src/BlockID.h b/src/BlockID.h index f3cbc46d6..667ce4765 100644 --- a/src/BlockID.h +++ b/src/BlockID.h @@ -402,6 +402,10 @@ enum /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Block metas: + E_META_DIRT_NORMAL = 0, + E_META_DIRT_GRASSLESS = 1, + E_META_DIRT_PODZOL = 2, + // E_BLOCK_CHEST metas: E_META_CHEST_FACING_ZM = 2, E_META_CHEST_FACING_ZP = 3, diff --git a/src/Generating/CompoGen.cpp b/src/Generating/CompoGen.cpp index 03a65a457..f929ddc2f 100644 --- a/src/Generating/CompoGen.cpp +++ b/src/Generating/CompoGen.cpp @@ -250,12 +250,61 @@ void cCompoGenBiomal::ComposeTerrain(cChunkDesc & a_ChunkDesc) case biExtremeHillsEdge: case biJungle: case biJungleHills: + case biJungleEdge: + case biDeepOcean: + case biStoneBeach: + case biColdBeach: + case biBirchForest: + case biBirchForestHills: + case biRoofedForest: + case biColdTaiga: + case biColdTaigaHills: + case biExtremeHillsPlus: + case biSavanna: + case biSavannaPlateau: + case biSunflowerPlains: + case biExtremeHillsM: + case biFlowerForest: + case biTaigaM: + case biSwamplandM: + case biIcePlainsSpikes: + case biJungleM: + case biJungleEdgeM: + case biBirchForestM: + case biBirchForestHillsM: + case biRoofedForestM: + case biColdTaigaM: + case biExtremeHillsPlusM: + case biSavannaM: + case biSavannaPlateauM: { FillColumnGrass(x, z, Height, a_ChunkDesc.GetBlockTypes()); break; } + + case biMesa: + case biMesaPlateauF: + case biMesaPlateau: + case biMesaBryce: + case biMesaPlateauFM: + case biMesaPlateauM: + { + FillColumnClay(x, z, Height, a_ChunkDesc.GetBlockTypes()); + break; + } + + case biMegaTaiga: + case biMegaTaigaHills: + case biMegaSpruceTaiga: + case biMegaSpruceTaigaHills: + { + FillColumnDirt(x, z, Height, a_ChunkDesc.GetBlockTypes()); + break; + } + case biDesertHills: case biDesert: + case biDesertM: case biBeach: { FillColumnSand(x, z, Height, a_ChunkDesc.GetBlockTypes()); @@ -341,6 +390,47 @@ void cCompoGenBiomal::FillColumnGrass(int a_RelX, int a_RelZ, int a_Height, cChu +void cCompoGenBiomal::FillColumnClay(int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes) +{ + BLOCKTYPE Pattern[] = + { + E_BLOCK_HARDENED_CLAY, + E_BLOCK_HARDENED_CLAY, + E_BLOCK_HARDENED_CLAY, + E_BLOCK_HARDENED_CLAY, + } ; + FillColumnPattern(a_RelX, a_RelZ, a_Height, a_BlockTypes, Pattern, ARRAYCOUNT(Pattern)); + + for (int y = a_Height - ARRAYCOUNT(Pattern); y > 0; y--) + { + cChunkDef::SetBlock(a_BlockTypes, a_RelX, y, a_RelZ, E_BLOCK_STONE); + } +} + + + + + +void cCompoGenBiomal::FillColumnDirt(int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes) +{ + for (int y = 0; y < 4; y++) + { + if (a_Height - y < 0) + { + return; + } + cChunkDef::SetBlock(a_BlockTypes, a_RelX, a_Height - y, a_RelZ, E_BLOCK_DIRT); + } + for (int y = a_Height - 4; y > 0; y--) + { + cChunkDef::SetBlock(a_BlockTypes, a_RelX, y, a_RelZ, E_BLOCK_STONE); + } +} + + + + + void cCompoGenBiomal::FillColumnSand(int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes) { BLOCKTYPE Pattern[] = diff --git a/src/Generating/CompoGen.h b/src/Generating/CompoGen.h index 2ee286b06..096b0fb5a 100644 --- a/src/Generating/CompoGen.h +++ b/src/Generating/CompoGen.h @@ -109,6 +109,8 @@ protected: virtual void InitializeCompoGen(cIniFile & a_IniFile) override; void FillColumnGrass (int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes); + void FillColumnClay (int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes); + void FillColumnDirt (int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes); void FillColumnSand (int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes); void FillColumnMycelium (int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes); void FillColumnWaterSand(int a_RelX, int a_RelZ, int a_Height, cChunkDef::BlockTypes & a_BlockTypes); diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp index c903199c3..afefcff2b 100644 --- a/src/Generating/DistortedHeightmap.cpp +++ b/src/Generating/DistortedHeightmap.cpp @@ -361,12 +361,61 @@ void cDistortedHeightmap::ComposeTerrain(cChunkDesc & a_ChunkDesc) case biExtremeHillsEdge: case biJungle: case biJungleHills: + case biJungleEdge: + case biDeepOcean: + case biStoneBeach: + case biColdBeach: + case biBirchForest: + case biBirchForestHills: + case biRoofedForest: + case biColdTaiga: + case biColdTaigaHills: + case biExtremeHillsPlus: + case biSavanna: + case biSavannaPlateau: + case biSunflowerPlains: + case biExtremeHillsM: + case biFlowerForest: + case biTaigaM: + case biSwamplandM: + case biIcePlainsSpikes: + case biJungleM: + case biJungleEdgeM: + case biBirchForestM: + case biBirchForestHillsM: + case biRoofedForestM: + case biColdTaigaM: + case biExtremeHillsPlusM: + case biSavannaM: + case biSavannaPlateauM: { a_ChunkDesc.SetBlockType(x, y, z, (y == LastAir - 1) ? E_BLOCK_GRASS : E_BLOCK_DIRT); break; } + + case biMesa: + case biMesaPlateauF: + case biMesaPlateau: + case biMesaBryce: + case biMesaPlateauFM: + case biMesaPlateauM: + { + a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_HARDENED_CLAY, 1); + break; + } + + case biMegaTaiga: + case biMegaTaigaHills: + case biMegaSpruceTaiga: + case biMegaSpruceTaigaHills: + { + a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_DIRT, (y == LastAir - 1) ? E_META_DIRT_PODZOL : 0); + break; + } + case biDesertHills: case biDesert: + case biDesertM: case biBeach: { a_ChunkDesc.SetBlockType(x, y, z, (y < LastAir - 3) ? E_BLOCK_SANDSTONE : E_BLOCK_SAND); |