From b4697ab9dbece2afc8d4edbd86678fa8735578b9 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 19 Mar 2013 08:32:02 +0000 Subject: The subgenerators use cChunkDesc instead of raw arrays. cChunkDesc is based on cBlockArea. Initial version of Lakes generator. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1286 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/FinishGen.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'source/Generating/FinishGen.cpp') diff --git a/source/Generating/FinishGen.cpp b/source/Generating/FinishGen.cpp index 6a7d53b14..df9b2f265 100644 --- a/source/Generating/FinishGen.cpp +++ b/source/Generating/FinishGen.cpp @@ -598,7 +598,7 @@ void cFinishGenFluidSprings::GenFinish(cChunkDesc & a_ChunkDesc) case E_BLOCK_NETHERRACK: case E_BLOCK_STONE: { - if (TryPlaceSpring(a_ChunkDesc.GetBlockTypes(), a_ChunkDesc.GetBlockMetas(), x, y, z)) + if (TryPlaceSpring(a_ChunkDesc, x, y, z)) { // Succeeded, bail out return; @@ -614,15 +614,11 @@ void cFinishGenFluidSprings::GenFinish(cChunkDesc & a_ChunkDesc) -bool cFinishGenFluidSprings::TryPlaceSpring( - cChunkDef::BlockTypes & a_BlockTypes, - cChunkDef::BlockNibbles & a_BlockMetas, - int x, int y, int z -) +bool cFinishGenFluidSprings::TryPlaceSpring(cChunkDesc & a_ChunkDesc, int x, int y, int z) { // In order to place a spring, it needs exactly one of the XZ neighbors or a below neighbor to be air // Also, its neighbor on top of it must be non-air - if (cChunkDef::GetBlock(a_BlockTypes, x, y + 1, z) == E_BLOCK_AIR) + if (a_ChunkDesc.GetBlockType(x, y + 1, z) == E_BLOCK_AIR) { return false; } @@ -641,7 +637,7 @@ bool cFinishGenFluidSprings::TryPlaceSpring( int NumAirNeighbors = 0; for (int i = 0; i < ARRAYCOUNT(Coords); i++) { - switch (cChunkDef::GetBlock(a_BlockTypes, x + Coords[i].x, y + Coords[i].y, z + Coords[i].z)) + switch (a_ChunkDesc.GetBlockType(x + Coords[i].x, y + Coords[i].y, z + Coords[i].z)) { case E_BLOCK_AIR: { @@ -659,8 +655,7 @@ bool cFinishGenFluidSprings::TryPlaceSpring( } // Has exactly one air neighbor, place a spring: - cChunkDef::SetBlock(a_BlockTypes, x, y, z, m_Fluid); - cChunkDef::SetNibble(a_BlockMetas, x, y, z, 0); + a_ChunkDesc.SetBlockTypeMeta(x, y, z, m_Fluid, 0); return true; } -- cgit v1.2.3