From e40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 26 Apr 2014 10:50:23 -0700 Subject: [PATCH 001/214] Implemented Chunk Sparsing with segments --- src/BlockArea.cpp | 170 ++++++------- src/BlockArea.h | 5 +- src/Chunk.cpp | 186 +++----------- src/Chunk.h | 32 +-- src/ChunkBuffer.cpp | 146 +++++++++++ src/ChunkBuffer.h | 310 ++++++++++++++++++++++++ src/ChunkDef.h | 100 +------- src/ChunkMap.cpp | 16 +- src/ChunkSender.h | 1 + src/Entities/FallingBlock.cpp | 5 +- src/LightingThread.cpp | 11 +- src/MobProximityCounter.cpp | 3 +- src/Simulator/FireSimulator.cpp | 10 +- src/WorldStorage/NBTChunkSerializer.cpp | 3 +- src/WorldStorage/NBTChunkSerializer.h | 4 +- src/WorldStorage/WSSCompact.cpp | 10 +- src/WorldStorage/WSSCompact.h | 3 +- 17 files changed, 612 insertions(+), 403 deletions(-) create mode 100644 src/ChunkBuffer.cpp create mode 100644 src/ChunkBuffer.h diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 40cca8882..b4b519bc7 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -9,7 +9,7 @@ #include "OSSupport/GZipFile.h" #include "Blocks/BlockHandler.h" #include "Cuboid.h" - +#include "ChunkBuffer.h" @@ -1909,116 +1909,88 @@ bool cBlockArea::cChunkReader::Coords(int a_ChunkX, int a_ChunkZ) -void cBlockArea::cChunkReader::BlockTypes(const BLOCKTYPE * a_BlockTypes) +void cBlockArea::cChunkReader::ChunkBuffer(const cChunkBuffer & a_BlockBuffer) { - if (m_Area.m_BlockTypes == NULL) - { - // Don't want BlockTypes - return; - } - - int SizeY = m_Area.m_Size.y; - int MinY = m_Origin.y; - - // SizeX, SizeZ are the dmensions of the block data to copy from the current chunk (size of the geometric union) - // OffX, OffZ are the offsets of the current chunk data from the area origin - // BaseX, BaseZ are the offsets of the area data within the current chunk from the chunk borders - int SizeX = cChunkDef::Width; - int SizeZ = cChunkDef::Width; - int OffX, OffZ; - int BaseX, BaseZ; - OffX = m_CurrentChunkX * cChunkDef::Width - m_Origin.x; - if (OffX < 0) - { - BaseX = -OffX; - SizeX += OffX; // SizeX is decreased, OffX is negative - OffX = 0; - } - else - { - BaseX = 0; - } - OffZ = m_CurrentChunkZ * cChunkDef::Width - m_Origin.z; - if (OffZ < 0) - { - BaseZ = -OffZ; - SizeZ += OffZ; // SizeZ is decreased, OffZ is negative - OffZ = 0; - } - else - { - BaseZ = 0; - } - // If the chunk extends beyond the area in the X or Z axis, cut off the Size: - if ((m_CurrentChunkX + 1) * cChunkDef::Width > m_Origin.x + m_Area.m_Size.x) - { - SizeX -= (m_CurrentChunkX + 1) * cChunkDef::Width - (m_Origin.x + m_Area.m_Size.x); - } - if ((m_CurrentChunkZ + 1) * cChunkDef::Width > m_Origin.z + m_Area.m_Size.z) - { - SizeZ -= (m_CurrentChunkZ + 1) * cChunkDef::Width - (m_Origin.z + m_Area.m_Size.z); - } - - for (int y = 0; y < SizeY; y++) - { - int ChunkY = MinY + y; - int AreaY = y; - for (int z = 0; z < SizeZ; z++) + { // BlockTypes + if (!(m_Area.m_BlockTypes == NULL)) { - int ChunkZ = BaseZ + z; - int AreaZ = OffZ + z; - for (int x = 0; x < SizeX; x++) + int SizeY = m_Area.m_Size.y; + int MinY = m_Origin.y; + + // SizeX, SizeZ are the dmensions of the block data to copy from the current chunk (size of the geometric union) + // OffX, OffZ are the offsets of the current chunk data from the area origin + // BaseX, BaseZ are the offsets of the area data within the current chunk from the chunk borders + int SizeX = cChunkDef::Width; + int SizeZ = cChunkDef::Width; + int OffX, OffZ; + int BaseX, BaseZ; + OffX = m_CurrentChunkX * cChunkDef::Width - m_Origin.x; + if (OffX < 0) { - int ChunkX = BaseX + x; - int AreaX = OffX + x; - m_Area.m_BlockTypes[m_Area.MakeIndex(AreaX, AreaY, AreaZ)] = cChunkDef::GetBlock(a_BlockTypes, ChunkX, ChunkY, ChunkZ); - } // for x - } // for z - } // for y -} + BaseX = -OffX; + SizeX += OffX; // SizeX is decreased, OffX is negative + OffX = 0; + } + else + { + BaseX = 0; + } + OffZ = m_CurrentChunkZ * cChunkDef::Width - m_Origin.z; + if (OffZ < 0) + { + BaseZ = -OffZ; + SizeZ += OffZ; // SizeZ is decreased, OffZ is negative + OffZ = 0; + } + else + { + BaseZ = 0; + } + // If the chunk extends beyond the area in the X or Z axis, cut off the Size: + if ((m_CurrentChunkX + 1) * cChunkDef::Width > m_Origin.x + m_Area.m_Size.x) + { + SizeX -= (m_CurrentChunkX + 1) * cChunkDef::Width - (m_Origin.x + m_Area.m_Size.x); + } + if ((m_CurrentChunkZ + 1) * cChunkDef::Width > m_Origin.z + m_Area.m_Size.z) + { + SizeZ -= (m_CurrentChunkZ + 1) * cChunkDef::Width - (m_Origin.z + m_Area.m_Size.z); + } - - - - -void cBlockArea::cChunkReader::BlockMeta(const NIBBLETYPE * a_BlockMetas) -{ - if (m_Area.m_BlockMetas == NULL) - { - // Don't want metas - return; + for (int y = 0; y < SizeY; y++) + { + int ChunkY = MinY + y; + int AreaY = y; + for (int z = 0; z < SizeZ; z++) + { + int ChunkZ = BaseZ + z; + int AreaZ = OffZ + z; + for (int x = 0; x < SizeX; x++) + { + int ChunkX = BaseX + x; + int AreaX = OffX + x; + m_Area.m_BlockTypes[m_Area.MakeIndex(AreaX, AreaY, AreaZ)] = a_BlockBuffer.GetBlock(ChunkX, ChunkY, ChunkZ); + } // for x + } // for z + } // for y + } } - CopyNibbles(m_Area.m_BlockMetas, a_BlockMetas); -} - - - - -void cBlockArea::cChunkReader::BlockLight(const NIBBLETYPE * a_BlockLight) -{ - if (m_Area.m_BlockLight == NULL) + if (m_Area.m_BlockMetas) { - // Don't want light - return; + a_BlockBuffer.CopyMeta(m_Area.m_BlockMetas); } - CopyNibbles(m_Area.m_BlockLight, a_BlockLight); -} - - - - -void cBlockArea::cChunkReader::BlockSkyLight(const NIBBLETYPE * a_BlockSkyLight) -{ - if (m_Area.m_BlockSkyLight == NULL) + if (m_Area.m_BlockLight) { - // Don't want skylight - return; + a_BlockBuffer.CopyLight(m_Area.m_BlockLight); } - CopyNibbles(m_Area.m_BlockSkyLight, a_BlockSkyLight); -} + if (m_Area.m_BlockSkyLight) + { + a_BlockBuffer.CopySkyLight(m_Area.m_BlockSkyLight); + } + +} diff --git a/src/BlockArea.h b/src/BlockArea.h index c48175b8c..d17a68fbb 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -317,10 +317,7 @@ protected: // cChunkDataCallback overrides: virtual bool Coords (int a_ChunkX, int a_ChunkZ) override; - virtual void BlockTypes (const BLOCKTYPE * a_BlockTypes) override; - virtual void BlockMeta (const NIBBLETYPE * a_BlockMetas) override; - virtual void BlockLight (const NIBBLETYPE * a_BlockLight) override; - virtual void BlockSkyLight(const NIBBLETYPE * a_BlockSkyLight) override; + virtual void ChunkBuffer (const cChunkBuffer & a_BlockTypes) override; } ; typedef NIBBLETYPE * NIBBLEARRAY; diff --git a/src/Chunk.cpp b/src/Chunk.cpp index ee1531b5c..171f329fb 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -241,23 +241,9 @@ void cChunk::GetAllData(cChunkDataCallback & a_Callback) a_Callback.HeightMap (&m_HeightMap); a_Callback.BiomeData (&m_BiomeMap); - std::vector Blocks = m_BlockTypes; - Blocks.resize(NumBlocks); - a_Callback.BlockTypes (&Blocks[0]); - - std::vector Metas = m_BlockMeta; - Metas.resize(NumBlocks / 2); - a_Callback.BlockMeta (&Metas[0]); - a_Callback.LightIsValid (m_IsLightValid); - std::vector BlockLights = m_BlockLight; - BlockLights.resize(NumBlocks / 2); - a_Callback.BlockLight (&BlockLights[0]); - - std::vector BlockSkyLights = m_BlockSkyLight; - BlockSkyLights.resize(NumBlocks / 2, 0xff); - a_Callback.BlockSkyLight(&BlockSkyLights[0]); + a_Callback.ChunkBuffer (m_ChunkBuffer); for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr) { @@ -296,48 +282,10 @@ void cChunk::SetAllData( CalculateHeightmap(a_BlockTypes); } - int IdxWhereNonEmptyStarts = 0; - { // Blocktype compression - unsigned char Highest = 0; - int X = 0, Z = 0; - m_BlockTypes.clear(); - - for (int x = 0; x < Width; x++) - { - for (int z = 0; z < Width; z++) - { - unsigned char Height = m_HeightMap[x + z * Width]; - if (Height > Highest) - { - Highest = Height; - X = x; Z = z; - } - } - } - - IdxWhereNonEmptyStarts = MakeIndexNoCheck(X, Highest + 1, Z); - - m_BlockTypes.insert(m_BlockTypes.end(), &a_BlockTypes[0], &a_BlockTypes[IdxWhereNonEmptyStarts]); - } - - { // Blockmeta compression - m_BlockMeta.clear(); - m_BlockMeta.insert(m_BlockMeta.end(), &a_BlockMeta[0], &a_BlockMeta[IdxWhereNonEmptyStarts / 2]); - } - - if (a_BlockLight != NULL) - { - // Compress blocklight - m_BlockLight.clear(); - m_BlockLight.insert(m_BlockLight.end(), &a_BlockLight[0], &a_BlockLight[IdxWhereNonEmptyStarts / 2]); - } - - if (a_BlockSkyLight != NULL) - { - // Compress skylight - m_BlockSkyLight.clear(); - m_BlockSkyLight.insert(m_BlockSkyLight.end(), &a_BlockSkyLight[0], &a_BlockSkyLight[IdxWhereNonEmptyStarts / 2]); - } + m_ChunkBuffer.SetBlocks (a_BlockTypes); + m_ChunkBuffer.SetMeta (a_BlockMeta); + m_ChunkBuffer.SetLight (a_BlockLight); + m_ChunkBuffer.SetSkyLight (a_BlockSkyLight); m_IsLightValid = (a_BlockLight != NULL) && (a_BlockSkyLight != NULL); @@ -378,39 +326,9 @@ void cChunk::SetLight( // TODO: We might get cases of wrong lighting when a chunk changes in the middle of a lighting calculation. // Postponing until we see how bad it is :) - { // Compress blocklight - bool FoundNonEmpty = false; - int IdxWhereNonEmptyStarts = 0; - m_BlockLight.clear(); + m_ChunkBuffer.SetLight (a_BlockLight); - for (int Idx = (NumBlocks / 2) - 1; Idx >= 0; Idx--) - { - if (a_BlockLight[Idx] != 0) - { - FoundNonEmpty = true; - IdxWhereNonEmptyStarts = Idx; - break; - } - } - m_BlockLight.insert(m_BlockLight.end(), &a_BlockLight[0], &a_BlockLight[IdxWhereNonEmptyStarts + 1]); - } - - { // Compress skylight - bool FoundNonEmpty = false; - int IdxWhereNonEmptyStarts = 0; - m_BlockSkyLight.clear(); - - for (int Idx = (NumBlocks / 2) - 1; Idx >= 0; Idx--) - { - if (a_SkyLight[Idx] != 0xff) - { - FoundNonEmpty = true; - IdxWhereNonEmptyStarts = Idx; - break; - } - } - m_BlockSkyLight.insert(m_BlockSkyLight.end(), &a_SkyLight[0], &a_SkyLight[IdxWhereNonEmptyStarts + 1]); - } + m_ChunkBuffer.SetSkyLight (a_SkyLight); m_IsLightValid = true; } @@ -421,10 +339,7 @@ void cChunk::SetLight( void cChunk::GetBlockTypes(BLOCKTYPE * a_BlockTypes) { - std::vector Blocks = m_BlockTypes; - Blocks.resize(NumBlocks); - - memcpy(a_BlockTypes, &Blocks[0], NumBlocks); + m_ChunkBuffer.CopyBlocks(a_BlockTypes); } @@ -710,8 +625,7 @@ void cChunk::Tick(float a_Dt) void cChunk::TickBlock(int a_RelX, int a_RelY, int a_RelZ) { - unsigned Index = MakeIndex(a_RelX, a_RelY, a_RelZ); - cBlockHandler * Handler = BlockHandler(GetBlock(Index)); + cBlockHandler * Handler = BlockHandler(GetBlock(a_RelX, a_RelY, a_RelZ)); ASSERT(Handler != NULL); // Happenned on server restart, FS #243 cChunkInterface ChunkInterface(this->GetWorld()->GetChunkMap()); cBlockInServerPluginInterface PluginInterface(*this->GetWorld()); @@ -836,19 +750,18 @@ void cChunk::CheckBlocks() { return; } - std::vector ToTickBlocks; + std::vector ToTickBlocks; std::swap(m_ToTickBlocks, ToTickBlocks); cChunkInterface ChunkInterface(m_World->GetChunkMap()); cBlockInServerPluginInterface PluginInterface(*m_World); - for (std::vector::const_iterator itr = ToTickBlocks.begin(), end = ToTickBlocks.end(); itr != end; ++itr) + for (std::vector::const_iterator itr = ToTickBlocks.begin(), end = ToTickBlocks.end(); itr != end; ++itr) { - unsigned int index = (*itr); - Vector3i BlockPos = IndexToCoordinate(index); + Vector3i Pos = (*itr); - cBlockHandler * Handler = BlockHandler(GetBlock(index)); - Handler->Check(ChunkInterface, PluginInterface, BlockPos.x, BlockPos.y, BlockPos.z, *this); + cBlockHandler * Handler = BlockHandler(GetBlock(Pos)); + Handler->Check(ChunkInterface, PluginInterface, Pos.x, Pos.y, Pos.z, *this); } // for itr - ToTickBlocks[] } @@ -891,8 +804,7 @@ void cChunk::TickBlocks(void) continue; // It's all air up here } - unsigned int Index = MakeIndexNoCheck(m_BlockTickX, m_BlockTickY, m_BlockTickZ); - cBlockHandler * Handler = BlockHandler(GetBlock(Index)); + cBlockHandler * Handler = BlockHandler(GetBlock(m_BlockTickX, m_BlockTickY, m_BlockTickZ)); ASSERT(Handler != NULL); // Happenned on server restart, FS #243 Handler->OnUpdate(ChunkInterface, *this->GetWorld(), PluginInterface, *this, m_BlockTickX, m_BlockTickY, m_BlockTickZ); } // for i - tickblocks @@ -1284,9 +1196,8 @@ bool cChunk::UnboundedRelGetBlockLights(int a_RelX, int a_RelY, int a_RelZ, NIBB // The chunk is not available, bail out return false; } - int idx = Chunk->MakeIndex(a_RelX, a_RelY, a_RelZ); - a_BlockLight = Chunk->GetBlockLight(idx); - a_SkyLight = Chunk->GetSkyLight(idx); + a_BlockLight = Chunk->GetBlockLight(a_RelX, a_RelY, a_RelZ); + a_SkyLight = Chunk->GetSkyLight(a_RelX, a_RelY, a_RelZ); return true; } @@ -1490,11 +1401,9 @@ void cChunk::CalculateHeightmap(const BLOCKTYPE * a_BlockTypes) void cChunk::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { FastSetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta); - - const int index = MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); // Tick this block and its neighbors: - m_ToTickBlocks.push_back(index); + m_ToTickBlocks.push_back(Vector3i(a_RelX, a_RelY, a_RelZ)); QueueTickBlockNeighbors(a_RelX, a_RelY, a_RelZ); // If there was a block entity, remove it: @@ -1557,7 +1466,7 @@ void cChunk::QueueTickBlock(int a_RelX, int a_RelY, int a_RelZ) return; } - m_ToTickBlocks.push_back(MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ)); + m_ToTickBlocks.push_back(Vector3i(a_RelX, a_RelY, a_RelZ)); } @@ -1595,9 +1504,8 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT ASSERT(IsValid()); - const int index = MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); - const BLOCKTYPE OldBlockType = GetBlock(index); - const BLOCKTYPE OldBlockMeta = GetNibble(m_BlockMeta, index); + const BLOCKTYPE OldBlockType = GetBlock(a_RelX, a_RelY, a_RelZ); + const BLOCKTYPE OldBlockMeta = m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); if ((OldBlockType == a_BlockType) && (OldBlockMeta == a_BlockMeta)) { return; @@ -1605,11 +1513,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT MarkDirty(); - if (m_BlockTypes.empty() || ((size_t)index > m_BlockTypes.size() - 1) /* Vector starts from zero, .size() starts from 1 */) - { - m_BlockTypes.resize(index + 1); - } - m_BlockTypes[index] = a_BlockType; + m_ChunkBuffer.SetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType); // The client doesn't need to distinguish between stationary and nonstationary fluids: if ( @@ -1625,7 +1529,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta)); } - SetNibble(m_BlockMeta, index, a_BlockMeta); + m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_BlockMeta); // ONLY recalculate lighting if it's necessary! if ( @@ -1648,7 +1552,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT { for (int y = a_RelY - 1; y > 0; --y) { - if (GetBlock(MakeIndexNoCheck(a_RelX, y, a_RelZ)) != E_BLOCK_AIR) + if (GetBlock(a_RelX, y, a_RelZ) != E_BLOCK_AIR) { m_HeightMap[a_RelX + a_RelZ * Width] = (unsigned char)y; break; @@ -1665,18 +1569,16 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT void cChunk::SendBlockTo(int a_RelX, int a_RelY, int a_RelZ, cClientHandle * a_Client) { // The coords must be valid, because the upper level already does chunk lookup. No need to check them again. - // There's an debug-time assert in MakeIndexNoCheck anyway - unsigned int index = MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); if (a_Client == NULL) { // Queue the block for all clients in the chunk (will be sent in Tick()) - m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, GetBlock(index), GetMeta(index))); + m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, GetBlock(a_RelX, a_RelY, a_RelZ), GetMeta(a_RelX, a_RelY, a_RelZ))); return; } Vector3i wp = PositionToWorldPosition(a_RelX, a_RelY, a_RelZ); - a_Client->SendBlockChange(wp.x, wp.y, wp.z, GetBlock(index), GetMeta(index)); + a_Client->SendBlockChange(wp.x, wp.y, wp.z, GetBlock(a_RelX, a_RelY, a_RelZ), GetMeta(a_RelX, a_RelY, a_RelZ)); // FS #268 - if a BlockEntity digging is cancelled by a plugin, the entire block entity must be re-sent to the client: for (cBlockEntityList::iterator itr = m_BlockEntities.begin(), end = m_BlockEntities.end(); itr != end; ++itr) @@ -2535,27 +2437,7 @@ BLOCKTYPE cChunk::GetBlock(int a_RelX, int a_RelY, int a_RelZ) const return 0; // Clip } - return GetBlock(MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ)); -} - - - - - -BLOCKTYPE cChunk::GetBlock(int a_BlockIdx) const -{ - if ((a_BlockIdx < 0) || (a_BlockIdx >= NumBlocks)) - { - ASSERT(!"GetBlock(idx) out of bounds!"); - return 0; - } - - if (m_BlockTypes.empty() || ((size_t)a_BlockIdx > m_BlockTypes.size() - 1) /* Vector starts from zero, .size() starts from 1 */) - { - return E_BLOCK_AIR; - } - - return m_BlockTypes[a_BlockIdx]; + return m_ChunkBuffer.GetBlock(a_RelX, a_RelY, a_RelZ); } @@ -2564,9 +2446,8 @@ BLOCKTYPE cChunk::GetBlock(int a_BlockIdx) const void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) { - int Idx = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); - a_BlockType = GetBlock(Idx); - a_BlockMeta = cChunkDef::GetNibble(m_BlockMeta, Idx); + a_BlockType = GetBlock(a_RelX, a_RelY, a_RelZ); + a_BlockMeta = m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); } @@ -2575,11 +2456,10 @@ void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_ void cChunk::GetBlockInfo(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight) { - int Idx = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); - a_BlockType = GetBlock(Idx); - a_Meta = cChunkDef::GetNibble(m_BlockMeta, Idx); - a_SkyLight = cChunkDef::GetNibble(m_BlockSkyLight, Idx); - a_BlockLight = cChunkDef::GetNibble(m_BlockLight, Idx); + a_BlockType = GetBlock(a_RelX, a_RelY, a_RelZ); + a_Meta = m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); + a_SkyLight = m_ChunkBuffer.GetSkyLight(a_RelX, a_RelY, a_RelZ); + a_BlockLight = m_ChunkBuffer.GetBlockLight(a_RelX, a_RelY, a_RelZ); } diff --git a/src/Chunk.h b/src/Chunk.h index 9100eec58..ea3e035ad 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -3,6 +3,7 @@ #include "Entities/Entity.h" #include "ChunkDef.h" +#include "ChunkBuffer.h" #include "Simulator/FireSimulator.h" #include "Simulator/SandSimulator.h" @@ -66,6 +67,7 @@ public: cChunkMap * a_ChunkMap, cWorld * a_World, // Parent objects cChunk * a_NeighborXM, cChunk * a_NeighborXP, cChunk * a_NeighborZM, cChunk * a_NeighborZP // Neighbor chunks ); + cChunk(cChunk& other); ~cChunk(); bool IsValid(void) const {return m_IsValid; } // Returns true if the chunk block data is valid (loaded / generated) @@ -154,7 +156,7 @@ public: void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta ); // Doesn't force block updates on neighbors, use for simple changes such as grass growing etc. BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const; - BLOCKTYPE GetBlock(int a_BlockIdx) const; + BLOCKTYPE GetBlock(Vector3i a_cords) const { return GetBlock(a_cords.x,a_cords.y,a_cords.z);} void GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta); void GetBlockInfo (int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight); @@ -320,15 +322,17 @@ public: m_BlockTickZ = a_RelZ; } - inline NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const {return cChunkDef::GetNibble(m_BlockMeta, a_RelX, a_RelY, a_RelZ); } - inline NIBBLETYPE GetMeta(int a_BlockIdx) const {return cChunkDef::GetNibble(m_BlockMeta, a_BlockIdx); } - inline void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta) { cChunkDef::SetNibble(m_BlockMeta, a_RelX, a_RelY, a_RelZ, a_Meta); } - inline void SetMeta(int a_BlockIdx, NIBBLETYPE a_Meta) { cChunkDef::SetNibble(m_BlockMeta, a_BlockIdx, a_Meta); } + inline NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const + { + return m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); + } + inline void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta) + { + m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); + } - inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return cChunkDef::GetNibble(m_BlockLight, a_RelX, a_RelY, a_RelZ); } - inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return cChunkDef::GetNibble(m_BlockSkyLight, a_RelX, a_RelY, a_RelZ, true); } - inline NIBBLETYPE GetBlockLight(int a_Idx) const {return cChunkDef::GetNibble(m_BlockLight, a_Idx); } - inline NIBBLETYPE GetSkyLight (int a_Idx) const {return cChunkDef::GetNibble(m_BlockSkyLight, a_Idx, true); } + inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkBuffer.GetBlockLight(a_RelX, a_RelY, a_RelZ); } + inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkBuffer.GetSkyLight(a_RelX, a_RelY, a_RelZ); } /** Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success */ bool UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const; @@ -403,8 +407,8 @@ private: bool m_IsSaving; // True if the chunk is being saved bool m_HasLoadFailed; // True if chunk failed to load and hasn't been generated yet since then - std::vector m_ToTickBlocks; - sSetBlockVector m_PendingSendBlocks; ///< Blocks that have changed and need to be sent to all clients + std::vector m_ToTickBlocks; + sSetBlockVector m_PendingSendBlocks; ///< Blocks that have changed and need to be sent to all clients sSetBlockQueueVector m_SetBlockQueue; ///< Block changes that are queued to a specific tick @@ -420,11 +424,7 @@ private: cWorld * m_World; cChunkMap * m_ChunkMap; - // TODO: Make these pointers and don't allocate what isn't needed - std::vector m_BlockTypes; - std::vector m_BlockMeta; - std::vector m_BlockLight; - std::vector m_BlockSkyLight; + cChunkBuffer m_ChunkBuffer; cChunkDef::HeightMap m_HeightMap; cChunkDef::BiomeMap m_BiomeMap; diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp new file mode 100644 index 000000000..8e87d3049 --- /dev/null +++ b/src/ChunkBuffer.cpp @@ -0,0 +1,146 @@ + +#include "Globals.h" +#include "ChunkBuffer.h" + +cChunkBuffer cChunkBuffer::Copy() const +{ + cChunkBuffer copy; + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + if(m_Sections[i]) + { + copy.m_Sections[i] = Allocate(); + *copy.m_Sections[i] = *m_Sections[i]; + } + } + return copy; +} + + + + + +void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) const +{ + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; + if (a_Idx > 0) a_Idx = a_Idx > length ? a_Idx - length : 0; + if (a_Idx == 0) + { + size_t tocopy = length > segment_length ? segment_length : length; + length -= tocopy; + memcpy(&a_dest[i * segment_length], &m_Sections[i]->m_BlockTypes, sizeof(BLOCKTYPE) * length); + } + } +} + + + + + +void cChunkBuffer::CopyMeta(NIBBLETYPE * a_dest) const +{ + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + memcpy(&a_dest[i * segment_length], &m_Sections[i]->m_BlockMeta, sizeof(NIBBLETYPE) * segment_length); + } +} + + + + + +void cChunkBuffer::CopyLight(NIBBLETYPE * a_dest) const +{ + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + memcpy(&a_dest[i * segment_length], &m_Sections[i]->m_BlockLight, sizeof(NIBBLETYPE) * segment_length); + } +} + + + + + +void cChunkBuffer::CopySkyLight(NIBBLETYPE * a_dest) const +{ + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + memcpy(&a_dest[i * segment_length], &m_Sections[i]->m_BlockSkyLight, sizeof(NIBBLETYPE) * segment_length); + } +} + + + + + +void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) +{ + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + if (m_Sections[i]) + { + memcpy(&m_Sections[i]->m_BlockTypes, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length); + } + } +} + + + + +void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) +{ + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + if (m_Sections[i]) + { + memcpy(&m_Sections[i]->m_BlockMeta, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); + } + } +} + + + + +void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) +{ + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + if (m_Sections[i]) + { + memcpy(&m_Sections[i]->m_BlockLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); + } + } +} + + + + +void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) +{ + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + if (m_Sections[i]) + { + memcpy(&m_Sections[i]->m_BlockSkyLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); + } + } +} + + + + + +cChunkBuffer::sChunkSection * cChunkBuffer::Allocate() const +{ + // TODO: use a allocation pool + return new cChunkBuffer::sChunkSection; +} diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h new file mode 100644 index 000000000..44e447c82 --- /dev/null +++ b/src/ChunkBuffer.h @@ -0,0 +1,310 @@ + +#pragma once + +#define CHUNK_SECTION_HEIGHT 16 +#define CHUNK_SECTION_NUM (256 / CHUNK_SECTION_HEIGHT) + +#if __cplusplus < 201103L +// auto_ptr style interface for memory management +#else +// unique_ptr style interface for memory management +#endif + +class cChunkBuffer +{ +public: + + cChunkBuffer() + #if __cplusplus < 201103L + // auto_ptr style interface for memory management + : IsOwner(true) + #endif + { + memset(m_Sections, 0, sizeof(m_Sections)); + } + ~cChunkBuffer() + { + #if __cplusplus < 201103L + // auto_ptr style interface for memory management + if(!IsOwner) return; + #endif + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + if(m_Sections[i]) delete m_Sections[i]; + } + } + + #if __cplusplus < 201103L + // auto_ptr style interface for memory management + cChunkBuffer(cChunkBuffer& other) : + IsOwner(true); + { + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + m_Sections[i] = other.m_Sections[i]; + } + other.IsOwner = false; + } + void operator=(cChunkBuffer& other) + { + if(IsOwner) + { + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + if(m_Sections[i]) delete m_Sections[i]; + } + } + IsOwner = true; + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + m_Sections[i] = other.m_Sections[i]; + } + other.IsOwner = false; + } + #else + // unique_ptr style interface for memory management + cChunkBuffer(cChunkBuffer&& other) + { + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + m_Sections[i] = other.m_Sections[i]; + } + } + + void operator=(cChunkBuffer&& other) + { + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + if(m_Sections[i]) delete m_Sections[i]; + m_Sections[i] = other.m_Sections[i]; + } + } + #endif + + BLOCKTYPE GetBlock(int a_X, int a_Y, int a_Z) const + { + ASSERT((a_X >= 0) && (a_X < cChunkDef::Width)); + ASSERT((a_Y >= 0) && (a_Y < cChunkDef::Height)); + ASSERT((a_Z >= 0) && (a_Z < cChunkDef::Width)); + int Section = a_Y / CHUNK_SECTION_HEIGHT; + if(m_Sections[Section]) + { + int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * CHUNK_SECTION_HEIGHT), a_Z); + return m_Sections[Section]->m_BlockTypes[Index]; + } + else + { + return 0; + } + } + + void SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) + { + if ( + (a_RelX >= cChunkDef::Width) || (a_RelX < 0) || + (a_RelY >= cChunkDef::Height) || (a_RelY < 0) || + (a_RelZ >= cChunkDef::Width) || (a_RelZ < 0) + ) + { + ASSERT(!"cChunkBuffer::SetMeta(): index out of range!"); + return; + } + + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if(!m_Sections[Section]) + { + m_Sections[Section] = Allocate(); + if(!m_Sections[Section]) + { + ASSERT("Failed to allocate a new section in Chunkbuffer"); + return; + } + } + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + m_Sections[Section]->m_BlockTypes[Index] = a_Block; + } + + NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const + { + if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) + { + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if(m_Sections[Section]) + { + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f; + } + else + { + return 0; + } + } + ASSERT(!"cChunkBuffer::GetMeta(): coords out of chunk range!"); + return 0; + } + + void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble) + { + if ( + (a_RelX >= cChunkDef::Width) || (a_RelX < 0) || + (a_RelY >= cChunkDef::Height) || (a_RelY < 0) || + (a_RelZ >= cChunkDef::Width) || (a_RelZ < 0) + ) + { + ASSERT(!"cChunkBuffer::SetMeta(): index out of range!"); + return; + } + + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if(!m_Sections[Section]) + { + m_Sections[Section] = Allocate(); + if(!m_Sections[Section]) + { + ASSERT("Failed to allocate a new section in Chunkbuffer"); + return; + } + } + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + m_Sections[Section]->m_BlockMeta[Index / 2] = static_cast( + (m_Sections[Section]->m_BlockMeta[Index / 2] & (0xf0 >> ((Index & 1) * 4))) | // The untouched nibble + ((a_Nibble & 0x0f) << ((Index & 1) * 4)) // The nibble being set + ); + } + + NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const + { + if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) + { + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if(m_Sections[Section]) + { + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; + } + else + { + return 0; + } + } + ASSERT(!"cChunkBuffer::GetMeta(): coords out of chunk range!"); + return 0; + } + + NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const + { + if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) + { + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if(m_Sections[Section]) + { + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; + } + else + { + return 0xFF; + } + } + ASSERT(!"cChunkBuffer::GetMeta(): coords out of chunk range!"); + return 0; + } + + cChunkBuffer Copy() const; + void CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx = 0, size_t length = cChunkDef::NumBlocks) const; + void CopyMeta (NIBBLETYPE * a_dest) const; + void CopyLight (NIBBLETYPE * a_dest) const; + void CopySkyLight (NIBBLETYPE * a_dest) const; + + void SetBlocks (const BLOCKTYPE * a_src); + void SetMeta (const NIBBLETYPE * a_src); + void SetLight (const NIBBLETYPE * a_src); + void SetSkyLight (const NIBBLETYPE * a_src); + +private: + + #if __cplusplus < 201103L + // auto_ptr style interface for memory management + bool IsOwner; + #endif + + struct sChunkSection { + BLOCKTYPE m_BlockTypes [CHUNK_SECTION_HEIGHT * 16 * 16] ; + NIBBLETYPE m_BlockMeta [CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; + NIBBLETYPE m_BlockLight [CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; + NIBBLETYPE m_BlockSkyLight[CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; + }; + + sChunkSection *m_Sections[CHUNK_SECTION_NUM]; + + sChunkSection * Allocate() const; +}; + + + + +/** A simple implementation of the cChunkDataCallback interface that collects all block data into a buffer +*/ +class cChunkBufferCollector : + public cChunkDataCallback +{ +public: + + cChunkBuffer m_BlockData; + +protected: + + virtual void ChunkBuffer(const cChunkBuffer & a_BlockData) override + { + m_BlockData = a_BlockData.Copy(); + } +}; + + +/** A simple implementation of the cChunkDataCallback interface that collects all block data into a single buffer +*/ +class cChunkDataCollector : +public cChunkDataCallback +{ +public: + + // Must be unsigned char instead of BLOCKTYPE or NIBBLETYPE, because it houses both. + unsigned char m_BlockData[cChunkDef::BlockDataSize]; + +protected: + + virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override + { + a_ChunkBuffer.CopyBlocks(m_BlockData); + a_ChunkBuffer.CopyMeta(m_BlockData + cChunkDef::NumBlocks); + a_ChunkBuffer.CopyLight(m_BlockData + 3 * cChunkDef::NumBlocks / 2); + a_ChunkBuffer.CopySkyLight(m_BlockData + 2 * cChunkDef::NumBlocks); + } +}; + +/** A simple implementation of the cChunkDataCallback interface that collects all block data into a separate buffers +*/ +class cChunkDataSeparateCollector : +public cChunkDataCallback +{ +public: + + cChunkDef::BlockTypes m_BlockTypes; + cChunkDef::BlockNibbles m_BlockMetas; + cChunkDef::BlockNibbles m_BlockLight; + cChunkDef::BlockNibbles m_BlockSkyLight; + +protected: + + virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override + { + a_ChunkBuffer.CopyBlocks(m_BlockTypes); + a_ChunkBuffer.CopyMeta(m_BlockMetas); + a_ChunkBuffer.CopyLight(m_BlockLight); + a_ChunkBuffer.CopySkyLight(m_BlockSkyLight); + } +} ; + + + + diff --git a/src/ChunkDef.h b/src/ChunkDef.h index bb9f14bbe..a5eccc9d6 100644 --- a/src/ChunkDef.h +++ b/src/ChunkDef.h @@ -366,6 +366,7 @@ public: +class cChunkBuffer; /** Interface class used for getting data out of a chunk using the GetAllData() function. @@ -390,20 +391,11 @@ public: /// Called once to provide biome data virtual void BiomeData (const cChunkDef::BiomeMap * a_BiomeMap) {UNUSED(a_BiomeMap); }; - /// Called once to export block types - virtual void BlockTypes (const BLOCKTYPE * a_Type) {UNUSED(a_Type); }; + /// Called once to let know if the chunk lighting is valid. Return value is ignored + virtual void LightIsValid(bool a_IsLightValid) {UNUSED(a_IsLightValid); }; - /// Called once to export block meta - virtual void BlockMeta (const NIBBLETYPE * a_Meta) {UNUSED(a_Meta); }; - - /// Called once to let know if the chunk lighting is valid. Return value is used to control if BlockLight() and BlockSkyLight() are called next (if true) - virtual bool LightIsValid(bool a_IsLightValid) {UNUSED(a_IsLightValid); return true; }; - - /// Called once to export block light - virtual void BlockLight (const NIBBLETYPE * a_BlockLight) {UNUSED(a_BlockLight); }; - - /// Called once to export sky light - virtual void BlockSkyLight(const NIBBLETYPE * a_SkyLight) {UNUSED(a_SkyLight); }; + /// Called once to export block info + virtual void ChunkBuffer (const cChunkBuffer & a_Buffer) {UNUSED(a_Buffer); }; /// Called for each entity in the chunk virtual void Entity(cEntity * a_Entity) {UNUSED(a_Entity); }; @@ -416,88 +408,6 @@ public: -/** A simple implementation of the cChunkDataCallback interface that collects all block data into a single buffer -*/ -class cChunkDataCollector : - public cChunkDataCallback -{ -public: - - // Must be unsigned char instead of BLOCKTYPE or NIBBLETYPE, because it houses both. - unsigned char m_BlockData[cChunkDef::BlockDataSize]; - -protected: - - virtual void BlockTypes(const BLOCKTYPE * a_BlockTypes) override - { - memcpy(m_BlockData, a_BlockTypes, sizeof(cChunkDef::BlockTypes)); - } - - - virtual void BlockMeta(const NIBBLETYPE * a_BlockMeta) override - { - memcpy(m_BlockData + cChunkDef::NumBlocks, a_BlockMeta, cChunkDef::NumBlocks / 2); - } - - - virtual void BlockLight(const NIBBLETYPE * a_BlockLight) override - { - memcpy(m_BlockData + 3 * cChunkDef::NumBlocks / 2, a_BlockLight, cChunkDef::NumBlocks / 2); - } - - - virtual void BlockSkyLight(const NIBBLETYPE * a_BlockSkyLight) override - { - memcpy(m_BlockData + 2 * cChunkDef::NumBlocks, a_BlockSkyLight, cChunkDef::NumBlocks / 2); - } -} ; - - - - - -/** A simple implementation of the cChunkDataCallback interface that collects all block data into a separate buffers -*/ -class cChunkDataSeparateCollector : - public cChunkDataCallback -{ -public: - - cChunkDef::BlockTypes m_BlockTypes; - cChunkDef::BlockNibbles m_BlockMetas; - cChunkDef::BlockNibbles m_BlockLight; - cChunkDef::BlockNibbles m_BlockSkyLight; - -protected: - - virtual void BlockTypes(const BLOCKTYPE * a_BlockTypes) override - { - memcpy(m_BlockTypes, a_BlockTypes, sizeof(m_BlockTypes)); - } - - - virtual void BlockMeta(const NIBBLETYPE * a_BlockMeta) override - { - memcpy(m_BlockMetas, a_BlockMeta, sizeof(m_BlockMetas)); - } - - - virtual void BlockLight(const NIBBLETYPE * a_BlockLight) override - { - memcpy(m_BlockLight, a_BlockLight, sizeof(m_BlockLight)); - } - - - virtual void BlockSkyLight(const NIBBLETYPE * a_BlockSkyLight) override - { - memcpy(m_BlockSkyLight, a_BlockSkyLight, sizeof(m_BlockSkyLight)); - } -} ; - - - - - /** Interface class used for comparing clients of two chunks. Used primarily for entity moving while both chunks are locked. */ diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index e695f0ab2..2b47f25f8 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -219,9 +219,8 @@ bool cChunkMap::LockedGetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTY return false; } - int Index = cChunkDef::MakeIndexNoCheck(a_BlockX, a_BlockY, a_BlockZ); - a_BlockType = Chunk->GetBlock(Index); - a_BlockMeta = Chunk->GetMeta(Index); + a_BlockType = Chunk->GetBlock(a_BlockX, a_BlockY, a_BlockZ); + a_BlockMeta = Chunk->GetMeta(a_BlockX, a_BlockY, a_BlockZ); return true; } @@ -242,8 +241,7 @@ bool cChunkMap::LockedGetBlockType(int a_BlockX, int a_BlockY, int a_BlockZ, BLO return false; } - int Index = cChunkDef::MakeIndexNoCheck(a_BlockX, a_BlockY, a_BlockZ); - a_BlockType = Chunk->GetBlock(Index); + a_BlockType = Chunk->GetBlock(a_BlockX, a_BlockY, a_BlockZ); return true; } @@ -264,8 +262,7 @@ bool cChunkMap::LockedGetBlockMeta(int a_BlockX, int a_BlockY, int a_BlockZ, NIB return false; } - int Index = cChunkDef::MakeIndexNoCheck(a_BlockX, a_BlockY, a_BlockZ); - a_BlockMeta = Chunk->GetMeta(Index); + a_BlockMeta = Chunk->GetMeta(a_BlockX, a_BlockY, a_BlockZ); return true; } @@ -1486,9 +1483,8 @@ bool cChunkMap::GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure) res = false; continue; } - int idx = cChunkDef::MakeIndexNoCheck(itr->x, itr->y, itr->z); - itr->BlockType = Chunk->GetBlock(idx); - itr->BlockMeta = Chunk->GetMeta(idx); + itr->BlockType = Chunk->GetBlock(itr->x, itr->y, itr->z); + itr->BlockMeta = Chunk->GetMeta(itr->x, itr->y, itr->z); } return res; } diff --git a/src/ChunkSender.h b/src/ChunkSender.h index a26f764a7..81b298a55 100644 --- a/src/ChunkSender.h +++ b/src/ChunkSender.h @@ -27,6 +27,7 @@ Note that it may be called by world's BroadcastToChunk() if the client is still #include "OSSupport/IsThread.h" #include "ChunkDef.h" +#include "ChunkBuffer.h" diff --git a/src/Entities/FallingBlock.cpp b/src/Entities/FallingBlock.cpp index a66c7e4ae..e57c45eaf 100644 --- a/src/Entities/FallingBlock.cpp +++ b/src/Entities/FallingBlock.cpp @@ -55,9 +55,8 @@ void cFallingBlock::Tick(float a_Dt, cChunk & a_Chunk) return; } - int idx = a_Chunk.MakeIndexNoCheck(BlockX - a_Chunk.GetPosX() * cChunkDef::Width, BlockY, BlockZ - a_Chunk.GetPosZ() * cChunkDef::Width); - BLOCKTYPE BlockBelow = a_Chunk.GetBlock(idx); - NIBBLETYPE BelowMeta = a_Chunk.GetMeta(idx); + BLOCKTYPE BlockBelow = a_Chunk.GetBlock(BlockX - a_Chunk.GetPosX() * cChunkDef::Width, BlockY, BlockZ - a_Chunk.GetPosZ() * cChunkDef::Width); + NIBBLETYPE BelowMeta = a_Chunk.GetMeta(BlockX - a_Chunk.GetPosX() * cChunkDef::Width, BlockY, BlockZ - a_Chunk.GetPosZ() * cChunkDef::Width); if (cSandSimulator::DoesBreakFallingThrough(BlockBelow, BelowMeta)) { // Fallen onto a block that breaks this into pickups (e. g. half-slab) diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index 302473d71..56d5dba22 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -18,20 +18,17 @@ class cReader : public cChunkDataCallback { - virtual void BlockTypes(const BLOCKTYPE * a_Type) override + virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override { - // ROW is a block of 16 Blocks, one whole row is copied at a time (hopefully the compiler will optimize that) - // C++ doesn't permit copying arrays, but arrays as a part of a struct is ok :) - typedef struct {BLOCKTYPE m_Row[16]; } ROW; - ROW * InputRows = (ROW *)a_Type; - ROW * OutputRows = (ROW *)m_BlockTypes; + BLOCKTYPE * OutputRows = m_BlockTypes; int InputIdx = 0; int OutputIdx = m_ReadingChunkX + m_ReadingChunkZ * cChunkDef::Width * 3; for (int y = 0; y < cChunkDef::Height; y++) { for (int z = 0; z < cChunkDef::Width; z++) { - OutputRows[OutputIdx] = InputRows[InputIdx++]; + a_ChunkBuffer.CopyBlocks(OutputRows + OutputIdx * 16, InputIdx * 16, 16); + InputIdx++; OutputIdx += 3; } // for z // Skip into the next y-level in the 3x3 chunk blob; each level has cChunkDef::Width * 9 rows diff --git a/src/MobProximityCounter.cpp b/src/MobProximityCounter.cpp index 6c44ea458..e7493dd0f 100644 --- a/src/MobProximityCounter.cpp +++ b/src/MobProximityCounter.cpp @@ -24,7 +24,8 @@ void cMobProximityCounter::CollectMob(cEntity& a_Monster, cChunk& a_Chunk, doubl if (a_Distance < it->second.m_Distance) { it->second.m_Distance = a_Distance; - it->second.m_Chunk = a_Chunk; + ASSERT(false); + //it->second.m_Chunk = a_Chunk; } } diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 470dfc791..4c1008897 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -95,8 +95,10 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun int NumMSecs = (int)a_Dt; for (cCoordWithIntList::iterator itr = Data.begin(); itr != Data.end();) { - int idx = cChunkDef::MakeIndexNoCheck(itr->x, itr->y, itr->z); - BLOCKTYPE BlockType = a_Chunk->GetBlock(idx); + int x = itr->x; + int y = itr->y; + int z = itr->z; + BLOCKTYPE BlockType = a_Chunk->GetBlock(x,y,z); if (!IsAllowedBlock(BlockType)) { @@ -125,7 +127,7 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun itr->x + a_ChunkX * cChunkDef::Width, itr->y, itr->z + a_ChunkZ * cChunkDef::Width ); */ - NIBBLETYPE BlockMeta = a_Chunk->GetMeta(idx); + NIBBLETYPE BlockMeta = a_Chunk->GetMeta(x, y, z); if (BlockMeta == 0x0f) { // The fire burnt out completely @@ -140,7 +142,7 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun if((itr->y > 0) && (!DoesBurnForever(a_Chunk->GetBlock(itr->x, itr->y - 1, itr->z)))) { - a_Chunk->SetMeta(idx, BlockMeta + 1); + a_Chunk->SetMeta(x, y, z, BlockMeta + 1); } itr->Data = GetBurnStepTime(a_Chunk, itr->x, itr->y, itr->z); // TODO: Add some randomness into this } // for itr - Data[] diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 415693ae2..10acfb537 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -692,10 +692,9 @@ void cNBTChunkSerializer::AddMinecartChestContents(cMinecartWithChest * a_Mineca -bool cNBTChunkSerializer::LightIsValid(bool a_IsLightValid) +void cNBTChunkSerializer::LightIsValid(bool a_IsLightValid) { m_IsLightValid = a_IsLightValid; - return a_IsLightValid; // We want lighting only if it's valid, otherwise don't bother } diff --git a/src/WorldStorage/NBTChunkSerializer.h b/src/WorldStorage/NBTChunkSerializer.h index 51d104970..6da2bc6dd 100644 --- a/src/WorldStorage/NBTChunkSerializer.h +++ b/src/WorldStorage/NBTChunkSerializer.h @@ -9,7 +9,7 @@ #pragma once -#include "../ChunkDef.h" +#include "../ChunkBuffer.h" @@ -121,7 +121,7 @@ protected: void AddMinecartChestContents(cMinecartWithChest * a_Minecart); // cChunkDataSeparateCollector overrides: - virtual bool LightIsValid(bool a_IsLightValid) override; + virtual void LightIsValid(bool a_IsLightValid) override; virtual void BiomeData(const cChunkDef::BiomeMap * a_BiomeMap) override; virtual void Entity(cEntity * a_Entity) override; virtual void BlockEntity(cBlockEntity * a_Entity) override; diff --git a/src/WorldStorage/WSSCompact.cpp b/src/WorldStorage/WSSCompact.cpp index bb9d4b9e6..b44dd02c5 100644 --- a/src/WorldStorage/WSSCompact.cpp +++ b/src/WorldStorage/WSSCompact.cpp @@ -107,15 +107,13 @@ void cJsonChunkSerializer::BlockEntity(cBlockEntity * a_BlockEntity) -bool cJsonChunkSerializer::LightIsValid(bool a_IsLightValid) +void cJsonChunkSerializer::LightIsValid(bool a_IsLightValid) { - if (!a_IsLightValid) + if (a_IsLightValid) { - return false; + m_Root["IsLightValid"] = true; + m_HasJsonData = true; } - m_Root["IsLightValid"] = true; - m_HasJsonData = true; - return true; } diff --git a/src/WorldStorage/WSSCompact.h b/src/WorldStorage/WSSCompact.h index 4df146ec3..49a897984 100644 --- a/src/WorldStorage/WSSCompact.h +++ b/src/WorldStorage/WSSCompact.h @@ -14,6 +14,7 @@ #include "WorldStorage.h" #include "../Vector3.h" #include "json/json.h" +#include "ChunkBuffer.h" @@ -42,7 +43,7 @@ protected: // cChunkDataCollector overrides: virtual void Entity (cEntity * a_Entity) override; virtual void BlockEntity (cBlockEntity * a_Entity) override; - virtual bool LightIsValid (bool a_IsLightValid) override; + virtual void LightIsValid (bool a_IsLightValid) override; } ; From dcb2a590e364301aa1919546ad33a33e5dc34042 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 06:45:33 -0700 Subject: [PATCH 002/214] Fixed bad merge --- src/Chunk.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 5a82ca66a..6b0058303 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1468,7 +1468,7 @@ void cChunk::QueueTickBlock(int a_RelX, int a_RelY, int a_RelZ) return; } - m_ToTickBlocks.push_back(MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ)); + m_ToTickBlocks.push_back(Vector3i(a_RelX, a_RelY, a_RelZ)); } @@ -1531,7 +1531,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta)); } - SetNibble(m_BlockMeta, index, a_BlockMeta); + m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_BlockMeta); // ONLY recalculate lighting if it's necessary! if ( @@ -1554,7 +1554,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT { for (int y = a_RelY - 1; y > 0; --y) { - if (GetBlock(MakeIndexNoCheck(a_RelX, y, a_RelZ)) != E_BLOCK_AIR) + if (GetBlock(a_RelX, y, a_RelZ) != E_BLOCK_AIR) { m_HeightMap[a_RelX + a_RelZ * Width] = (unsigned char)y; break; @@ -1570,19 +1570,16 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT void cChunk::SendBlockTo(int a_RelX, int a_RelY, int a_RelZ, cClientHandle * a_Client) { - // The coords must be valid, because the upper level already does chunk lookup. No need to check them again. - // There's an debug-time assert in MakeIndexNoCheck anyway - unsigned int index = MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); if (a_Client == NULL) { // Queue the block for all clients in the chunk (will be sent in Tick()) - m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, GetBlock(index), GetMeta(index))); + m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, GetBlock(a_RelX, a_RelY, a_RelZ), GetMeta(a_RelX, a_RelY, a_RelZ))); return; } Vector3i wp = PositionToWorldPosition(a_RelX, a_RelY, a_RelZ); - a_Client->SendBlockChange(wp.x, wp.y, wp.z, GetBlock(index), GetMeta(index)); + a_Client->SendBlockChange(wp.x, wp.y, wp.z, GetBlock(a_RelX, a_RelY, a_RelZ), GetMeta(a_RelX, a_RelY, a_RelZ)); // FS #268 - if a BlockEntity digging is cancelled by a plugin, the entire block entity must be re-sent to the client: for (cBlockEntityList::iterator itr = m_BlockEntities.begin(), end = m_BlockEntities.end(); itr != end; ++itr) @@ -2460,11 +2457,10 @@ void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_ void cChunk::GetBlockInfo(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight) { - int Idx = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); - a_BlockType = GetBlock(Idx); - a_Meta = cChunkDef::GetNibble(m_BlockMeta, Idx); - a_SkyLight = cChunkDef::GetNibble(m_BlockSkyLight, Idx); - a_BlockLight = cChunkDef::GetNibble(m_BlockLight, Idx); + a_BlockType = GetBlock(a_RelX, a_RelY, a_RelZ); + a_Meta = m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); + a_SkyLight = m_ChunkBuffer.GetSkyLight(a_RelX, a_RelY, a_RelZ); + a_BlockLight = m_ChunkBuffer.GetBlockLight(a_RelX, a_RelY, a_RelZ); } From e3bdc81ca04fbad284eb0c3b53678f0fb357eb64 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 06:46:13 -0700 Subject: [PATCH 003/214] Fixed MobProximity Counter to remove chunk copys --- src/MobProximityCounter.cpp | 5 ++--- src/MobProximityCounter.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/MobProximityCounter.cpp b/src/MobProximityCounter.cpp index c7e91e18b..ce20bf56b 100644 --- a/src/MobProximityCounter.cpp +++ b/src/MobProximityCounter.cpp @@ -24,8 +24,7 @@ void cMobProximityCounter::CollectMob(cEntity& a_Monster, cChunk& a_Chunk, doubl if (a_Distance < it->second.m_Distance) { it->second.m_Distance = a_Distance; - ASSERT(false); - //it->second.m_Chunk = a_Chunk; + it->second.m_Chunk = &a_Chunk; } } @@ -37,7 +36,7 @@ void cMobProximityCounter::convertMaps() { for(tMonsterToDistance::const_iterator itr = m_MonsterToDistance.begin(); itr != m_MonsterToDistance.end(); ++itr) { - m_DistanceToMonster.insert(tDistanceToMonster::value_type(itr->second.m_Distance,sMonsterAndChunk(*itr->first,itr->second.m_Chunk))); + m_DistanceToMonster.insert(tDistanceToMonster::value_type(itr->second.m_Distance,sMonsterAndChunk(*itr->first,*itr->second.m_Chunk))); } } diff --git a/src/MobProximityCounter.h b/src/MobProximityCounter.h index 8a67139aa..79429eb60 100644 --- a/src/MobProximityCounter.h +++ b/src/MobProximityCounter.h @@ -16,9 +16,9 @@ protected : // structs used for later maps (see m_MonsterToDistance and m_DistanceToMonster) struct sDistanceAndChunk { - sDistanceAndChunk(double a_Distance, cChunk& a_Chunk) : m_Distance(a_Distance), m_Chunk(a_Chunk) {} + sDistanceAndChunk(double a_Distance, cChunk& a_Chunk) : m_Distance(a_Distance), m_Chunk(&a_Chunk) {} double m_Distance; - cChunk& m_Chunk; + cChunk* m_Chunk; }; struct sMonsterAndChunk { From 2730a41946b5236894d65ec9cc001ed41b6a5589 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 07:10:30 -0700 Subject: [PATCH 004/214] Fixed issues with gcc --- src/ChunkBuffer.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index 44e447c82..a6a6da013 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -36,8 +36,8 @@ public: #if __cplusplus < 201103L // auto_ptr style interface for memory management - cChunkBuffer(cChunkBuffer& other) : - IsOwner(true); + cChunkBuffer(const cChunkBuffer& other) : + IsOwner(true) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -45,7 +45,8 @@ public: } other.IsOwner = false; } - void operator=(cChunkBuffer& other) + + void operator=(const cChunkBuffer& other) { if(IsOwner) { @@ -63,7 +64,7 @@ public: } #else // unique_ptr style interface for memory management - cChunkBuffer(cChunkBuffer&& other) + cChunkBuffer(const cChunkBuffer&& other) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -71,7 +72,7 @@ public: } } - void operator=(cChunkBuffer&& other) + void operator=(const cChunkBuffer&& other) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -225,7 +226,7 @@ private: #if __cplusplus < 201103L // auto_ptr style interface for memory management - bool IsOwner; + mutable bool IsOwner; #endif struct sChunkSection { From 48a2488477023b5427381863585fd1448743d32e Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 07:38:16 -0700 Subject: [PATCH 005/214] Added other half of implementation --- src/ChunkBuffer.cpp | 147 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 133 insertions(+), 14 deletions(-) diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp index 8e87d3049..7946fba1e 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkBuffer.cpp @@ -22,7 +22,7 @@ cChunkBuffer cChunkBuffer::Copy() const void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) const { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; if (a_Idx > 0) a_Idx = a_Idx > length ? a_Idx - length : 0; @@ -30,7 +30,22 @@ void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length { size_t tocopy = length > segment_length ? segment_length : length; length -= tocopy; - memcpy(&a_dest[i * segment_length], &m_Sections[i]->m_BlockTypes, sizeof(BLOCKTYPE) * length); + if(m_Sections[i]) + { + memcpy( + &a_dest[i * segment_length], + &m_Sections[i]->m_BlockTypes, + sizeof(BLOCKTYPE) * length + ); + } + else + { + memset( + &a_dest[i * segment_length], + 0, + sizeof(BLOCKTYPE) * length + ); + } } } } @@ -41,10 +56,24 @@ void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length void cChunkBuffer::CopyMeta(NIBBLETYPE * a_dest) const { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - memcpy(&a_dest[i * segment_length], &m_Sections[i]->m_BlockMeta, sizeof(NIBBLETYPE) * segment_length); + if(m_Sections[i]) + { + memcpy( + &a_dest[i * segment_length], + &m_Sections[i]->m_BlockMeta, + sizeof(NIBBLETYPE) * segment_length); + } + else + { + memset( + &a_dest[i * segment_length], + 0, + sizeof(BLOCKTYPE) * segment_length + ); + } } } @@ -54,10 +83,25 @@ void cChunkBuffer::CopyMeta(NIBBLETYPE * a_dest) const void cChunkBuffer::CopyLight(NIBBLETYPE * a_dest) const { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - memcpy(&a_dest[i * segment_length], &m_Sections[i]->m_BlockLight, sizeof(NIBBLETYPE) * segment_length); + if(m_Sections[i]) + { + memcpy( + &a_dest[i * segment_length], + &m_Sections[i]->m_BlockLight, + sizeof(NIBBLETYPE) * segment_length + ); + } + else + { + memset( + &a_dest[i * segment_length], + 0, + sizeof(BLOCKTYPE) * segment_length + ); + } } } @@ -67,10 +111,25 @@ void cChunkBuffer::CopyLight(NIBBLETYPE * a_dest) const void cChunkBuffer::CopySkyLight(NIBBLETYPE * a_dest) const { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - memcpy(&a_dest[i * segment_length], &m_Sections[i]->m_BlockSkyLight, sizeof(NIBBLETYPE) * segment_length); + if(m_Sections[i]) + { + memcpy( + &a_dest[i * segment_length], + &m_Sections[i]->m_BlockSkyLight, + sizeof(NIBBLETYPE) * segment_length + ); + } + else + { + memset( + &a_dest[i * segment_length], + 0xFF, + sizeof(BLOCKTYPE) * segment_length + ); + } } } @@ -80,13 +139,28 @@ void cChunkBuffer::CopySkyLight(NIBBLETYPE * a_dest) const void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i]) { memcpy(&m_Sections[i]->m_BlockTypes, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length); } + else + { + size_t j = 0; + // do nothing whilst 0 + for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); + if (j != segment_length) + { + m_Sections[i] = Allocate(); + memcpy( + &m_Sections[i]->m_BlockTypes, + &a_src[i * segment_length], + sizeof(BLOCKTYPE) * segment_length + ); + } + } } } @@ -95,13 +169,28 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i]) { memcpy(&m_Sections[i]->m_BlockMeta, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); } + else + { + size_t j = 0; + // do nothing whilst 0 + for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); + if (j != segment_length) + { + m_Sections[i] = Allocate(); + memcpy( + &m_Sections[i]->m_BlockTypes, + &a_src[i * segment_length], + sizeof(BLOCKTYPE) * segment_length + ); + } + } } } @@ -110,14 +199,29 @@ void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i]) { memcpy(&m_Sections[i]->m_BlockLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); } - } + else + { + size_t j = 0; + // do nothing whilst 0 + for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); + if (j != segment_length) + { + m_Sections[i] = Allocate(); + memcpy( + &m_Sections[i]->m_BlockTypes, + &a_src[i * segment_length], + sizeof(BLOCKTYPE) * segment_length + ); + } + } + } } @@ -125,14 +229,29 @@ void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i]) { memcpy(&m_Sections[i]->m_BlockSkyLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); } - } + else + { + size_t j = 0; + // do nothing whilst 0 + for (; j < segment_length && a_src[i * segment_length + j] == 0xFF; j++); + if (j != segment_length) + { + m_Sections[i] = Allocate(); + memcpy( + &m_Sections[i]->m_BlockTypes, + &a_src[i * segment_length], + sizeof(BLOCKTYPE) * segment_length + ); + } + } + } } From d412630904c1de6c0d9ef00fbc75b5558f931e8b Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 08:11:56 -0700 Subject: [PATCH 006/214] Fixed a couple of segfaults and made Free a seperate function --- src/ChunkBuffer.cpp | 38 +++++++++++++++++++++++++++++++++++--- src/ChunkBuffer.h | 7 ++++--- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp index 7946fba1e..a41b8f61a 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkBuffer.cpp @@ -160,6 +160,11 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) sizeof(BLOCKTYPE) * segment_length ); } + else + { + Free(m_Sections[i]); + m_Sections[i] = 0; + } } } } @@ -185,11 +190,16 @@ void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) { m_Sections[i] = Allocate(); memcpy( - &m_Sections[i]->m_BlockTypes, + &m_Sections[i]->m_BlockMeta, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); } + else + { + Free(m_Sections[i]); + m_Sections[i] = 0; + } } } } @@ -199,6 +209,7 @@ void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) { + if (!a_src) return; for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; @@ -215,11 +226,16 @@ void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) { m_Sections[i] = Allocate(); memcpy( - &m_Sections[i]->m_BlockTypes, + &m_Sections[i]->m_BlockLight, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); } + else + { + Free(m_Sections[i]); + m_Sections[i] = 0; + } } } } @@ -229,6 +245,7 @@ void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) { + if (!a_src) return; for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; @@ -245,11 +262,16 @@ void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) { m_Sections[i] = Allocate(); memcpy( - &m_Sections[i]->m_BlockTypes, + &m_Sections[i]->m_BlockSkyLight, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); } + else + { + Free(m_Sections[i]); + m_Sections[i] = 0; + } } } } @@ -263,3 +285,13 @@ cChunkBuffer::sChunkSection * cChunkBuffer::Allocate() const // TODO: use a allocation pool return new cChunkBuffer::sChunkSection; } + + + +void cChunkBuffer::Free(cChunkBuffer::sChunkSection * ptr) const +{ + delete ptr; +} + + + diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index a6a6da013..c23f8971d 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -30,7 +30,7 @@ public: #endif for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i]) delete m_Sections[i]; + if(m_Sections[i]) Free(m_Sections[i]);; } } @@ -52,7 +52,7 @@ public: { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i]) delete m_Sections[i]; + if(m_Sections[i]) Free(m_Sections[i]);; } } IsOwner = true; @@ -76,7 +76,7 @@ public: { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i]) delete m_Sections[i]; + if(m_Sections[i]) Free(m_Sections[i]);; m_Sections[i] = other.m_Sections[i]; } } @@ -239,6 +239,7 @@ private: sChunkSection *m_Sections[CHUNK_SECTION_NUM]; sChunkSection * Allocate() const; + void Free(sChunkSection * ptr) const; }; From 6f1fea759e3595d5538330ecf8f05b8edcf0882e Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 08:14:56 -0700 Subject: [PATCH 007/214] Fixed bad comment --- src/BlockArea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index b4b519bc7..68976ab7a 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -1911,7 +1911,7 @@ bool cBlockArea::cChunkReader::Coords(int a_ChunkX, int a_ChunkZ) void cBlockArea::cChunkReader::ChunkBuffer(const cChunkBuffer & a_BlockBuffer) { - { // BlockTypes + { if (!(m_Area.m_BlockTypes == NULL)) { int SizeY = m_Area.m_Size.y; From 1d3ad6faa22a040bc6bb15727b9783ae2f547a02 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 12:25:03 -0700 Subject: [PATCH 008/214] Added Testing capability --- CMakeLists.txt | 7 ++++++- lib/polarssl.cmake | 6 +++++- tests/CMakeLists.txt | 5 +++++ tests/ChunkBuffer/CMakeLists.txt | 10 ++++++++++ tests/ChunkBuffer/creatable.cpp | 4 ++++ 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 tests/CMakeLists.txt create mode 100644 tests/ChunkBuffer/CMakeLists.txt create mode 100644 tests/ChunkBuffer/creatable.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a860920c..45fc8c37a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 2.8.2) # Without this, the MSVC variable isn't defined for MSVC builds ( http://www.cmake.org/pipermail/cmake/2011-November/047130.html ) enable_language(CXX C) @@ -69,3 +69,8 @@ set_exe_flags() add_subdirectory (src) +if(${SELF_TEST}) + enable_testing() + add_subdirectory (tests) +endif() + diff --git a/lib/polarssl.cmake b/lib/polarssl.cmake index d57cc9220..2a58e54c5 100644 --- a/lib/polarssl.cmake +++ b/lib/polarssl.cmake @@ -1,5 +1,9 @@ if(NOT TARGET polarssl) message("including polarssl") - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl EXCLUDE_FROM_ALL ) + if (SELF_TEST) + add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl) + else() + add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl EXCLUDE_FROM_ALL) + endif() endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 000000000..c2f9ceb5a --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required (VERSION 2.6) + +enable_testing() + +add_subdirectory(ChunkBuffer) diff --git a/tests/ChunkBuffer/CMakeLists.txt b/tests/ChunkBuffer/CMakeLists.txt new file mode 100644 index 000000000..33722f785 --- /dev/null +++ b/tests/ChunkBuffer/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required (VERSION 2.6) + +enable_testing() + +add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkBuffer.cpp) + + +add_executable(creatable-exe creatable.cpp) +target_link_libraries(creatable-exe ChunkBuffer) +add_test(NAME creatable-test COMMAND creatable-exe) diff --git a/tests/ChunkBuffer/creatable.cpp b/tests/ChunkBuffer/creatable.cpp new file mode 100644 index 000000000..573f09de9 --- /dev/null +++ b/tests/ChunkBuffer/creatable.cpp @@ -0,0 +1,4 @@ +int main(int argc, char** argv) +{ +return 0; +} From e6786074d58d81a230a6d5d01a5d89fa2f5ab16e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 00:27:42 +0200 Subject: [PATCH 009/214] Added cBufferedSslContext implementation. --- src/ByteBuffer.h | 40 +++++++++++++-------------- src/PolarSSL++/BufferedSslContext.cpp | 31 +++++++++++++++++++++ 2 files changed, 51 insertions(+), 20 deletions(-) diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h index 7656a5b13..c5ff05922 100644 --- a/src/ByteBuffer.h +++ b/src/ByteBuffer.h @@ -30,25 +30,25 @@ public: cByteBuffer(size_t a_BufferSize); ~cByteBuffer(); - /// Writes the bytes specified to the ringbuffer. Returns true if successful, false if not + /** Writes the bytes specified to the ringbuffer. Returns true if successful, false if not */ bool Write(const void * a_Bytes, size_t a_Count); - /// Returns the number of bytes that can be successfully written to the ringbuffer + /** Returns the number of bytes that can be successfully written to the ringbuffer */ size_t GetFreeSpace(void) const; - /// Returns the number of bytes that are currently in the ringbuffer. Note GetReadableBytes() + /** Returns the number of bytes that are currently in the ringbuffer. Note GetReadableBytes() */ size_t GetUsedSpace(void) const; - /// Returns the number of bytes that are currently available for reading (may be less than UsedSpace due to some data having been read already) + /** Returns the number of bytes that are currently available for reading (may be less than UsedSpace due to some data having been read already) */ size_t GetReadableSpace(void) const; - /// Returns the current data start index. For debugging purposes. + /** Returns the current data start index. For debugging purposes. */ size_t GetDataStart(void) const { return m_DataStart; } - /// Returns true if the specified amount of bytes are available for reading + /** Returns true if the specified amount of bytes are available for reading */ bool CanReadBytes(size_t a_Count) const; - /// Returns true if the specified amount of bytes are available for writing + /** Returns true if the specified amount of bytes are available for writing */ bool CanWriteBytes(size_t a_Count) const; // Read the specified datatype and advance the read pointer; return true if successfully read: @@ -65,7 +65,7 @@ public: bool ReadVarUTF8String (AString & a_Value); // string length as VarInt, then string as UTF-8 bool ReadLEInt (int & a_Value); - /// Reads VarInt, assigns it to anything that can be assigned from an UInt32 (unsigned short, char, Byte, double, ...) + /** Reads VarInt, assigns it to anything that can be assigned from an UInt32 (unsigned short, char, Byte, double, ...) */ template bool ReadVarInt(T & a_Value) { UInt32 v; @@ -91,37 +91,37 @@ public: bool WriteVarUTF8String (const AString & a_Value); // string length as VarInt, then string as UTF-8 bool WriteLEInt (int a_Value); - /// Reads a_Count bytes into a_Buffer; returns true if successful + /** Reads a_Count bytes into a_Buffer; returns true if successful */ bool ReadBuf(void * a_Buffer, size_t a_Count); - /// Writes a_Count bytes into a_Buffer; returns true if successful + /** Writes a_Count bytes into a_Buffer; returns true if successful */ bool WriteBuf(const void * a_Buffer, size_t a_Count); - /// Reads a_Count bytes into a_String; returns true if successful + /** Reads a_Count bytes into a_String; returns true if successful */ bool ReadString(AString & a_String, size_t a_Count); - /// Reads 2 * a_NumChars bytes and interprets it as a UTF16-BE string, converting it into UTF8 string a_String + /** Reads 2 * a_NumChars bytes and interprets it as a UTF16-BE string, converting it into UTF8 string a_String */ bool ReadUTF16String(AString & a_String, int a_NumChars); - /// Skips reading by a_Count bytes; returns false if not enough bytes in the ringbuffer + /** Skips reading by a_Count bytes; returns false if not enough bytes in the ringbuffer */ bool SkipRead(size_t a_Count); - /// Reads all available data into a_Data + /** Reads all available data into a_Data */ void ReadAll(AString & a_Data); - /// Reads the specified number of bytes and writes it into the destinatio bytebuffer. Returns true on success. + /** Reads the specified number of bytes and writes it into the destinatio bytebuffer. Returns true on success. */ bool ReadToByteBuffer(cByteBuffer & a_Dst, size_t a_NumBytes); - /// Removes the bytes that have been read from the ringbuffer + /** Removes the bytes that have been read from the ringbuffer */ void CommitRead(void); - /// Restarts next reading operation at the start of the ringbuffer + /** Restarts next reading operation at the start of the ringbuffer */ void ResetRead(void); - /// Re-reads the data that has been read since the last commit to the current readpos. Used by ProtoProxy to duplicate communication + /** Re-reads the data that has been read since the last commit to the current readpos. Used by ProtoProxy to duplicate communication */ void ReadAgain(AString & a_Out); - /// Checks if the internal state is valid (read and write positions in the correct bounds) using ASSERTs + /** Checks if the internal state is valid (read and write positions in the correct bounds) using ASSERTs */ void CheckValid(void) const; protected: @@ -136,7 +136,7 @@ protected: size_t m_WritePos; // Where the data ends in the ringbuffer size_t m_ReadPos; // Where the next read will start in the ringbuffer - /// Advances the m_ReadPos by a_Count bytes + /** Advances the m_ReadPos by a_Count bytes */ void AdvanceReadPos(size_t a_Count); } ; diff --git a/src/PolarSSL++/BufferedSslContext.cpp b/src/PolarSSL++/BufferedSslContext.cpp index 885b30c68..2455d5781 100644 --- a/src/PolarSSL++/BufferedSslContext.cpp +++ b/src/PolarSSL++/BufferedSslContext.cpp @@ -20,6 +20,37 @@ cBufferedSslContext::cBufferedSslContext(size_t a_BufferSize): +size_t cBufferedSslContext::WriteIncoming(const void * a_Data, size_t a_NumBytes) +{ + size_t NumBytes = std::min(m_IncomingData.GetFreeSpace(), a_NumBytes); + if (NumBytes > 0) + { + m_IncomingData.Write(a_Data, NumBytes); + return a_NumBytes - NumBytes; + } + return 0; +} + + + + + +size_t cBufferedSslContext::ReadOutgoing(void * a_Data, size_t a_DataMaxSize) +{ + size_t NumBytes = std::min(m_OutgoingData.GetReadableSpace(), a_DataMaxSize); + if (NumBytes > 0) + { + m_OutgoingData.ReadBuf(a_Data, NumBytes); + m_OutgoingData.CommitRead(); + return a_DataMaxSize - NumBytes; + } + return 0; +} + + + + + int cBufferedSslContext::ReceiveEncrypted(unsigned char * a_Buffer, size_t a_NumBytes) { // Called when PolarSSL wants to read encrypted data from the SSL peer From 47feb91e57f83c81722188ec3025c3109758dd33 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 00:28:27 +0200 Subject: [PATCH 010/214] cSslContext supports setting own cert / privkey. --- src/PolarSSL++/PublicKey.cpp | 82 ++++++++++++++++++++++++++++++++-- src/PolarSSL++/PublicKey.h | 32 ++++++++++++- src/PolarSSL++/RsaPrivateKey.h | 8 ++++ src/PolarSSL++/SslContext.cpp | 50 ++++++++++++++++++++- src/PolarSSL++/SslContext.h | 22 ++++++++- 5 files changed, 187 insertions(+), 7 deletions(-) diff --git a/src/PolarSSL++/PublicKey.cpp b/src/PolarSSL++/PublicKey.cpp index 49794a0c8..dae026082 100644 --- a/src/PolarSSL++/PublicKey.cpp +++ b/src/PolarSSL++/PublicKey.cpp @@ -10,15 +10,44 @@ -cPublicKey::cPublicKey(const AString & a_PublicKeyDER) +cPublicKey::cPublicKey(void) { pk_init(&m_Pk); - if (pk_parse_public_key(&m_Pk, (const Byte *)a_PublicKeyDER.data(), a_PublicKeyDER.size()) != 0) + m_CtrDrbg.Initialize("rsa_pubkey", 10); +} + + + + + +cPublicKey::cPublicKey(const AString & a_PublicKeyData) +{ + pk_init(&m_Pk); + m_CtrDrbg.Initialize("rsa_pubkey", 10); + int res = ParsePublic(a_PublicKeyData.data(), a_PublicKeyData.size()); + if (res != 0) { + LOGWARNING("Failed to parse public key: -0x%x", res); + ASSERT(!"Cannot parse PubKey"); + return; + } +} + + + + + +cPublicKey::cPublicKey(const AString & a_PrivateKeyData, const AString & a_Password) +{ + pk_init(&m_Pk); + m_CtrDrbg.Initialize("rsa_privkey", 11); + int res = ParsePrivate(a_PrivateKeyData.data(), a_PrivateKeyData.size(), a_Password); + if (res != 0) + { + LOGWARNING("Failed to parse private key: -0x%x", res); ASSERT(!"Cannot parse PubKey"); return; } - m_CtrDrbg.Initialize("rsa_pubkey", 10); } @@ -36,6 +65,8 @@ cPublicKey::~cPublicKey() int cPublicKey::Decrypt(const Byte * a_EncryptedData, size_t a_EncryptedLength, Byte * a_DecryptedData, size_t a_DecryptedMaxLength) { + ASSERT(IsValid()); + size_t DecryptedLen = a_DecryptedMaxLength; int res = pk_decrypt(&m_Pk, a_EncryptedData, a_EncryptedLength, @@ -55,6 +86,8 @@ int cPublicKey::Decrypt(const Byte * a_EncryptedData, size_t a_EncryptedLength, int cPublicKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a_EncryptedData, size_t a_EncryptedMaxLength) { + ASSERT(IsValid()); + size_t EncryptedLength = a_EncryptedMaxLength; int res = pk_encrypt(&m_Pk, a_PlainData, a_PlainLength, a_EncryptedData, &EncryptedLength, a_EncryptedMaxLength, @@ -71,3 +104,46 @@ int cPublicKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a + +int cPublicKey::ParsePublic(const void * a_Data, size_t a_NumBytes) +{ + ASSERT(!IsValid()); // Cannot parse a second key + + return pk_parse_public_key(&m_Pk, (const unsigned char *)a_Data, a_NumBytes); +} + + + + + + +int cPublicKey::ParsePrivate(const void * a_Data, size_t a_NumBytes, const AString & a_Password) +{ + ASSERT(!IsValid()); // Cannot parse a second key + + if (a_Password.empty()) + { + return pk_parse_key(&m_Pk, (const unsigned char *)a_Data, a_NumBytes, NULL, 0); + } + else + { + return pk_parse_key( + &m_Pk, + (const unsigned char *)a_Data, a_NumBytes, + (const unsigned char *)a_Password.c_str(), a_Password.size() + ); + } +} + + + + + +bool cPublicKey::IsValid(void) const +{ + return (pk_get_type(&m_Pk) != POLARSSL_PK_NONE); +} + + + + diff --git a/src/PolarSSL++/PublicKey.h b/src/PolarSSL++/PublicKey.h index 5a0a57147..df52a4143 100644 --- a/src/PolarSSL++/PublicKey.h +++ b/src/PolarSSL++/PublicKey.h @@ -18,9 +18,18 @@ class cPublicKey { + friend class cSslContext; + public: - /** Constructs the public key out of the DER-encoded pubkey data */ - cPublicKey(const AString & a_PublicKeyDER); + /** Constructs an empty key instance. Before use, it needs to be filled by ParsePublic() or ParsePrivate() */ + cPublicKey(void); + + /** Constructs the public key out of the DER- or PEM-encoded pubkey data */ + cPublicKey(const AString & a_PublicKeyData); + + /** Constructs the private key out of the DER- or PEM-encoded privkey data, with the specified password. + If a_Password is empty, no password is assumed. */ + cPublicKey(const AString & a_PrivateKeyData, const AString & a_Password); ~cPublicKey(); @@ -33,6 +42,20 @@ public: Both a_EncryptedData and a_DecryptedData must be at least bytes large. Returns the number of bytes decrypted, or negative number for error. */ int Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a_EncryptedData, size_t a_EncryptedMaxLength); + + /** Parses the specified data into a public key representation. + The key can be DER- or PEM-encoded. + Returns 0 on success, PolarSSL error code on failure. */ + int ParsePublic(const void * a_Data, size_t a_NumBytes); + + /** Parses the specified data into a private key representation. + If a_Password is empty, no password is assumed. + The key can be DER- or PEM-encoded. + Returns 0 on success, PolarSSL error code on failure. */ + int ParsePrivate(const void * a_Data, size_t a_NumBytes, const AString & a_Password); + + /** Returns true if the contained key is valid. */ + bool IsValid(void) const; protected: /** The public key PolarSSL representation */ @@ -40,8 +63,13 @@ protected: /** The random generator used in encryption and decryption */ cCtrDrbgContext m_CtrDrbg; + + + /** Returns the internal context ptr. Only use in PolarSSL API calls. */ + pk_context * GetInternal(void) { return &m_Pk; } } ; +typedef SharedPtr cPublicKeyPtr; diff --git a/src/PolarSSL++/RsaPrivateKey.h b/src/PolarSSL++/RsaPrivateKey.h index ffacde11b..4d03f27df 100644 --- a/src/PolarSSL++/RsaPrivateKey.h +++ b/src/PolarSSL++/RsaPrivateKey.h @@ -19,6 +19,8 @@ /** Encapsulates an RSA private key used in PKI cryptography */ class cRsaPrivateKey { + friend class cSslContext; + public: /** Creates a new empty object, the key is not assigned */ cRsaPrivateKey(void); @@ -51,8 +53,14 @@ protected: /** The random generator used for generating the key and encryption / decryption */ cCtrDrbgContext m_CtrDrbg; + + + /** Returns the internal context ptr. Only use in PolarSSL API calls. */ + rsa_context * GetInternal(void) { return &m_Rsa; } } ; +typedef SharedPtr cRsaPrivateKeyPtr; + diff --git a/src/PolarSSL++/SslContext.cpp b/src/PolarSSL++/SslContext.cpp index 1994cf844..3d2b8cef7 100644 --- a/src/PolarSSL++/SslContext.cpp +++ b/src/PolarSSL++/SslContext.cpp @@ -40,7 +40,7 @@ int cSslContext::Initialize(bool a_IsClient, const SharedPtr & if (m_IsValid) { LOGWARNING("SSL: Double initialization is not supported."); - return POLARSSL_ERR_SSL_MALLOC_FAILED; // There is no return value well-suited for this, reuse this one. + return POLARSSL_ERR_SSL_BAD_INPUT_DATA; // There is no return value well-suited for this, reuse this one. } // Set the CtrDrbg context, create a new one if needed: @@ -80,8 +80,56 @@ int cSslContext::Initialize(bool a_IsClient, const SharedPtr & +void cSslContext::SetOwnCert(const cX509CertPtr & a_OwnCert, const cRsaPrivateKeyPtr & a_OwnCertPrivKey) +{ + ASSERT(m_IsValid); // Call Initialize() first + + // Check that both the cert and the key is valid: + if ((a_OwnCert.get() == NULL) || (a_OwnCertPrivKey.get() == NULL)) + { + LOGWARNING("SSL: Own certificate is not valid, skipping the set."); + return; + } + + // Make sure we have the cert stored for later, PolarSSL only uses the cert later on + m_OwnCert = a_OwnCert; + m_OwnCertPrivKey = a_OwnCertPrivKey; + + // Set into the context: + ssl_set_own_cert_rsa(&m_Ssl, m_OwnCert->GetInternal(), m_OwnCertPrivKey->GetInternal()); +} + + + + + +void cSslContext::SetOwnCert(const cX509CertPtr & a_OwnCert, const cPublicKeyPtr & a_OwnCertPrivKey) +{ + ASSERT(m_IsValid); // Call Initialize() first + + // Check that both the cert and the key is valid: + if ((a_OwnCert.get() == NULL) || (a_OwnCertPrivKey.get() == NULL)) + { + LOGWARNING("SSL: Own certificate is not valid, skipping the set."); + return; + } + + // Make sure we have the cert stored for later, PolarSSL only uses the cert later on + m_OwnCert = a_OwnCert; + m_OwnCertPrivKey2 = a_OwnCertPrivKey; + + // Set into the context: + ssl_set_own_cert(&m_Ssl, m_OwnCert->GetInternal(), m_OwnCertPrivKey2->GetInternal()); +} + + + + + void cSslContext::SetCACerts(const cX509CertPtr & a_CACert, const AString & a_ExpectedPeerName) { + ASSERT(m_IsValid); // Call Initialize() first + // Store the data in our internal buffers, to avoid losing the pointers later on // PolarSSL will need these after this call returns, and the caller may move / delete the data before that: m_ExpectedPeerName = a_ExpectedPeerName; diff --git a/src/PolarSSL++/SslContext.h b/src/PolarSSL++/SslContext.h index 85add5f8b..273939b9f 100644 --- a/src/PolarSSL++/SslContext.h +++ b/src/PolarSSL++/SslContext.h @@ -11,6 +11,8 @@ #include "polarssl/ssl.h" #include "../ByteBuffer.h" +#include "PublicKey.h" +#include "RsaPrivateKey.h" #include "X509Cert.h" @@ -47,7 +49,16 @@ public: /** Returns true if the object has been initialized properly. */ bool IsValid(void) const { return m_IsValid; } - /** Sets a cert chain as the trusted cert store for this context. + /** Sets the certificate to use as our own. Must be used when representing a server, optional when client. + Must be called after Initialize(). */ + void SetOwnCert(const cX509CertPtr & a_OwnCert, const cRsaPrivateKeyPtr & a_OwnCertPrivKey); + + /** Sets the certificate to use as our own. Must be used when representing a server, optional when client. + Must be called after Initialize(). + Despite the class name, a_OwnCertPrivKey is a PRIVATE key. */ + void SetOwnCert(const cX509CertPtr & a_OwnCert, const cPublicKeyPtr & a_OwnCertPrivKey); + + /** Sets a cert chain as the trusted cert store for this context. Must be called after Initialize(). Calling this will switch the context into strict cert verification mode. a_ExpectedPeerName is the CommonName that we expect the SSL peer to have in its cert, if it is different, the verification will fail. An empty string will disable the CN check. */ @@ -93,6 +104,15 @@ protected: /** The SSL context that PolarSSL uses. */ ssl_context m_Ssl; + /** The certificate that we present to the peer. */ + cX509CertPtr m_OwnCert; + + /** Private key for m_OwnCert, if initialized from a cRsaPrivateKey */ + cRsaPrivateKeyPtr m_OwnCertPrivKey; + + /** Private key for m_OwnCert, if initialized from a cPublicKey. Despite the class name, this is a PRIVATE key. */ + cPublicKeyPtr m_OwnCertPrivKey2; + /** True if the SSL handshake has been completed. */ bool m_HasHandshaken; From e2bf3783e8c8f7855532e04203bb1b46b976cfee Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 11:32:25 +0200 Subject: [PATCH 011/214] Fixed BufferedSslContext's buffer reading and writing. --- src/PolarSSL++/BufferedSslContext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PolarSSL++/BufferedSslContext.cpp b/src/PolarSSL++/BufferedSslContext.cpp index 2455d5781..9f7caeb8a 100644 --- a/src/PolarSSL++/BufferedSslContext.cpp +++ b/src/PolarSSL++/BufferedSslContext.cpp @@ -26,7 +26,7 @@ size_t cBufferedSslContext::WriteIncoming(const void * a_Data, size_t a_NumBytes if (NumBytes > 0) { m_IncomingData.Write(a_Data, NumBytes); - return a_NumBytes - NumBytes; + return NumBytes; } return 0; } @@ -42,7 +42,7 @@ size_t cBufferedSslContext::ReadOutgoing(void * a_Data, size_t a_DataMaxSize) { m_OutgoingData.ReadBuf(a_Data, NumBytes); m_OutgoingData.CommitRead(); - return a_DataMaxSize - NumBytes; + return NumBytes; } return 0; } From e1b6a169457b267c3e11bbdb9e58e9ab7b3f0136 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 11:33:29 +0200 Subject: [PATCH 012/214] Added a (disabled) test of low-security ciphersuites. Enabling this allows the connection to be sniffed and decoded using Wireshark, when given the SSL private key. --- src/PolarSSL++/SslContext.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/PolarSSL++/SslContext.cpp b/src/PolarSSL++/SslContext.cpp index 3d2b8cef7..df0219610 100644 --- a/src/PolarSSL++/SslContext.cpp +++ b/src/PolarSSL++/SslContext.cpp @@ -70,6 +70,18 @@ int cSslContext::Initialize(bool a_IsClient, const SharedPtr & ssl_set_dbg(&m_Ssl, &SSLDebugMessage, this); ssl_set_verify(&m_Ssl, &SSLVerifyCert, this); */ + + /* + // Set ciphersuite to the easiest one to decode, so that the connection can be wireshark-decoded: + static const int CipherSuites[] = + { + TLS_RSA_WITH_RC4_128_MD5, + TLS_RSA_WITH_RC4_128_SHA, + TLS_RSA_WITH_AES_128_CBC_SHA, + 0, // Must be 0-terminated! + }; + ssl_set_ciphersuites(&m_Ssl, CipherSuites); + */ #endif m_IsValid = true; From a04cb6d146dfb8f04b0a8943c1e185fc25bf2829 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 11:34:15 +0200 Subject: [PATCH 013/214] Fixed HTTP message parsing, prepared for SSL. --- src/HTTPServer/HTTPConnection.cpp | 5 +++-- src/HTTPServer/HTTPMessage.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/HTTPServer/HTTPConnection.cpp b/src/HTTPServer/HTTPConnection.cpp index da4df0e34..8e95eff2d 100644 --- a/src/HTTPServer/HTTPConnection.cpp +++ b/src/HTTPServer/HTTPConnection.cpp @@ -26,6 +26,7 @@ cHTTPConnection::cHTTPConnection(cHTTPServer & a_HTTPServer) : cHTTPConnection::~cHTTPConnection() { + // LOGD("HTTP: Connection deleting: %p", this); delete m_CurrentRequest; } @@ -183,11 +184,11 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) // Process the rest of the incoming data into the request body: if (a_Size > BytesConsumed) { - DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed); + cHTTPConnection::DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed); } else { - DataReceived("", 0); // If the request has zero body length, let it be processed right-away + cHTTPConnection::DataReceived("", 0); // If the request has zero body length, let it be processed right-away } break; } diff --git a/src/HTTPServer/HTTPMessage.cpp b/src/HTTPServer/HTTPMessage.cpp index 4a3611050..44feda469 100644 --- a/src/HTTPServer/HTTPMessage.cpp +++ b/src/HTTPServer/HTTPMessage.cpp @@ -201,7 +201,7 @@ size_t cHTTPRequest::ParseRequestLine(const char * a_Data, size_t a_Size) return AString::npos; } // Check that there's HTTP/version at the end - if (strncmp(a_Data + URLEnd + 1, "HTTP/1.", 7) != 0) + if (strncmp(m_IncomingHeaderData.c_str() + URLEnd + 1, "HTTP/1.", 7) != 0) { m_IsValid = false; return AString::npos; From 272c232efb645c9f7d75556aeb047e13b244c9ed Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 11:48:03 +0200 Subject: [PATCH 014/214] Implemented SSL connection for WebAdmin. Fixes FS-319. --- MCServer/.gitignore | 4 ++ src/HTTPServer/HTTPServer.cpp | 35 ++++++++- src/HTTPServer/HTTPServer.h | 10 +++ src/HTTPServer/SslHTTPConnection.cpp | 103 +++++++++++++++++++++++++++ src/HTTPServer/SslHTTPConnection.h | 45 ++++++++++++ 5 files changed, 195 insertions(+), 2 deletions(-) create mode 100644 src/HTTPServer/SslHTTPConnection.cpp create mode 100644 src/HTTPServer/SslHTTPConnection.h diff --git a/MCServer/.gitignore b/MCServer/.gitignore index 32a634a03..6da9aa7c7 100644 --- a/MCServer/.gitignore +++ b/MCServer/.gitignore @@ -30,3 +30,7 @@ motd.txt *.xml mcserver_api.lua +# Ignore the webadmin certs / privkey, so that no-one commits theirs by accident: +webadmin/httpscert.crt +webadmin/httpskey.pem + diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp index eaf8405a3..9e3e0a17b 100644 --- a/src/HTTPServer/HTTPServer.cpp +++ b/src/HTTPServer/HTTPServer.cpp @@ -8,6 +8,7 @@ #include "HTTPMessage.h" #include "HTTPConnection.h" #include "HTTPFormParser.h" +#include "SslHTTPConnection.h" @@ -123,8 +124,30 @@ class cDebugCallbacks : cHTTPServer::cHTTPServer(void) : m_ListenThreadIPv4(*this, cSocket::IPv4, "WebServer IPv4"), m_ListenThreadIPv6(*this, cSocket::IPv6, "WebServer IPv6"), - m_Callbacks(NULL) + m_Callbacks(NULL), + m_Cert(new cX509Cert), + m_CertPrivKey(new cPublicKey) { + AString CertFile = cFile::ReadWholeFile("webadmin/httpscert.crt"); + AString KeyFile = cFile::ReadWholeFile("webadmin/httpskey.pem"); + if (!CertFile.empty() && !KeyFile.empty()) + { + int res = m_Cert->Parse(CertFile.data(), CertFile.size()); + if (res == 0) + { + int res2 = m_CertPrivKey->ParsePrivate(KeyFile.data(), KeyFile.size(), ""); + if (res2 != 0) + { + // Reading the private key failed, reset the cert: + LOGWARNING("WebAdmin: Cannot read HTTPS certificate private key: -0x%x", -res2); + m_Cert.reset(); + } + } + else + { + LOGWARNING("WebAdmin: Cannot read HTTPS certificate: -0x%x", -res); + } + } } @@ -195,7 +218,15 @@ void cHTTPServer::Stop(void) void cHTTPServer::OnConnectionAccepted(cSocket & a_Socket) { - cHTTPConnection * Connection = new cHTTPConnection(*this); + cHTTPConnection * Connection; + if (m_Cert.get() != NULL) + { + Connection = new cSslHTTPConnection(*this, m_Cert, m_CertPrivKey); + } + else + { + Connection = new cHTTPConnection(*this); + } m_SocketThreads.AddClient(a_Socket, Connection); cCSLock Lock(m_CSConnections); m_Connections.push_back(Connection); diff --git a/src/HTTPServer/HTTPServer.h b/src/HTTPServer/HTTPServer.h index 8eff7d879..eb91dd5a3 100644 --- a/src/HTTPServer/HTTPServer.h +++ b/src/HTTPServer/HTTPServer.h @@ -12,6 +12,9 @@ #include "../OSSupport/ListenThread.h" #include "../OSSupport/SocketThreads.h" #include "inifile/iniFile.h" +#include "PolarSSL++/RsaPrivateKey.h" +#include "PolarSSL++/PublicKey.h" +#include "PolarSSL++/X509Cert.h" @@ -66,6 +69,7 @@ public: protected: friend class cHTTPConnection; + friend class cSslHTTPConnection; cListenThread m_ListenThreadIPv4; cListenThread m_ListenThreadIPv6; @@ -78,6 +82,12 @@ protected: /// The callbacks to call for various events cCallbacks * m_Callbacks; + /** The server certificate to use for the SSL connections */ + cX509CertPtr m_Cert; + + /** The private key for m_Cert. Despite the class name, this is the PRIVATE key. */ + cPublicKeyPtr m_CertPrivKey; + // cListenThread::cCallback overrides: virtual void OnConnectionAccepted(cSocket & a_Socket) override; diff --git a/src/HTTPServer/SslHTTPConnection.cpp b/src/HTTPServer/SslHTTPConnection.cpp new file mode 100644 index 000000000..fff96bb2e --- /dev/null +++ b/src/HTTPServer/SslHTTPConnection.cpp @@ -0,0 +1,103 @@ + +// SslHTTPConnection.cpp + +// Implements the cSslHTTPConnection class representing a HTTP connection made over a SSL link + +#include "Globals.h" +#include "SslHTTPConnection.h" +#include "HTTPServer.h" + + + + + +cSslHTTPConnection::cSslHTTPConnection(cHTTPServer & a_HTTPServer, const cX509CertPtr & a_Cert, const cPublicKeyPtr & a_PrivateKey) : + super(a_HTTPServer), + m_Ssl(64000), + m_Cert(a_Cert), + m_PrivateKey(a_PrivateKey) +{ + m_Ssl.Initialize(false); + m_Ssl.SetOwnCert(a_Cert, a_PrivateKey); +} + + + + + +void cSslHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) +{ + // If there is outgoing data in the queue, notify the server that it should write it out: + if (!m_OutgoingData.empty()) + { + m_HTTPServer.NotifyConnectionWrite(*this); + } + + // Process the received data: + const char * Data = a_Data; + size_t Size = a_Size; + for (;;) + { + // Try to write as many bytes into Ssl's "incoming" buffer as possible: + size_t BytesWritten = 0; + if (Size > 0) + { + BytesWritten = m_Ssl.WriteIncoming(Data, Size); + Data += BytesWritten; + Size -= BytesWritten; + } + + // Try to read as many bytes from SSL's decryption as possible: + char Buffer[32000]; + int NumRead = m_Ssl.ReadPlain(Buffer, sizeof(Buffer)); + if (NumRead > 0) + { + super::DataReceived(Buffer, (size_t)NumRead); + } + + // If both failed, bail out: + if ((BytesWritten == 0) && (NumRead <= 0)) + { + return; + } + } +} + + + + + +void cSslHTTPConnection::GetOutgoingData(AString & a_Data) +{ + for (;;) + { + // Write as many bytes from our buffer to SSL's encryption as possible: + int NumWritten = 0; + if (!m_OutgoingData.empty()) + { + NumWritten = m_Ssl.WritePlain(m_OutgoingData.data(), m_OutgoingData.size()); + if (NumWritten > 0) + { + m_OutgoingData.erase(0, (size_t)NumWritten); + } + } + + // Read as many bytes from SSL's "outgoing" buffer as possible: + char Buffer[32000]; + size_t NumBytes = m_Ssl.ReadOutgoing(Buffer, sizeof(Buffer)); + if (NumBytes > 0) + { + a_Data.append(Buffer, NumBytes); + } + + // If both failed, bail out: + if ((NumWritten <= 0) && (NumBytes == 0)) + { + return; + } + } +} + + + + diff --git a/src/HTTPServer/SslHTTPConnection.h b/src/HTTPServer/SslHTTPConnection.h new file mode 100644 index 000000000..2a648e8c8 --- /dev/null +++ b/src/HTTPServer/SslHTTPConnection.h @@ -0,0 +1,45 @@ + +// SslHTTPConnection.h + +// Declared the cSslHTTPConnection class representing a HTTP connection made over a SSL link + + + + + +#pragma once + +#include "HTTPConnection.h" +#include "PolarSSL++/BufferedSslContext.h" + + + + + +class cSslHTTPConnection : + public cHTTPConnection +{ + typedef cHTTPConnection super; + +public: + /** Creates a new connection on the specified server; sends the specified cert as the server certificate, + uses the private key for decryption. a_Private key is, despite the class name, a PRIVATE key for the cert. */ + cSslHTTPConnection(cHTTPServer & a_HTTPServer, const cX509CertPtr & a_Cert, const cPublicKeyPtr & a_PrivateKey); + +protected: + cBufferedSslContext m_Ssl; + + /** The certificate to send to the client */ + cX509CertPtr m_Cert; + + /** The private key used for the certificate */ + cPublicKeyPtr m_PrivateKey; + + // cHTTPConnection overrides: + virtual void DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client + virtual void GetOutgoingData(AString & a_Data) override; // Data can be sent to client +} ; + + + + From cf821bc9a4b156d6ffb8a79502936a1de36bb074 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 11:48:45 +0200 Subject: [PATCH 015/214] Added scripts for generating HTTPS cert and key. --- .../GenerateSelfSignedHTTPSCertUsingOpenssl.cmd | 9 +++++++++ .../GenerateSelfSignedHTTPSCertUsingOpenssl.sh | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd create mode 100644 MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh diff --git a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd new file mode 100644 index 000000000..5257e1bd6 --- /dev/null +++ b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd @@ -0,0 +1,9 @@ +echo This script generates the certificate and private key for the https webadmin +echo Note that the generated certificate is self-signed, and therefore not trusted by browsers +echo Note that this script requires openssl to be installed and in PATH +echo. +echo When OpenSSL asks you for Common Name, you need to enter the fully qualified domain name of the server, that is, e. g. gallery.xoft.cz +echo. + +openssl req -x509 -newkey rsa:2048 -keyout httpskey.pem -out httpscert.crt -days 3650 -nodes +pause \ No newline at end of file diff --git a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh new file mode 100644 index 000000000..0c8594f1a --- /dev/null +++ b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "This script generates the certificate and private key for the https webadmin" +echo "Note that the generated certificate is self-signed, and therefore not trusted by browsers" +echo "Note that this script requires openssl to be installed and in PATH" +echo "" +echo "When OpenSSL asks you for Common Name, you need to enter the fully qualified domain name of the server, that is, e. g. gallery.xoft.cz" +echo "" + +openssl req -x509 -newkey rsa:2048 -keyout httpskey.pem -out httpscert.pem -days 3650 -nodes \ No newline at end of file From dc2d2ce53c2f751f72217a26d4f68d72f5f0f5f0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 12:27:07 +0200 Subject: [PATCH 016/214] Added a mention to run as admin. --- MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd index 5257e1bd6..661cc34e8 100644 --- a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd +++ b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd @@ -4,6 +4,8 @@ echo Note that this script requires openssl to be installed and in PATH echo. echo When OpenSSL asks you for Common Name, you need to enter the fully qualified domain name of the server, that is, e. g. gallery.xoft.cz echo. +echo If OpenSSL fails with an error, "WARNING: can't open config file: /usr/local/ssl/openssl.cnf", you need to run this script as an administrator +echo. openssl req -x509 -newkey rsa:2048 -keyout httpskey.pem -out httpscert.crt -days 3650 -nodes pause \ No newline at end of file From 60850fe3e8da936d5b24460f33a1bf8f4d321ace Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 15:08:15 +0200 Subject: [PATCH 017/214] Fixed crashes in the SSL HTTP connection. --- src/ClientHandle.cpp | 3 ++- src/ClientHandle.h | 2 +- src/HTTPServer/HTTPConnection.cpp | 14 +++++++------- src/HTTPServer/HTTPConnection.h | 12 +++++++++--- src/HTTPServer/SslHTTPConnection.cpp | 10 +++++++--- src/HTTPServer/SslHTTPConnection.h | 2 +- src/OSSupport/SocketThreads.h | 6 ++++-- src/RCONServer.cpp | 8 ++++---- src/RCONServer.h | 2 +- 9 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 2362abe1e..a2bfdd381 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2649,12 +2649,13 @@ void cClientHandle::PacketError(unsigned char a_PacketType) -void cClientHandle::DataReceived(const char * a_Data, size_t a_Size) +bool cClientHandle::DataReceived(const char * a_Data, size_t a_Size) { // Data is received from the client, store it in the buffer to be processed by the Tick thread: m_TimeSinceLastPacket = 0; cCSLock Lock(m_CSIncomingData); m_IncomingData.append(a_Data, a_Size); + return false; } diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 9f8d44129..ac44e43dc 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -387,7 +387,7 @@ private: void HandleCommandBlockMessage(const char * a_Data, unsigned int a_Length); // cSocketThreads::cCallback overrides: - virtual void DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client + virtual bool DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client virtual void GetOutgoingData(AString & a_Data) override; // Data can be sent to client virtual void SocketClosed (void) override; // The socket has been closed for any reason }; // tolua_export diff --git a/src/HTTPServer/HTTPConnection.cpp b/src/HTTPServer/HTTPConnection.cpp index 8e95eff2d..b127e7091 100644 --- a/src/HTTPServer/HTTPConnection.cpp +++ b/src/HTTPServer/HTTPConnection.cpp @@ -145,7 +145,7 @@ void cHTTPConnection::Terminate(void) -void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) +bool cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) { switch (m_State) { @@ -163,12 +163,12 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) m_CurrentRequest = NULL; m_State = wcsInvalid; m_HTTPServer.CloseConnection(*this); - return; + return true; } if (m_CurrentRequest->IsInHeaders()) { // The request headers are not yet complete - return; + return false; } // The request has finished parsing its headers successfully, notify of it: @@ -184,13 +184,12 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) // Process the rest of the incoming data into the request body: if (a_Size > BytesConsumed) { - cHTTPConnection::DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed); + return cHTTPConnection::DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed); } else { - cHTTPConnection::DataReceived("", 0); // If the request has zero body length, let it be processed right-away + return cHTTPConnection::DataReceived("", 0); // If the request has zero body length, let it be processed right-away } - break; } case wcsRecvBody: @@ -210,7 +209,7 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) { m_State = wcsInvalid; m_HTTPServer.CloseConnection(*this); - return; + return true; } delete m_CurrentRequest; m_CurrentRequest = NULL; @@ -224,6 +223,7 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) break; } } + return false; } diff --git a/src/HTTPServer/HTTPConnection.h b/src/HTTPServer/HTTPConnection.h index fc11f1ba6..6ea8a1ae8 100644 --- a/src/HTTPServer/HTTPConnection.h +++ b/src/HTTPServer/HTTPConnection.h @@ -91,9 +91,15 @@ protected: // cSocketThreads::cCallback overrides: - virtual void DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client - virtual void GetOutgoingData(AString & a_Data) override; // Data can be sent to client - virtual void SocketClosed (void) override; // The socket has been closed for any reason + /** Data is received from the client. + Returns true if the connection has been closed as the result of parsing the data. */ + virtual bool DataReceived(const char * a_Data, size_t a_Size) override; + + /** Data can be sent to client */ + virtual void GetOutgoingData(AString & a_Data) override; + + /** The socket has been closed for any reason */ + virtual void SocketClosed(void) override; } ; typedef std::vector cHTTPConnections; diff --git a/src/HTTPServer/SslHTTPConnection.cpp b/src/HTTPServer/SslHTTPConnection.cpp index fff96bb2e..b6b222b47 100644 --- a/src/HTTPServer/SslHTTPConnection.cpp +++ b/src/HTTPServer/SslHTTPConnection.cpp @@ -25,7 +25,7 @@ cSslHTTPConnection::cSslHTTPConnection(cHTTPServer & a_HTTPServer, const cX509Ce -void cSslHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) +bool cSslHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) { // If there is outgoing data in the queue, notify the server that it should write it out: if (!m_OutgoingData.empty()) @@ -52,13 +52,17 @@ void cSslHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) int NumRead = m_Ssl.ReadPlain(Buffer, sizeof(Buffer)); if (NumRead > 0) { - super::DataReceived(Buffer, (size_t)NumRead); + if (super::DataReceived(Buffer, (size_t)NumRead)) + { + // The socket has been closed, and the object is already deleted. Bail out. + return true; + } } // If both failed, bail out: if ((BytesWritten == 0) && (NumRead <= 0)) { - return; + return false; } } } diff --git a/src/HTTPServer/SslHTTPConnection.h b/src/HTTPServer/SslHTTPConnection.h index 2a648e8c8..653acbfce 100644 --- a/src/HTTPServer/SslHTTPConnection.h +++ b/src/HTTPServer/SslHTTPConnection.h @@ -36,7 +36,7 @@ protected: cPublicKeyPtr m_PrivateKey; // cHTTPConnection overrides: - virtual void DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client + virtual bool DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client virtual void GetOutgoingData(AString & a_Data) override; // Data can be sent to client } ; diff --git a/src/OSSupport/SocketThreads.h b/src/OSSupport/SocketThreads.h index 679e374e1..944f5f3bc 100644 --- a/src/OSSupport/SocketThreads.h +++ b/src/OSSupport/SocketThreads.h @@ -63,8 +63,10 @@ public: // Force a virtual destructor in all subclasses: virtual ~cCallback() {} - /** Called when data is received from the remote party */ - virtual void DataReceived(const char * a_Data, size_t a_Size) = 0; + /** Called when data is received from the remote party. + SocketThreads does not care about the return value, others can use it for their specific purpose - + for example HTTPServer uses it to signal if the connection was terminated as a result of the data received. */ + virtual bool DataReceived(const char * a_Data, size_t a_Size) = 0; /** Called when data can be sent to remote party The function is supposed to *set* outgoing data to a_Data (overwrite) */ diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp index d7083ff2b..fd4b26cab 100644 --- a/src/RCONServer.cpp +++ b/src/RCONServer.cpp @@ -169,7 +169,7 @@ cRCONServer::cConnection::cConnection(cRCONServer & a_RCONServer, cSocket & a_So -void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size) +bool cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size) { // Append data to the buffer: m_Buffer.append(a_Data, a_Size); @@ -187,12 +187,12 @@ void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size) m_RCONServer.m_SocketThreads.RemoveClient(this); m_Socket.CloseSocket(); delete this; - return; + return false; } if (Length > (int)(m_Buffer.size() + 4)) { // Incomplete packet yet, wait for more data to come - return; + return false; } int RequestID = IntFromBuffer(m_Buffer.data() + 4); @@ -202,7 +202,7 @@ void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size) m_RCONServer.m_SocketThreads.RemoveClient(this); m_Socket.CloseSocket(); delete this; - return; + return false; } m_Buffer.erase(0, Length + 4); } // while (m_Buffer.size() >= 14) diff --git a/src/RCONServer.h b/src/RCONServer.h index b964852ab..47c746736 100644 --- a/src/RCONServer.h +++ b/src/RCONServer.h @@ -65,7 +65,7 @@ protected: // cSocketThreads::cCallback overrides: - virtual void DataReceived(const char * a_Data, size_t a_Size) override; + virtual bool DataReceived(const char * a_Data, size_t a_Size) override; virtual void GetOutgoingData(AString & a_Data) override; virtual void SocketClosed(void) override; From 1587b21edded56dbfb88150500336c2853b460c6 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 15:21:41 +0200 Subject: [PATCH 018/214] Renamed cPublicKey to cCryptoKey. The class can hold both the private key and the public key, bad naming on PolarSSL's part. Also somewhat fixed the cert and key loading in cHTTPServer. --- src/HTTPServer/HTTPServer.cpp | 6 ++--- src/HTTPServer/HTTPServer.h | 6 ++--- src/HTTPServer/SslHTTPConnection.cpp | 2 +- src/HTTPServer/SslHTTPConnection.h | 8 +++---- .../{PublicKey.cpp => CryptoKey.cpp} | 24 +++++++++---------- src/PolarSSL++/{PublicKey.h => CryptoKey.h} | 18 +++++++------- src/PolarSSL++/CtrDrbgContext.h | 2 +- src/PolarSSL++/SslContext.cpp | 2 +- src/PolarSSL++/SslContext.h | 13 +++++----- 9 files changed, 40 insertions(+), 41 deletions(-) rename src/PolarSSL++/{PublicKey.cpp => CryptoKey.cpp} (77%) rename src/PolarSSL++/{PublicKey.h => CryptoKey.h} (85%) diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp index 9e3e0a17b..c45044c66 100644 --- a/src/HTTPServer/HTTPServer.cpp +++ b/src/HTTPServer/HTTPServer.cpp @@ -124,17 +124,17 @@ class cDebugCallbacks : cHTTPServer::cHTTPServer(void) : m_ListenThreadIPv4(*this, cSocket::IPv4, "WebServer IPv4"), m_ListenThreadIPv6(*this, cSocket::IPv6, "WebServer IPv6"), - m_Callbacks(NULL), - m_Cert(new cX509Cert), - m_CertPrivKey(new cPublicKey) + m_Callbacks(NULL) { AString CertFile = cFile::ReadWholeFile("webadmin/httpscert.crt"); AString KeyFile = cFile::ReadWholeFile("webadmin/httpskey.pem"); if (!CertFile.empty() && !KeyFile.empty()) { + m_Cert.reset(new cX509Cert); int res = m_Cert->Parse(CertFile.data(), CertFile.size()); if (res == 0) { + m_CertPrivKey.reset(new cCryptoKey); int res2 = m_CertPrivKey->ParsePrivate(KeyFile.data(), KeyFile.size(), ""); if (res2 != 0) { diff --git a/src/HTTPServer/HTTPServer.h b/src/HTTPServer/HTTPServer.h index eb91dd5a3..522b7da62 100644 --- a/src/HTTPServer/HTTPServer.h +++ b/src/HTTPServer/HTTPServer.h @@ -13,7 +13,7 @@ #include "../OSSupport/SocketThreads.h" #include "inifile/iniFile.h" #include "PolarSSL++/RsaPrivateKey.h" -#include "PolarSSL++/PublicKey.h" +#include "PolarSSL++/CryptoKey.h" #include "PolarSSL++/X509Cert.h" @@ -85,8 +85,8 @@ protected: /** The server certificate to use for the SSL connections */ cX509CertPtr m_Cert; - /** The private key for m_Cert. Despite the class name, this is the PRIVATE key. */ - cPublicKeyPtr m_CertPrivKey; + /** The private key for m_Cert. */ + cCryptoKeyPtr m_CertPrivKey; // cListenThread::cCallback overrides: diff --git a/src/HTTPServer/SslHTTPConnection.cpp b/src/HTTPServer/SslHTTPConnection.cpp index b6b222b47..d237089d9 100644 --- a/src/HTTPServer/SslHTTPConnection.cpp +++ b/src/HTTPServer/SslHTTPConnection.cpp @@ -11,7 +11,7 @@ -cSslHTTPConnection::cSslHTTPConnection(cHTTPServer & a_HTTPServer, const cX509CertPtr & a_Cert, const cPublicKeyPtr & a_PrivateKey) : +cSslHTTPConnection::cSslHTTPConnection(cHTTPServer & a_HTTPServer, const cX509CertPtr & a_Cert, const cCryptoKeyPtr & a_PrivateKey) : super(a_HTTPServer), m_Ssl(64000), m_Cert(a_Cert), diff --git a/src/HTTPServer/SslHTTPConnection.h b/src/HTTPServer/SslHTTPConnection.h index 653acbfce..c2c1585cd 100644 --- a/src/HTTPServer/SslHTTPConnection.h +++ b/src/HTTPServer/SslHTTPConnection.h @@ -22,9 +22,9 @@ class cSslHTTPConnection : typedef cHTTPConnection super; public: - /** Creates a new connection on the specified server; sends the specified cert as the server certificate, - uses the private key for decryption. a_Private key is, despite the class name, a PRIVATE key for the cert. */ - cSslHTTPConnection(cHTTPServer & a_HTTPServer, const cX509CertPtr & a_Cert, const cPublicKeyPtr & a_PrivateKey); + /** Creates a new connection on the specified server. + Sends the specified cert as the server certificate, uses the private key for decryption. */ + cSslHTTPConnection(cHTTPServer & a_HTTPServer, const cX509CertPtr & a_Cert, const cCryptoKeyPtr & a_PrivateKey); protected: cBufferedSslContext m_Ssl; @@ -33,7 +33,7 @@ protected: cX509CertPtr m_Cert; /** The private key used for the certificate */ - cPublicKeyPtr m_PrivateKey; + cCryptoKeyPtr m_PrivateKey; // cHTTPConnection overrides: virtual bool DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client diff --git a/src/PolarSSL++/PublicKey.cpp b/src/PolarSSL++/CryptoKey.cpp similarity index 77% rename from src/PolarSSL++/PublicKey.cpp rename to src/PolarSSL++/CryptoKey.cpp index dae026082..0763c387b 100644 --- a/src/PolarSSL++/PublicKey.cpp +++ b/src/PolarSSL++/CryptoKey.cpp @@ -1,16 +1,16 @@ -// PublicKey.cpp +// CryptoKey.cpp -// Implements the cPublicKey class representing a RSA public key in PolarSSL +// Implements the cCryptoKey class representing a RSA public key in PolarSSL #include "Globals.h" -#include "PublicKey.h" +#include "CryptoKey.h" -cPublicKey::cPublicKey(void) +cCryptoKey::cCryptoKey(void) { pk_init(&m_Pk); m_CtrDrbg.Initialize("rsa_pubkey", 10); @@ -20,7 +20,7 @@ cPublicKey::cPublicKey(void) -cPublicKey::cPublicKey(const AString & a_PublicKeyData) +cCryptoKey::cCryptoKey(const AString & a_PublicKeyData) { pk_init(&m_Pk); m_CtrDrbg.Initialize("rsa_pubkey", 10); @@ -37,7 +37,7 @@ cPublicKey::cPublicKey(const AString & a_PublicKeyData) -cPublicKey::cPublicKey(const AString & a_PrivateKeyData, const AString & a_Password) +cCryptoKey::cCryptoKey(const AString & a_PrivateKeyData, const AString & a_Password) { pk_init(&m_Pk); m_CtrDrbg.Initialize("rsa_privkey", 11); @@ -54,7 +54,7 @@ cPublicKey::cPublicKey(const AString & a_PrivateKeyData, const AString & a_Passw -cPublicKey::~cPublicKey() +cCryptoKey::~cCryptoKey() { pk_free(&m_Pk); } @@ -63,7 +63,7 @@ cPublicKey::~cPublicKey() -int cPublicKey::Decrypt(const Byte * a_EncryptedData, size_t a_EncryptedLength, Byte * a_DecryptedData, size_t a_DecryptedMaxLength) +int cCryptoKey::Decrypt(const Byte * a_EncryptedData, size_t a_EncryptedLength, Byte * a_DecryptedData, size_t a_DecryptedMaxLength) { ASSERT(IsValid()); @@ -84,7 +84,7 @@ int cPublicKey::Decrypt(const Byte * a_EncryptedData, size_t a_EncryptedLength, -int cPublicKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a_EncryptedData, size_t a_EncryptedMaxLength) +int cCryptoKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a_EncryptedData, size_t a_EncryptedMaxLength) { ASSERT(IsValid()); @@ -105,7 +105,7 @@ int cPublicKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a -int cPublicKey::ParsePublic(const void * a_Data, size_t a_NumBytes) +int cCryptoKey::ParsePublic(const void * a_Data, size_t a_NumBytes) { ASSERT(!IsValid()); // Cannot parse a second key @@ -117,7 +117,7 @@ int cPublicKey::ParsePublic(const void * a_Data, size_t a_NumBytes) -int cPublicKey::ParsePrivate(const void * a_Data, size_t a_NumBytes, const AString & a_Password) +int cCryptoKey::ParsePrivate(const void * a_Data, size_t a_NumBytes, const AString & a_Password) { ASSERT(!IsValid()); // Cannot parse a second key @@ -139,7 +139,7 @@ int cPublicKey::ParsePrivate(const void * a_Data, size_t a_NumBytes, const AStri -bool cPublicKey::IsValid(void) const +bool cCryptoKey::IsValid(void) const { return (pk_get_type(&m_Pk) != POLARSSL_PK_NONE); } diff --git a/src/PolarSSL++/PublicKey.h b/src/PolarSSL++/CryptoKey.h similarity index 85% rename from src/PolarSSL++/PublicKey.h rename to src/PolarSSL++/CryptoKey.h index df52a4143..9c298e501 100644 --- a/src/PolarSSL++/PublicKey.h +++ b/src/PolarSSL++/CryptoKey.h @@ -1,7 +1,7 @@ -// PublicKey.h +// CryptoKey.h -// Declares the cPublicKey class representing a RSA public key in PolarSSL +// Declares the cCryptoKey class representing a RSA public key in PolarSSL @@ -16,22 +16,22 @@ -class cPublicKey +class cCryptoKey { friend class cSslContext; public: /** Constructs an empty key instance. Before use, it needs to be filled by ParsePublic() or ParsePrivate() */ - cPublicKey(void); + cCryptoKey(void); /** Constructs the public key out of the DER- or PEM-encoded pubkey data */ - cPublicKey(const AString & a_PublicKeyData); + cCryptoKey(const AString & a_PublicKeyData); /** Constructs the private key out of the DER- or PEM-encoded privkey data, with the specified password. If a_Password is empty, no password is assumed. */ - cPublicKey(const AString & a_PrivateKeyData, const AString & a_Password); + cCryptoKey(const AString & a_PrivateKeyData, const AString & a_Password); - ~cPublicKey(); + ~cCryptoKey(); /** Decrypts the data using the stored public key Both a_EncryptedData and a_DecryptedData must be at least bytes large. @@ -58,7 +58,7 @@ public: bool IsValid(void) const; protected: - /** The public key PolarSSL representation */ + /** The PolarSSL representation of the key data */ pk_context m_Pk; /** The random generator used in encryption and decryption */ @@ -69,7 +69,7 @@ protected: pk_context * GetInternal(void) { return &m_Pk; } } ; -typedef SharedPtr cPublicKeyPtr; +typedef SharedPtr cCryptoKeyPtr; diff --git a/src/PolarSSL++/CtrDrbgContext.h b/src/PolarSSL++/CtrDrbgContext.h index 65e9a2374..230db8753 100644 --- a/src/PolarSSL++/CtrDrbgContext.h +++ b/src/PolarSSL++/CtrDrbgContext.h @@ -26,7 +26,7 @@ class cCtrDrbgContext { friend class cSslContext; friend class cRsaPrivateKey; - friend class cPublicKey; + friend class cCryptoKey; public: /** Constructs the context with a new entropy context. */ diff --git a/src/PolarSSL++/SslContext.cpp b/src/PolarSSL++/SslContext.cpp index df0219610..bc397b655 100644 --- a/src/PolarSSL++/SslContext.cpp +++ b/src/PolarSSL++/SslContext.cpp @@ -115,7 +115,7 @@ void cSslContext::SetOwnCert(const cX509CertPtr & a_OwnCert, const cRsaPrivateKe -void cSslContext::SetOwnCert(const cX509CertPtr & a_OwnCert, const cPublicKeyPtr & a_OwnCertPrivKey) +void cSslContext::SetOwnCert(const cX509CertPtr & a_OwnCert, const cCryptoKeyPtr & a_OwnCertPrivKey) { ASSERT(m_IsValid); // Call Initialize() first diff --git a/src/PolarSSL++/SslContext.h b/src/PolarSSL++/SslContext.h index 273939b9f..a4ad1a345 100644 --- a/src/PolarSSL++/SslContext.h +++ b/src/PolarSSL++/SslContext.h @@ -11,7 +11,7 @@ #include "polarssl/ssl.h" #include "../ByteBuffer.h" -#include "PublicKey.h" +#include "CryptoKey.h" #include "RsaPrivateKey.h" #include "X509Cert.h" @@ -54,9 +54,8 @@ public: void SetOwnCert(const cX509CertPtr & a_OwnCert, const cRsaPrivateKeyPtr & a_OwnCertPrivKey); /** Sets the certificate to use as our own. Must be used when representing a server, optional when client. - Must be called after Initialize(). - Despite the class name, a_OwnCertPrivKey is a PRIVATE key. */ - void SetOwnCert(const cX509CertPtr & a_OwnCert, const cPublicKeyPtr & a_OwnCertPrivKey); + Must be called after Initialize(). */ + void SetOwnCert(const cX509CertPtr & a_OwnCert, const cCryptoKeyPtr & a_OwnCertPrivKey); /** Sets a cert chain as the trusted cert store for this context. Must be called after Initialize(). Calling this will switch the context into strict cert verification mode. @@ -107,11 +106,11 @@ protected: /** The certificate that we present to the peer. */ cX509CertPtr m_OwnCert; - /** Private key for m_OwnCert, if initialized from a cRsaPrivateKey */ + /** Private key for m_OwnCert, if initialized from a cRsaPrivateKey. */ cRsaPrivateKeyPtr m_OwnCertPrivKey; - /** Private key for m_OwnCert, if initialized from a cPublicKey. Despite the class name, this is a PRIVATE key. */ - cPublicKeyPtr m_OwnCertPrivKey2; + /** Private key for m_OwnCert, if initialized from a cCryptoKey. */ + cCryptoKeyPtr m_OwnCertPrivKey2; /** True if the SSL handshake has been completed. */ bool m_HasHandshaken; From d9e5dbf16526aa102abdc818d3515928663a973c Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 1 May 2014 18:06:23 +0200 Subject: [PATCH 019/214] Renamed PublicKey to CryptoKey in CMakeLists.txt --- src/PolarSSL++/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/PolarSSL++/CMakeLists.txt b/src/PolarSSL++/CMakeLists.txt index b0a592760..9a59cdb2c 100644 --- a/src/PolarSSL++/CMakeLists.txt +++ b/src/PolarSSL++/CMakeLists.txt @@ -1,4 +1,3 @@ - cmake_minimum_required (VERSION 2.6) project (MCServer) @@ -11,8 +10,8 @@ set(SOURCES BufferedSslContext.cpp CallbackSslContext.cpp CtrDrbgContext.cpp + CryptoKey.cpp EntropyContext.cpp - PublicKey.cpp RsaPrivateKey.cpp Sha1Checksum.cpp SslContext.cpp @@ -26,8 +25,8 @@ set(HEADERS BufferedSslContext.h CallbackSslContext.h CtrDrbgContext.h + CryptoKey.h EntropyContext.h - PublicKey.h RsaPrivateKey.h SslContext.h Sha1Checksum.h From 3e854bc5960dccbcecc32bf2f280f1fb04f67307 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 20:20:12 +0200 Subject: [PATCH 020/214] ProtoProxy: Renamed PublicKey to CryptoKey. --- Tools/ProtoProxy/CMakeLists.txt | 4 ++-- Tools/ProtoProxy/Connection.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tools/ProtoProxy/CMakeLists.txt b/Tools/ProtoProxy/CMakeLists.txt index a136c95df..f0796363c 100644 --- a/Tools/ProtoProxy/CMakeLists.txt +++ b/Tools/ProtoProxy/CMakeLists.txt @@ -38,9 +38,9 @@ set(SHARED_SRC ../../src/MCLogger.cpp ../../src/PolarSSL++/AesCfb128Decryptor.cpp ../../src/PolarSSL++/AesCfb128Encryptor.cpp + ../../src/PolarSSL++/CryptoKey.cpp ../../src/PolarSSL++/CtrDrbgContext.cpp ../../src/PolarSSL++/EntropyContext.cpp - ../../src/PolarSSL++/PublicKey.cpp ../../src/PolarSSL++/RsaPrivateKey.cpp ) set(SHARED_HDR @@ -50,9 +50,9 @@ set(SHARED_HDR ../../src/MCLogger.h ../../src/PolarSSL++/AesCfb128Decryptor.h ../../src/PolarSSL++/AesCfb128Encryptor.h + ../../src/PolarSSL++/CryptoKey.h ../../src/PolarSSL++/CtrDrbgContext.h ../../src/PolarSSL++/EntropyContext.h - ../../src/PolarSSL++/PublicKey.h ../../src/PolarSSL++/RsaPrivateKey.h ) set(SHARED_OSS_SRC diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp index 26aed2206..c5916c1ca 100644 --- a/Tools/ProtoProxy/Connection.cpp +++ b/Tools/ProtoProxy/Connection.cpp @@ -7,7 +7,7 @@ #include "Connection.h" #include "Server.h" #include -#include "PolarSSL++/PublicKey.h" +#include "PolarSSL++/CryptoKey.h" #ifdef _WIN32 #include // For _mkdir() @@ -2900,7 +2900,7 @@ void cConnection::SendEncryptionKeyResponse(const AString & a_ServerPublicKey, c Byte SharedSecret[16]; Byte EncryptedSecret[128]; memset(SharedSecret, 0, sizeof(SharedSecret)); // Use all zeroes for the initial secret - cPublicKey PubKey(a_ServerPublicKey); + cCryptoKey PubKey(a_ServerPublicKey); int res = PubKey.Encrypt(SharedSecret, sizeof(SharedSecret), EncryptedSecret, sizeof(EncryptedSecret)); if (res < 0) { From 1929b46affd7e8ae98230faa726a896eef75cb16 Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 1 May 2014 11:52:08 -0700 Subject: [PATCH 021/214] Disable polarssl tests by default --- lib/polarssl.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/polarssl.cmake b/lib/polarssl.cmake index 2a58e54c5..4a2af9dfd 100644 --- a/lib/polarssl.cmake +++ b/lib/polarssl.cmake @@ -2,6 +2,7 @@ if(NOT TARGET polarssl) message("including polarssl") if (SELF_TEST) + set(ENABLE_TESTING 0) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl) else() add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl EXCLUDE_FROM_ALL) From 47cc1a84e186f76f69ad432c081ae74ff6c80a6e Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 1 May 2014 11:57:07 -0700 Subject: [PATCH 022/214] Tests off by default take 2 --- lib/polarssl.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/polarssl.cmake b/lib/polarssl.cmake index 4a2af9dfd..172a63729 100644 --- a/lib/polarssl.cmake +++ b/lib/polarssl.cmake @@ -2,7 +2,7 @@ if(NOT TARGET polarssl) message("including polarssl") if (SELF_TEST) - set(ENABLE_TESTING 0) + set(ENABLE_TESTING OFF CACHE BOOL) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl) else() add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl EXCLUDE_FROM_ALL) From 8d6919f3b63338ec01eff15a3968b004bd3be132 Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 1 May 2014 12:05:11 -0700 Subject: [PATCH 023/214] Fixed polarssl programs included --- lib/polarssl.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/polarssl.cmake b/lib/polarssl.cmake index 172a63729..91f0fa145 100644 --- a/lib/polarssl.cmake +++ b/lib/polarssl.cmake @@ -2,7 +2,8 @@ if(NOT TARGET polarssl) message("including polarssl") if (SELF_TEST) - set(ENABLE_TESTING OFF CACHE BOOL) + set(ENABLE_TESTING OFF CACHE BOOL "Disable tests") + set(ENABLE_PROGRAMS OFF CACHE BOOL "Disable programs") add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl) else() add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/polarssl/ ${CMAKE_CURRENT_BINARY_DIR}/lib/polarssl EXCLUDE_FROM_ALL) From 9221b458989512e41f8502b56ed738d143599093 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 21:23:37 +0200 Subject: [PATCH 024/214] cSslContext has virtual destructor now. --- src/PolarSSL++/SslContext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PolarSSL++/SslContext.h b/src/PolarSSL++/SslContext.h index a4ad1a345..6b4f2c1e7 100644 --- a/src/PolarSSL++/SslContext.h +++ b/src/PolarSSL++/SslContext.h @@ -40,7 +40,7 @@ public: /** Creates a new uninitialized context */ cSslContext(void); - ~cSslContext(); + virtual ~cSslContext(); /** Initializes the context for use as a server or client. Returns 0 on success, PolarSSL error on failure. */ From 30e81156eb6de46d7a374c044e26b35d83af4244 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 22:02:45 +0200 Subject: [PATCH 025/214] Added a missing return statement. --- src/RCONServer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp index fd4b26cab..cd5292ac3 100644 --- a/src/RCONServer.cpp +++ b/src/RCONServer.cpp @@ -206,6 +206,7 @@ bool cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size) } m_Buffer.erase(0, Length + 4); } // while (m_Buffer.size() >= 14) + return false; } From e3d850b24a66cb926fced7b98eea6ed4d12b5f6f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 2 May 2014 21:35:30 +0000 Subject: [PATCH 026/214] Made the cert generation script executable on Linux --- MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh diff --git a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh old mode 100644 new mode 100755 From 3942ebdcb6e62d8b2fb85fad9144a993a78477a6 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 2 May 2014 23:46:06 +0200 Subject: [PATCH 027/214] WebAdmin outputs a log message about HTTP / HTTPS status. --- src/HTTPServer/HTTPServer.cpp | 57 +++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp index c45044c66..b78a538a2 100644 --- a/src/HTTPServer/HTTPServer.cpp +++ b/src/HTTPServer/HTTPServer.cpp @@ -126,28 +126,6 @@ cHTTPServer::cHTTPServer(void) : m_ListenThreadIPv6(*this, cSocket::IPv6, "WebServer IPv6"), m_Callbacks(NULL) { - AString CertFile = cFile::ReadWholeFile("webadmin/httpscert.crt"); - AString KeyFile = cFile::ReadWholeFile("webadmin/httpskey.pem"); - if (!CertFile.empty() && !KeyFile.empty()) - { - m_Cert.reset(new cX509Cert); - int res = m_Cert->Parse(CertFile.data(), CertFile.size()); - if (res == 0) - { - m_CertPrivKey.reset(new cCryptoKey); - int res2 = m_CertPrivKey->ParsePrivate(KeyFile.data(), KeyFile.size(), ""); - if (res2 != 0) - { - // Reading the private key failed, reset the cert: - LOGWARNING("WebAdmin: Cannot read HTTPS certificate private key: -0x%x", -res2); - m_Cert.reset(); - } - } - else - { - LOGWARNING("WebAdmin: Cannot read HTTPS certificate: -0x%x", -res); - } - } } @@ -165,6 +143,41 @@ cHTTPServer::~cHTTPServer() bool cHTTPServer::Initialize(const AString & a_PortsIPv4, const AString & a_PortsIPv6) { + // Read the HTTPS cert + key: + AString CertFile = cFile::ReadWholeFile("webadmin/httpscert.crt"); + AString KeyFile = cFile::ReadWholeFile("webadmin/httpskey.pem"); + if (!CertFile.empty() && !KeyFile.empty()) + { + m_Cert.reset(new cX509Cert); + int res = m_Cert->Parse(CertFile.data(), CertFile.size()); + if (res == 0) + { + m_CertPrivKey.reset(new cCryptoKey); + int res2 = m_CertPrivKey->ParsePrivate(KeyFile.data(), KeyFile.size(), ""); + if (res2 != 0) + { + // Reading the private key failed, reset the cert: + LOGWARNING("WebServer: Cannot read HTTPS certificate private key: -0x%x", -res2); + m_Cert.reset(); + } + } + else + { + LOGWARNING("WebServer: Cannot read HTTPS certificate: -0x%x", -res); + } + } + + // Notify the admin about the HTTPS / HTTP status + if (m_Cert.get() == NULL) + { + LOGWARNING("WebServer: The server is running in unsecure HTTP mode."); + } + else + { + LOGINFO("WebServer: The server is running in secure HTTPS mode."); + } + + // Open up requested ports: bool HasAnyPort; HasAnyPort = m_ListenThreadIPv4.Initialize(a_PortsIPv4); HasAnyPort = m_ListenThreadIPv6.Initialize(a_PortsIPv6) || HasAnyPort; From 616ddf5ca50450279198775a598796bb367cf8ce Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 3 May 2014 06:02:51 -0700 Subject: [PATCH 028/214] cCHunkBuffer that compiles with TestGlobals.h --- src/BiomeDef.h | 2 +- src/ChunkBuffer.h | 7 +++++++ src/StringUtils.h | 3 +++ src/Vector3.h | 2 ++ tests/CMakeLists.txt | 2 ++ tests/ChunkBuffer/CMakeLists.txt | 6 ++++++ tests/ChunkBuffer/creatable.cpp | 7 ++++++- 7 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/BiomeDef.h b/src/BiomeDef.h index 67916890d..f929596e9 100644 --- a/src/BiomeDef.h +++ b/src/BiomeDef.h @@ -10,7 +10,7 @@ #pragma once - +#include "StringUtils.h" // tolua_begin diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index c23f8971d..410532232 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -1,6 +1,13 @@ #pragma once + +#include + + +#include "ChunkDef.h" + + #define CHUNK_SECTION_HEIGHT 16 #define CHUNK_SECTION_NUM (256 / CHUNK_SECTION_HEIGHT) diff --git a/src/StringUtils.h b/src/StringUtils.h index b69e47d3c..347fbe909 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -11,6 +11,9 @@ +#include + + typedef std::string AString; diff --git a/src/Vector3.h b/src/Vector3.h index 2c79f9ff1..53fdcf6df 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -5,6 +5,8 @@ #define _USE_MATH_DEFINES // Enable non-standard math defines (MSVC) #include +#include +#include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c2f9ceb5a..1e3a01dc8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,4 +2,6 @@ cmake_minimum_required (VERSION 2.6) enable_testing() +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + add_subdirectory(ChunkBuffer) diff --git a/tests/ChunkBuffer/CMakeLists.txt b/tests/ChunkBuffer/CMakeLists.txt index 33722f785..08d01d1a0 100644 --- a/tests/ChunkBuffer/CMakeLists.txt +++ b/tests/ChunkBuffer/CMakeLists.txt @@ -2,9 +2,15 @@ cmake_minimum_required (VERSION 2.6) enable_testing() +include_directories(${CMAKE_SOURCE_DIR}/src/) + add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkBuffer.cpp) add_executable(creatable-exe creatable.cpp) target_link_libraries(creatable-exe ChunkBuffer) add_test(NAME creatable-test COMMAND creatable-exe) + +add_executable(coordinates-exe Coordinates.cpp) +target_link_libraries(coordinates-exe ChunkBuffer) +add_test(NAME coordinates-test COMMAND coordinates-exe) diff --git a/tests/ChunkBuffer/creatable.cpp b/tests/ChunkBuffer/creatable.cpp index 573f09de9..49204c879 100644 --- a/tests/ChunkBuffer/creatable.cpp +++ b/tests/ChunkBuffer/creatable.cpp @@ -1,4 +1,9 @@ + +#include "TestGlobals.h" +#include "ChunkBuffer.h" + int main(int argc, char** argv) { -return 0; + cChunkBuffer buffer; + return 0; } From ac1c3ba5d9ee407110700e2c5e9ce1d87e191e29 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 6 May 2014 21:43:31 +0200 Subject: [PATCH 029/214] Fixed an extra space. --- src/HTTPServer/HTTPServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp index b78a538a2..d288c83c9 100644 --- a/src/HTTPServer/HTTPServer.cpp +++ b/src/HTTPServer/HTTPServer.cpp @@ -150,7 +150,7 @@ bool cHTTPServer::Initialize(const AString & a_PortsIPv4, const AString & a_Port { m_Cert.reset(new cX509Cert); int res = m_Cert->Parse(CertFile.data(), CertFile.size()); - if (res == 0) + if (res == 0) { m_CertPrivKey.reset(new cCryptoKey); int res2 = m_CertPrivKey->ParsePrivate(KeyFile.data(), KeyFile.size(), ""); From 45ca5bb857dbe418d59bdfcf9109b5aab2144b59 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 7 May 2014 15:09:25 +0200 Subject: [PATCH 030/214] Fixed cert filename in Linux script. --- MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd | 2 +- MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd index 661cc34e8..3ea6963b4 100644 --- a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd +++ b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd @@ -8,4 +8,4 @@ echo If OpenSSL fails with an error, "WARNING: can't open config file: /usr/loca echo. openssl req -x509 -newkey rsa:2048 -keyout httpskey.pem -out httpscert.crt -days 3650 -nodes -pause \ No newline at end of file +pause diff --git a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh index 0c8594f1a..5cf1237c8 100755 --- a/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh +++ b/MCServer/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh @@ -7,4 +7,4 @@ echo "" echo "When OpenSSL asks you for Common Name, you need to enter the fully qualified domain name of the server, that is, e. g. gallery.xoft.cz" echo "" -openssl req -x509 -newkey rsa:2048 -keyout httpskey.pem -out httpscert.pem -days 3650 -nodes \ No newline at end of file +openssl req -x509 -newkey rsa:2048 -keyout httpskey.pem -out httpscert.crt -days 3650 -nodes From c8631d9a9b924c4c4d030bac3ed4e4a869ec2fd8 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 9 May 2014 23:10:02 +0200 Subject: [PATCH 031/214] Add DIG_STATUS_CANCELLED packet and add item resend, when a block can't place/break. --- src/ClientHandle.cpp | 61 ++++++++++++++++++++++++++++++++------------ src/ClientHandle.h | 3 +++ src/Inventory.cpp | 10 ++++++++ src/Inventory.h | 41 +++++++++++++++-------------- 4 files changed, 79 insertions(+), 36 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 94f031ed6..1535b0482 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -878,6 +878,7 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB case DIG_STATUS_CANCELLED: { // Block breaking cancelled by player + HandleBlockDigCancel(); return; } @@ -916,7 +917,7 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc // It is a duplicate packet, drop it right away return; } - + if ( m_Player->IsGameModeCreative() && ItemCategory::IsSword(m_Player->GetInventory().GetEquippedItem().m_ItemType) @@ -925,14 +926,7 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc // Players can't destroy blocks with a Sword in the hand. return; } - - if (cRoot::Get()->GetPluginManager()->CallHookPlayerBreakingBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_OldBlock, a_OldMeta)) - { - // A plugin doesn't agree with the breaking. Bail out. Send the block back to the client, so that it knows: - m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); - return; - } - + // Set the last digging coords to the block being dug, so that they can be checked in DIG_FINISHED to avoid dig/aim bug in the client: m_HasStartedDigging = true; m_LastDigBlockX = a_BlockX; @@ -1004,16 +998,16 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo return; } - m_HasStartedDigging = false; - if (m_BlockDigAnimStage != -1) - { - // End dig animation - m_BlockDigAnimStage = -1; - // It seems that 10 ends block animation - m_Player->GetWorld()->BroadcastBlockBreakAnimation(m_UniqueID, m_BlockDigAnimX, m_BlockDigAnimY, m_BlockDigAnimZ, 10, this); - } + HandleBlockDigCancel(); cItemHandler * ItemHandler = cItemHandler::GetItemHandler(m_Player->GetEquippedItem()); + + if (cRoot::Get()->GetPluginManager()->CallHookPlayerBreakingBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_OldBlock, a_OldMeta)) + { + // A plugin doesn't agree with the breaking. Bail out. Send the block back to the client, so that it knows: + m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); + return; + } if (a_OldBlock == E_BLOCK_AIR) { @@ -1036,6 +1030,36 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo +void cClientHandle::HandleBlockDigCancel() +{ + if ( + !m_HasStartedDigging || // Hasn't received the DIG_STARTED packet + (m_LastDigBlockX == -1) || + (m_LastDigBlockY == -1) || + (m_LastDigBlockZ == -1) + ) + { + return; + } + + m_HasStartedDigging = false; + if (m_BlockDigAnimStage != -1) + { + // End dig animation + m_BlockDigAnimStage = -1; + // It seems that 10 ends block animation + m_Player->GetWorld()->BroadcastBlockBreakAnimation(m_UniqueID, m_LastDigBlockX, m_LastDigBlockY, m_LastDigBlockZ, 10, this); + } + + m_BlockDigAnimX = -1; + m_BlockDigAnimY = -1; + m_BlockDigAnimZ = -1; +} + + + + + void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, const cItem & a_HeldItem) { LOGD("HandleRightClick: {%d, %d, %d}, face %d, HeldItem: %s", @@ -1058,6 +1082,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); World->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); World->SendBlockTo(a_BlockX, a_BlockY + 1, a_BlockZ, m_Player); //2 block high things + m_Player->GetInventory().SendEquippedSlot(); } return; } @@ -1246,6 +1271,7 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, e { // Handler refused the placement, send that information back to the client: World->SendBlockTo(a_BlockX, a_BlockY, a_BlockY, m_Player); + m_Player->GetInventory().SendEquippedSlot(); return; } @@ -1255,6 +1281,7 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, e { // A plugin doesn't agree with placing the block, revert the block on the client: World->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); + m_Player->GetInventory().SendEquippedSlot(); return; } diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 4dc6ab074..03a716657 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -374,6 +374,9 @@ private: /** Handles the DIG_FINISHED dig packet: */ void HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta); + /** Handles the DIG_CANCELLED dig packet: */ + void HandleBlockDigCancel(); + /** Converts the protocol-formatted channel list (NUL-separated) into a proper string vector. */ AStringVector BreakApartPluginChannels(const AString & a_PluginChannels); diff --git a/src/Inventory.cpp b/src/Inventory.cpp index a365e4ed4..bce882c88 100644 --- a/src/Inventory.cpp +++ b/src/Inventory.cpp @@ -243,6 +243,16 @@ void cInventory::SetHotbarSlot(int a_HotBarSlotNum, const cItem & a_Item) +void cInventory::SendEquippedSlot() +{ + int EquippedSlotNum = cInventory::invArmorCount + cInventory::invInventoryCount + GetEquippedSlotNum(); + SendSlot(EquippedSlotNum); +} + + + + + const cItem & cInventory::GetSlot(int a_SlotNum) const { if ((a_SlotNum < 0) || (a_SlotNum >= invNumSlots)) diff --git a/src/Inventory.h b/src/Inventory.h index 1ad7c4776..39aef1538 100644 --- a/src/Inventory.h +++ b/src/Inventory.h @@ -56,13 +56,13 @@ public: // tolua_begin - /// Removes all items from the entire inventory + /** Removes all items from the entire inventory */ void Clear(void); - /// Returns number of items out of a_ItemStack that can fit in the storage + /** Returns number of items out of a_ItemStack that can fit in the storage */ int HowManyCanFit(const cItem & a_ItemStack, bool a_ConsiderEmptySlots); - /// Returns how many items of the specified type would fit into the slot range specified + /** Returns how many items of the specified type would fit into the slot range specified */ int HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int a_EndSlotNum, bool a_ConsiderEmptySlots); /** Adds as many items out of a_ItemStack as can fit. @@ -86,33 +86,36 @@ public: */ int AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst); - /// Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed + /** Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed */ bool RemoveOneEquippedItem(void); - /// Returns the number of items of type a_Item that are stored + /** Returns the number of items of type a_Item that are stored */ int HowManyItems(const cItem & a_Item); - /// Returns true if there are at least as many items of type a_ItemStack as in a_ItemStack + /** Returns true if there are at least as many items of type a_ItemStack as in a_ItemStack */ bool HasItems(const cItem & a_ItemStack); + + /** Sends the equipped item slot to the client */ + void SendEquippedSlot(); - /// Returns the cItemGrid object representing the armor slots + /** Returns the cItemGrid object representing the armor slots */ cItemGrid & GetArmorGrid(void) { return m_ArmorSlots; } - /// Returns the cItemGrid object representing the main inventory slots + /** Returns the cItemGrid object representing the main inventory slots */ cItemGrid & GetInventoryGrid(void) { return m_InventorySlots; } - /// Returns the cItemGrid object representing the hotbar slots + /** Returns the cItemGrid object representing the hotbar slots */ cItemGrid & GetHotbarGrid(void) { return m_HotbarSlots; } - /// Returns the player associated with this inventory + /** Returns the player associated with this inventory */ cPlayer & GetOwner(void) { return m_Owner; } - /// Copies the non-empty slots into a_ItemStacks; preserves the original a_Items contents + /** Copies the non-empty slots into a_ItemStacks; preserves the original a_Items contents */ void CopyToItems(cItems & a_Items); // tolua_end - /// Returns the player associated with this inventory (const version) + /** Returns the player associated with this inventory (const version) */ const cPlayer & GetOwner(void) const { return m_Owner; } // tolua_begin @@ -136,10 +139,10 @@ public: */ int ChangeSlotCount(int a_SlotNum, int a_AddToCount); - /// Adds the specified damage to the specified item; deletes the item and returns true if the item broke. + /** Adds the specified damage to the specified item; deletes the item and returns true if the item broke. */ bool DamageItem(int a_SlotNum, short a_Amount); - /// Adds the specified damage to the currently held item; deletes the item and returns true if the item broke. + /** Adds the specified damage to the currently held item; deletes the item and returns true if the item broke. */ bool DamageEquippedItem(short a_Amount = 1); const cItem & GetEquippedHelmet (void) const { return m_ArmorSlots.GetSlot(0); } @@ -149,13 +152,13 @@ public: // tolua_end - /// Sends the slot contents to the owner + /** Sends the slot contents to the owner */ void SendSlot(int a_SlotNum); - /// Update items (e.g. Maps) + /** Update items (e.g. Maps) */ void UpdateItems(void); - /// Converts an armor slot number into the ID for the EntityEquipment packet + /** Converts an armor slot number into the ID for the EntityEquipment packet */ static int ArmorSlotNumToEntityEquipmentID(short a_ArmorSlotNum); void SaveToJson(Json::Value & a_Value); @@ -172,10 +175,10 @@ protected: cPlayer & m_Owner; - /// Returns the ItemGrid and the (grid-local) slot number for a (global) slot number; return NULL for invalid SlotNum + /** Returns the ItemGrid and the (grid-local) slot number for a (global) slot number; return NULL for invalid SlotNum */ const cItemGrid * GetGridForSlotNum(int a_SlotNum, int & a_GridSlotNum) const; - /// Returns the ItemGrid and the (grid-local) slot number for a (global) slot number; return NULL for invalid SlotNum + /** Returns the ItemGrid and the (grid-local) slot number for a (global) slot number; return NULL for invalid SlotNum */ cItemGrid * GetGridForSlotNum(int a_SlotNum, int & a_GridSlotNum); // cItemGrid::cListener override: From eb0f713b6a5a7107a97284d1728858b4b2882c3d Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 9 May 2014 23:43:00 +0200 Subject: [PATCH 032/214] Add block place/break distance check. --- src/ClientHandle.cpp | 21 +++++++++++++++++++++ src/Defines.h | 10 ++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 1535b0482..d1962506d 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1016,6 +1016,17 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo } cWorld * World = m_Player->GetWorld(); + + if ( + (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || + (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || + (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) + ) + { + m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); + return; + } + ItemHandler->OnBlockDestroyed(World, m_Player, m_Player->GetEquippedItem(), a_BlockX, a_BlockY, a_BlockZ); // The ItemHandler is also responsible for spawning the pickups cChunkInterface ChunkInterface(World->GetChunkMap()); @@ -1191,6 +1202,16 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, e // The block is being placed outside the world, ignore this packet altogether (#128) return; } + + if ( + (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || + (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || + (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) + ) + { + m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); + return; + } World->GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, ClickedBlock, ClickedBlockMeta); diff --git a/src/Defines.h b/src/Defines.h index 9fa3b3a8e..b0b209934 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -3,6 +3,7 @@ #include "ChatColor.h" #include +#include @@ -528,6 +529,15 @@ inline float GetSpecialSignf( float a_Val ) +template inline int Diff(T a_Val1, T a_Val2) +{ + return std::abs(a_Val1 - a_Val2); +} + + + + + // tolua_begin enum eMessageType From 683b839e2b3e634dd1a0a5b85327efe4ffa968fd Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sat, 10 May 2014 09:21:29 +0200 Subject: [PATCH 033/214] Client cert is not requested. --- src/PolarSSL++/SslContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PolarSSL++/SslContext.cpp b/src/PolarSSL++/SslContext.cpp index bc397b655..c3074f197 100644 --- a/src/PolarSSL++/SslContext.cpp +++ b/src/PolarSSL++/SslContext.cpp @@ -59,7 +59,7 @@ int cSslContext::Initialize(bool a_IsClient, const SharedPtr & return res; } ssl_set_endpoint(&m_Ssl, a_IsClient ? SSL_IS_CLIENT : SSL_IS_SERVER); - ssl_set_authmode(&m_Ssl, SSL_VERIFY_OPTIONAL); + ssl_set_authmode(&m_Ssl, a_IsClient ? SSL_VERIFY_OPTIONAL : SSL_VERIFY_NONE); // Clients ask for server's cert but don't verify strictly; servers don't ask clients for certs by default ssl_set_rng(&m_Ssl, ctr_drbg_random, &m_CtrDrbg->m_CtrDrbg); ssl_set_bio(&m_Ssl, ReceiveEncrypted, this, SendEncrypted, this); From 77395b37390ecf23218659925c61e0a9b44d8476 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 05:03:36 -0700 Subject: [PATCH 034/214] Maybe coverage working? --- .travis.yml | 14 ++- CIbuild.sh | 6 + CMakeLists.txt | 4 + SetFlags.cmake | 79 +++++++------ lib/cmake-coverage/CodeCoverage.cmake | 160 ++++++++++++++++++++++++++ lib/cmake-coverage/LICENSE | 23 ++++ tests/ChunkBuffer/Coordinates.cpp | 15 +++ tests/TestGlobals.h | 136 ++++++++++++++++++++++ uploadCoverage.sh | 5 + 9 files changed, 409 insertions(+), 33 deletions(-) create mode 100644 CIbuild.sh create mode 100644 lib/cmake-coverage/CodeCoverage.cmake create mode 100644 lib/cmake-coverage/LICENSE create mode 100644 tests/ChunkBuffer/Coordinates.cpp create mode 100644 tests/TestGlobals.h create mode 100644 uploadCoverage.sh diff --git a/.travis.yml b/.travis.yml index 0ab25ae3b..3bf2acc43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,15 @@ language: cpp compiler: - gcc - clang + +before_install: + - if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"] then sudo pip install cpp_coveralls fi + # Build MCServer -script: cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1 && make -j 2 && cd MCServer/ && (echo stop | $MCSERVER_PATH) +script: CIbuild.sh + +after_success: + - uploadCoverage.sh env: - TRAVIS_MCSERVER_BUILD_TYPE=RELEASE MCSERVER_PATH=./MCServer @@ -11,6 +18,11 @@ env: - TRAVIS_MCSERVER_BUILD_TYPE=RELEASE TRAVIS_MCSERVER_FORCE32=1 MCSERVER_PATH=./MCServer - TRAVIS_MCSERVER_BUILD_TYPE=DEBUG TRAVIS_MCSERVER_FORCE32=1 MCSERVER_PATH=./MCServer_debug +matrix: + include: + - compiler: gcc + env: TRAVIS_MCSERVER_BUILD_TYPE=COVERAGE MCSERVER_PATH=./MCServer_debug + # Notification Settings notifications: email: diff --git a/CIbuild.sh b/CIbuild.sh new file mode 100644 index 000000000..0c00a351f --- /dev/null +++ b/CIbuild.sh @@ -0,0 +1,6 @@ + #!/usr/bin/env bash + +cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1; +make -j 2; +cd MCServer/; +echo stop | gcov $MCSERVER_PATH; diff --git a/CMakeLists.txt b/CMakeLists.txt index 45fc8c37a..56dea1a34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,10 @@ if(DEFINED ENV{TRAVIS_MCSERVER_FORCE32}) set(FORCE32 $ENV{TRAVIS_MCSERVER_FORCE32}) endif() +if(DEFINED ENV{TRAVIS_BUILD_WITH_COVERAGE}) + set(BUILD_WITH_COVERAGE $ENV{TRAVIS_BUILD_WITH_COVERAGE}) +endif() + # This has to be done before any flags have been set up. if(${BUILD_TOOLS}) add_subdirectory(Tools/MCADefrag/) diff --git a/SetFlags.cmake b/SetFlags.cmake index 4eed529bd..c4713e2d2 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -1,32 +1,41 @@ macro (add_flags_lnk FLAGS) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAGS}") - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FLAGS}") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${FLAGS}") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FLAGS}") - set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${FLAGS}") - set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_COVERAGE} ${FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_COVERAGE} ${FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS_COVERAGE "${CMAKE_MODULE_LINKER_FLAGS_COVERAGE} ${FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${FLAGS}") endmacro() macro(add_flags_cxx FLAGS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAGS}") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAGS}") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAGS}") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAGS}") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAGS}") + set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} ${FLAGS}") + set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_COVERAGE} ${FLAGS}") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAGS}") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${FLAGS}") endmacro() macro(set_flags) # Add the preprocessor macros used for distinguishing between debug and release builds (CMake does this automatically for MSVC): if (NOT MSVC) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/") + include(CodeCoverage) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") + set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -D_DEBUG") + set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_COVERAGE} -D_DEBUG") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG") endif() if(MSVC) @@ -42,9 +51,10 @@ macro(set_flags) elseif(APPLE) #on os x clang adds pthread for us but we need to add it for gcc if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") + set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -std=c++11") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") add_flags_cxx("-stdlib=libc++") add_flags_lnk("-stdlib=libc++") else() @@ -57,6 +67,7 @@ macro(set_flags) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") + set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -std=c++11") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") endif() @@ -97,10 +108,12 @@ macro(set_lib_flags) string(REPLACE "/W3" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") string(REPLACE "/W3" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") else() - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -w") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -w") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -w") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -w") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -w") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -w") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -w") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -w") + set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -w") + set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_COVERAGE} -w") endif() # On Unix we use two dynamic loading libraries dl and ltdl. @@ -128,7 +141,7 @@ macro(enable_profile) # Declare the profiling configurations: SET(CMAKE_CXX_FLAGS_DEBUGPROFILE - "${CMAKE_CXX_FLAGS_DEBUG} ${PCXX_ROFILING}" + "${CMAKE_CXX_FLAGS_DEBUG} ${CXX_PROFILING}" CACHE STRING "Flags used by the C++ compiler during profile builds." FORCE ) SET(CMAKE_C_FLAGS_DEBUGPROFILE @@ -171,7 +184,7 @@ macro(enable_profile) CMAKE_EXE_LINKER_FLAGS_RELEASEPROFILE CMAKE_SHARED_LINKER_FLAGS_RELEASEPROFILE ) # The configuration types need to be set after their respective c/cxx/linker flags and before the project directive - set(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugProfile;ReleaseProfile" CACHE STRING "" FORCE) + set(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugProfile;ReleaseProfile;Coverage" CACHE STRING "" FORCE) endmacro() macro(set_exe_flags) @@ -180,10 +193,12 @@ macro(set_exe_flags) # We do not do that for MSVC since MSVC produces an awful lot of warnings for its own STL headers; # the important warnings are turned on using #pragma in Globals.h if (NOT MSVC) - string(REPLACE "-w" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") - string(REPLACE "-w" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") - string(REPLACE "-w" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") - string(REPLACE "-w" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + string(REPLACE "-w" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "-w" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") + string(REPLACE "-w" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "-w" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + string(REPLACE "-w" "" CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE}") + string(REPLACE "-w" "" CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_COVERAGE}") add_flags_cxx("-Wall -Wextra -Wno-unused-parameter -Wno-error=switch") # we support non-IEEE 754 fpus so can make no guarentees about error diff --git a/lib/cmake-coverage/CodeCoverage.cmake b/lib/cmake-coverage/CodeCoverage.cmake new file mode 100644 index 000000000..edf927fec --- /dev/null +++ b/lib/cmake-coverage/CodeCoverage.cmake @@ -0,0 +1,160 @@ +# +# 2012-01-31, Lars Bilke +# - Enable Code Coverage +# +# 2013-09-17, Joakim Söderberg +# - Added support for Clang. +# - Some additional usage instructions. +# +# USAGE: +# 1. Copy this file into your cmake modules path. +# +# 2. Add the following line to your CMakeLists.txt: +# INCLUDE(CodeCoverage) +# +# 3. Set compiler flags to turn off optimization and enable coverage: +# SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") +# SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") +# +# 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target +# which runs your test executable and produces a lcov code coverage report: +# Example: +# SETUP_TARGET_FOR_COVERAGE( +# my_coverage_target # Name for custom target. +# test_driver # Name of the test driver executable that runs the tests. +# # NOTE! This should always have a ZERO as exit code +# # otherwise the coverage generation will not complete. +# coverage # Name of output directory. +# ) +# +# 4. Build a Debug build: +# cmake -DCMAKE_BUILD_TYPE=Debug .. +# make +# make my_coverage_target +# +# + +# Check prereqs +FIND_PROGRAM( GCOV_PATH gcov ) +FIND_PROGRAM( LCOV_PATH lcov ) +FIND_PROGRAM( GENHTML_PATH genhtml ) +FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests) + +IF(NOT GCOV_PATH) +MESSAGE(FATAL_ERROR "gcov not found! Aborting...") +ENDIF() # NOT GCOV_PATH + +IF(NOT CMAKE_COMPILER_IS_GNUCXX) +# Clang version 3.0.0 and greater now supports gcov as well. +MESSAGE(WARNING "Compiler is not GNU gcc! Clang Version 3.0.0 and greater supports gcov as well, but older versions don't.") + +IF(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...") +ENDIF() +ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX + +SET(CMAKE_CXX_FLAGS_COVERAGE + "-g -O0 --coverage -fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the C++ compiler during coverage builds." + FORCE ) +SET(CMAKE_C_FLAGS_COVERAGE + "-g -O0 --coverage -fprofile-arcs -ftest-coverage" + CACHE STRING "Flags used by the C compiler during coverage builds." + FORCE ) +SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE + "" + CACHE STRING "Flags used for linking binaries during coverage builds." + FORCE ) +SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE + "" + CACHE STRING "Flags used by the shared libraries linker during coverage builds." + FORCE ) +MARK_AS_ADVANCED( + CMAKE_CXX_FLAGS_COVERAGE + CMAKE_C_FLAGS_COVERAGE + CMAKE_EXE_LINKER_FLAGS_COVERAGE + CMAKE_SHARED_LINKER_FLAGS_COVERAGE ) + +IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage")) + MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" ) +ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug" + + +# Param _targetname The name of new the custom make target +# Param _testrunner The name of the target which runs the tests. +# MUST return ZERO always, even on errors. +# If not, no coverage report will be created! +# Param _outputname lcov output is generated as _outputname.info +# HTML report is generated in _outputname/index.html +# Optional fourth parameter is passed as arguments to _testrunner +# Pass them in list form, e.g.: "-j;2" for -j 2 +FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname) + +IF(NOT LCOV_PATH) +MESSAGE(FATAL_ERROR "lcov not found! Aborting...") +ENDIF() # NOT LCOV_PATH + +IF(NOT GENHTML_PATH) +MESSAGE(FATAL_ERROR "genhtml not found! Aborting...") +ENDIF() # NOT GENHTML_PATH + +# Setup target +ADD_CUSTOM_TARGET(${_targetname} + +# Cleanup lcov +${LCOV_PATH} --directory . --zerocounters + +# Run tests +COMMAND ${_testrunner} ${ARGV3} + +# Capturing lcov counters and generating report +COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info +COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned +COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned +COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned + +WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report." +) + +# Show info where to find the report +ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD +COMMAND ; +COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report." +) + +ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE + +# Param _targetname The name of new the custom make target +# Param _testrunner The name of the target which runs the tests +# Param _outputname cobertura output is generated as _outputname.xml +# Optional fourth parameter is passed as arguments to _testrunner +# Pass them in list form, e.g.: "-j;2" for -j 2 +FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname) + +IF(NOT PYTHON_EXECUTABLE) +MESSAGE(FATAL_ERROR "Python not found! Aborting...") +ENDIF() # NOT PYTHON_EXECUTABLE + +IF(NOT GCOVR_PATH) +MESSAGE(FATAL_ERROR "gcovr not found! Aborting...") +ENDIF() # NOT GCOVR_PATH + +ADD_CUSTOM_TARGET(${_targetname} + +# Run tests +${_testrunner} ${ARGV3} + +# Running gcovr +COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -o ${_outputname}.xml +WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +COMMENT "Running gcovr to produce Cobertura code coverage report." +) + +# Show info where to find the report +ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD +COMMAND ; +COMMENT "Cobertura code coverage report saved in ${_outputname}.xml." +) + +ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE_COBERTURA diff --git a/lib/cmake-coverage/LICENSE b/lib/cmake-coverage/LICENSE new file mode 100644 index 000000000..36b7cd93c --- /dev/null +++ b/lib/cmake-coverage/LICENSE @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/tests/ChunkBuffer/Coordinates.cpp b/tests/ChunkBuffer/Coordinates.cpp new file mode 100644 index 000000000..d61eda7ad --- /dev/null +++ b/tests/ChunkBuffer/Coordinates.cpp @@ -0,0 +1,15 @@ + +#include "TestGlobals.h" +#include "ChunkBuffer.h" + + + +int main(int argc, char** argv) +{ + cChunkBuffer buffer; + buffer.SetBlock(0,0,0, 0xAB); + assert(buffer.GetBlock(0,0,0) == 0xAB); + buffer.SetMeta(0,16,0, 0xC); + assert(buffer.GetMeta(0,16,0) == 0xC); + return 0; +} diff --git a/tests/TestGlobals.h b/tests/TestGlobals.h new file mode 100644 index 000000000..cb8fc9376 --- /dev/null +++ b/tests/TestGlobals.h @@ -0,0 +1,136 @@ + + +#include +#include +#include + + +// Compiler-dependent stuff: +#if defined(_MSC_VER) + // MSVC produces warning C4481 on the override keyword usage, so disable the warning altogether + #pragma warning(disable:4481) + + // Disable some warnings that we don't care about: + #pragma warning(disable:4100) // Unreferenced formal parameter + + // Useful warnings from warning level 4: + #pragma warning(3 : 4127) // Conditional expression is constant + #pragma warning(3 : 4189) // Local variable is initialized but not referenced + #pragma warning(3 : 4245) // Conversion from 'type1' to 'type2', signed/unsigned mismatch + #pragma warning(3 : 4310) // Cast truncates constant value + #pragma warning(3 : 4389) // Signed/unsigned mismatch + #pragma warning(3 : 4505) // Unreferenced local function has been removed + #pragma warning(3 : 4701) // Potentially unitialized local variable used + #pragma warning(3 : 4702) // Unreachable code + #pragma warning(3 : 4706) // Assignment within conditional expression + + // Disabling this warning, because we know what we're doing when we're doing this: + #pragma warning(disable: 4355) // 'this' used in initializer list + + // Disabled because it's useless: + #pragma warning(disable: 4512) // 'class': assignment operator could not be generated - reported for each class that has a reference-type member + + // 2014_01_06 xoft: Disabled this warning because MSVC is stupid and reports it in obviously wrong places + // #pragma warning(3 : 4244) // Conversion from 'type1' to 'type2', possible loss of data + + #define OBSOLETE __declspec(deprecated) + + // No alignment needed in MSVC + #define ALIGN_8 + #define ALIGN_16 + + #define FORMATSTRING(formatIndex, va_argsIndex) + + // MSVC has its own custom version of zu format + #define SIZE_T_FMT "%Iu" + #define SIZE_T_FMT_PRECISION(x) "%" #x "Iu" + #define SIZE_T_FMT_HEX "%Ix" + + #define NORETURN __declspec(noreturn) + +#elif defined(__GNUC__) + + // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? + #define abstract + + // override is part of c++11 + #if __cplusplus < 201103L + #define override + #endif + + #define OBSOLETE __attribute__((deprecated)) + + #define ALIGN_8 __attribute__((aligned(8))) + #define ALIGN_16 __attribute__((aligned(16))) + + // Some portability macros :) + #define stricmp strcasecmp + + #define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex))) + + #define SIZE_T_FMT "%zu" + #define SIZE_T_FMT_PRECISION(x) "%" #x "zu" + #define SIZE_T_FMT_HEX "%zx" + + #define NORETURN __attribute((__noreturn__)) + +#else + + #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" + + /* + // Copy and uncomment this into another #elif section based on your compiler identification + + // Explicitly mark classes as abstract (no instances can be created) + #define abstract + + // Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class) + #define override + + // Mark functions as obsolete, so that their usage results in a compile-time warning + #define OBSOLETE + + // Mark types / variables for alignment. Do the platforms need it? + #define ALIGN_8 + #define ALIGN_16 + */ + +#endif + + + +// Integral types with predefined sizes: +typedef long long Int64; +typedef int Int32; +typedef short Int16; + +typedef unsigned long long UInt64; +typedef unsigned int UInt32; +typedef unsigned short UInt16; + +typedef unsigned char Byte; + + + +#define ASSERT(x) assert(x) + + +#ifndef TOLUA_TEMPLATE_BIND +#define TOLUA_TEMPLATE_BIND(x) +#endif + +// A macro that is used to mark unused function parameters, to avoid pedantic warnings in gcc +#define UNUSED(X) (void)(X) + +// Logging functions +void LOGERROR(const char* a_Format, ...) FORMATSTRING(1,2); + +void LOGERROR(const char* a_Format, ...) +{ + va_list argList; + va_start(argList, a_Format); + vprintf(a_Format, argList); + va_end(argList); +} + + diff --git a/uploadCoverage.sh b/uploadCoverage.sh new file mode 100644 index 000000000..0897479ae --- /dev/null +++ b/uploadCoverage.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"] then + coveralls --exclude lib --exclude tests +fi From 604ed439a8a67f16f8af75a31630b2c5b3ece7f1 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:09:47 +0100 Subject: [PATCH 035/214] Fix bash ifs --- .travis.yml | 2 +- MCServer/Plugins/Core | 2 +- uploadCoverage.sh | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3bf2acc43..1adc0c8ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ compiler: - clang before_install: - - if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"] then sudo pip install cpp_coveralls fi + - if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"]; then sudo pip install cpp_coveralls; fi # Build MCServer script: CIbuild.sh diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core index 5c8557d4f..013a32a7f 160000 --- a/MCServer/Plugins/Core +++ b/MCServer/Plugins/Core @@ -1 +1 @@ -Subproject commit 5c8557d4fdfa580c100510cde07a1a778ea2e244 +Subproject commit 013a32a7fb3c8a6cfe0aef892d4c7394d4e1be59 diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 0897479ae..3a566d990 100644 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash -if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"] then - coveralls --exclude lib --exclude tests +if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"] + then + coveralls --exclude lib --exclude tests fi From b66b1e5b1072fa141f04a7ae7eeaab0099ff09eb Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:12:01 +0100 Subject: [PATCH 036/214] Fixed paths --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1adc0c8ef..2d0c0a337 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,10 +7,10 @@ before_install: - if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"]; then sudo pip install cpp_coveralls; fi # Build MCServer -script: CIbuild.sh +script: ./CIbuild.sh after_success: - - uploadCoverage.sh + - ./uploadCoverage.sh env: - TRAVIS_MCSERVER_BUILD_TYPE=RELEASE MCSERVER_PATH=./MCServer From 5be9bac448e05bd5f352ec6df2604ee7631d5e33 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:12:57 +0100 Subject: [PATCH 037/214] Fixed missing Dollar signs --- .travis.yml | 2 +- uploadCoverage.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d0c0a337..0da5487f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ compiler: - clang before_install: - - if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"]; then sudo pip install cpp_coveralls; fi + - if [$TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"]; then sudo pip install cpp_coveralls; fi # Build MCServer script: ./CIbuild.sh diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 3a566d990..6ea5e481a 100644 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"] +if [$TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"] then coveralls --exclude lib --exclude tests fi From cebbb8abd01f26a9f9e998882506890ed7560bdc Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:14:32 +0100 Subject: [PATCH 038/214] Make scripts executable --- CIbuild.sh | 0 uploadCoverage.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 CIbuild.sh mode change 100644 => 100755 uploadCoverage.sh diff --git a/CIbuild.sh b/CIbuild.sh old mode 100644 new mode 100755 diff --git a/uploadCoverage.sh b/uploadCoverage.sh old mode 100644 new mode 100755 From 6e6d7c1159608c7e068f60aafca945473829bf68 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:17:09 +0100 Subject: [PATCH 039/214] Fix spaces in bash --- .travis.yml | 2 +- uploadCoverage.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0da5487f7..b7dc01d9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ compiler: - clang before_install: - - if [$TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"]; then sudo pip install cpp_coveralls; fi + - if [ $TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE" ]; then sudo pip install cpp_coveralls; fi # Build MCServer script: ./CIbuild.sh diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 6ea5e481a..177401de3 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [$TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE"] +if [ $TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE" ] then coveralls --exclude lib --exclude tests fi From 189c7529e974065918476a5ac60d0318606c7c5f Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:18:40 +0100 Subject: [PATCH 040/214] Add qutes to scripts --- .travis.yml | 2 +- uploadCoverage.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7dc01d9c..73d7eb557 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ compiler: - clang before_install: - - if [ $TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE" ]; then sudo pip install cpp_coveralls; fi + - if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ]; then sudo pip install cpp_coveralls; fi # Build MCServer script: ./CIbuild.sh diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 177401de3..193e670dc 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [ $TRAVIS_MCSERVER_BUILD_TYPE == "COVERAGE" ] +if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then coveralls --exclude lib --exclude tests fi From 740aed3aefb48007233e0c31e28b349c74178180 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:46:05 +0100 Subject: [PATCH 041/214] Relocate gcda files so gcov can find them --- CIbuild.sh | 1 + uploadCoverage.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CIbuild.sh b/CIbuild.sh index 0c00a351f..4d8b313a5 100755 --- a/CIbuild.sh +++ b/CIbuild.sh @@ -2,5 +2,6 @@ cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1; make -j 2; +make -j 2 test; cd MCServer/; echo stop | gcov $MCSERVER_PATH; diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 193e670dc..6bc75f779 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -2,5 +2,8 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then + find tests -type f -name '*.gcda' -exec 'cp {} $(dirname {})/../$(basename {})' coveralls --exclude lib --exclude tests fi + + From 79570552b94c9777244a91efe3f528ff437951d7 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:57:46 +0100 Subject: [PATCH 042/214] Relocate gcda files so gcov can find them take 2 --- uploadCoverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 6bc75f779..f3f9eae1a 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -2,8 +2,8 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then - find tests -type f -name '*.gcda' -exec 'cp {} $(dirname {})/../$(basename {})' - coveralls --exclude lib --exclude tests + find tests -type f -name '*.gcda' -exec cp {} $(dirname {})/../$(basename {}) + coveralls --exclude lib --exclude tests > fi From 9e17adc8454c444628c89d4e4782a4e8337295da Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 13:59:34 +0100 Subject: [PATCH 043/214] quieted gcov --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index f3f9eae1a..ad3ea070e 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec cp {} $(dirname {})/../$(basename {}) - coveralls --exclude lib --exclude tests > + coveralls --exclude lib --exclude tests --gcov-options -q fi From 5b23bc53cc200b5fe9592c3c5f6fda1622e99b54 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 14:05:39 +0100 Subject: [PATCH 044/214] rewrote exclustions --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index ad3ea070e..b76b9d8e6 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec cp {} $(dirname {})/../$(basename {}) - coveralls --exclude lib --exclude tests --gcov-options -q + coveralls --exclude lib --exclude Android --gcov-options -q fi From 149793da05d67f710e0c5994f464dc7d4b2bb0e2 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 14:11:35 +0100 Subject: [PATCH 045/214] Relocate gcda files so gcov can find them 3 --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index b76b9d8e6..3c50dc2f5 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -2,7 +2,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then - find tests -type f -name '*.gcda' -exec cp {} $(dirname {})/../$(basename {}) + find tests -type f -name '*.gcda' -exec sh -c 'cp {} $(dirname {})/../$(basename {})' \; coveralls --exclude lib --exclude Android --gcov-options -q fi From 3b8f28aa49e53af8c5832a6975fea85ede583a35 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 14:13:25 +0100 Subject: [PATCH 046/214] quieted gcov 2 --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 3c50dc2f5..f9b396a8c 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec sh -c 'cp {} $(dirname {})/../$(basename {})' \; - coveralls --exclude lib --exclude Android --gcov-options -q + coveralls --exclude lib --exclude Android --gcov-options q fi From 90f91ae97748ebc6044c50fb7826eea098ae7a2f Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 14:34:08 +0100 Subject: [PATCH 047/214] quieted gcov 3 --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index f9b396a8c..7eb1d9983 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec sh -c 'cp {} $(dirname {})/../$(basename {})' \; - coveralls --exclude lib --exclude Android --gcov-options q + coveralls --exclude lib --exclude Android --gcov-options ' -q' fi From 83a7b2333f8cf226ace35c09fa68a6a0f8009434 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 14:44:20 +0100 Subject: [PATCH 048/214] quieted gcov 4 --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 7eb1d9983..fc17ddc2c 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec sh -c 'cp {} $(dirname {})/../$(basename {})' \; - coveralls --exclude lib --exclude Android --gcov-options ' -q' + coveralls --exclude lib --exclude Android >/dev/null fi From cb6200345cdfcf34ab4cd6b50cc268152324f9dd Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 15:19:06 +0100 Subject: [PATCH 049/214] Fixed bug in setting metas --- src/Chunk.cpp | 18 ------------------ src/Chunk.h | 8 +++++++- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 0303e1502..a986ac076 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1568,24 +1568,6 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT -void cChunk::SetMeta(int a_BlockIdx, NIBBLETYPE a_Meta) -{ - if (GetNibble(m_BlockMeta, a_BlockIdx) == a_Meta) - { - return; - } - - MarkDirty(); - SetNibble(m_BlockMeta, a_BlockIdx, a_Meta); - Vector3i Coords(IndexToCoordinate(a_BlockIdx)); - - m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, Coords.x, Coords.y, Coords.z, GetBlock(a_BlockIdx), a_Meta)); -} - - - - - void cChunk::SendBlockTo(int a_RelX, int a_RelY, int a_RelZ, cClientHandle * a_Client) { diff --git a/src/Chunk.h b/src/Chunk.h index d2328971f..26f1e9d10 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -328,7 +328,13 @@ public: } inline void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta) { - m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); + if (!GetMeta(a_RelX, a_RelY, a_RelZ) == a_Meta) + { + MarkDirty(); + m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); + + m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, GetBlock(a_RelX, a_RelY, a_RelZ), a_Meta)); + } } inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkBuffer.GetBlockLight(a_RelX, a_RelY, a_RelZ); } From 0940747f3b5dea69bf0d32cb4657b69f3a03d0dd Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 15:30:48 +0100 Subject: [PATCH 050/214] Added some more tests --- tests/ChunkBuffer/Coordinates.cpp | 95 ++++++++++++++++++++++++++++++- tests/TestGlobals.h | 11 ++-- 2 files changed, 100 insertions(+), 6 deletions(-) diff --git a/tests/ChunkBuffer/Coordinates.cpp b/tests/ChunkBuffer/Coordinates.cpp index d61eda7ad..a6a8aa18f 100644 --- a/tests/ChunkBuffer/Coordinates.cpp +++ b/tests/ChunkBuffer/Coordinates.cpp @@ -7,9 +7,100 @@ int main(int argc, char** argv) { cChunkBuffer buffer; + + // Empty chunks buffer.SetBlock(0,0,0, 0xAB); - assert(buffer.GetBlock(0,0,0) == 0xAB); + testassert(buffer.GetBlock(0,0,0) == 0xAB); buffer.SetMeta(0,16,0, 0xC); - assert(buffer.GetMeta(0,16,0) == 0xC); + testassert(buffer.GetMeta(0,16,0) == 0xC); + + // loaded but not written segments + testassert(buffer.GetBlock(1,0,0) == 0x0); + testassert(buffer.GetMeta(1,16,0) == 0x0); + + // Notloaded segments + testassert(buffer.GetBlock(0,32,0) == 0x0); + testassert(buffer.GetMeta(0,48,0) == 0x0); + + // Out of Range + CheckAsserts( + buffer.SetBlock(-1, 0, 0, 0); + ); + CheckAsserts( + buffer.SetBlock(0, -1, 0, 0); + ); + CheckAsserts( + buffer.SetBlock(0, 0, -1, 0); + ); + CheckAsserts( + buffer.SetBlock(256, 0, 0, 0); + ); + CheckAsserts( + buffer.SetBlock(0, 256, 0, 0); + ); + CheckAsserts( + buffer.SetBlock(0, 0, 256, 0); + ); + + // Out of Range + CheckAsserts( + buffer.GetBlock(-1, 0, 0); + ); + CheckAsserts( + buffer.GetBlock(0, -1, 0); + ); + CheckAsserts( + buffer.GetBlock(0, 0, -1); + ); + CheckAsserts( + buffer.GetBlock(256, 0, 0); + ); + CheckAsserts( + buffer.GetBlock(0, 256, 0); + ); + CheckAsserts( + buffer.GetBlock(0, 0, 256); + ); + + // Out of Range + CheckAsserts( + buffer.SetMeta(-1, 0, 0, 0); + ); + CheckAsserts( + buffer.SetMeta(0, -1, 0, 0); + ); + CheckAsserts( + buffer.SetMeta(0, 0, -1, 0); + ); + CheckAsserts( + buffer.SetMeta(256, 0, 0, 0); + ); + CheckAsserts( + buffer.SetMeta(0, 256, 0, 0); + ); + CheckAsserts( + buffer.SetMeta(0, 0, 256, 0); + ); + + // Out of Range + CheckAsserts( + buffer.GetMeta(-1, 0, 0); + ); + CheckAsserts( + buffer.GetMeta(0, -1, 0); + ); + CheckAsserts( + buffer.GetMeta(0, 0, -1); + ); + CheckAsserts( + buffer.GetMeta(256, 0, 0); + ); + CheckAsserts( + buffer.GetMeta(0, 256, 0); + ); + CheckAsserts( + buffer.GetMeta(0, 0, 256); + ); + return 0; } diff --git a/tests/TestGlobals.h b/tests/TestGlobals.h index cb8fc9376..bb25bd20a 100644 --- a/tests/TestGlobals.h +++ b/tests/TestGlobals.h @@ -1,8 +1,8 @@ -#include #include #include +#include // Compiler-dependent stuff: @@ -110,10 +110,13 @@ typedef unsigned short UInt16; typedef unsigned char Byte; +class cAssertFailure +{ +}; - -#define ASSERT(x) assert(x) - +#define ASSERT(x) do { if (!(x)) { throw cAssertFailure();} } while (0) +#define testassert(x) do { if(!(x)) { exit(1); } } while (0) +#define CheckAsserts(x) do { try {x} catch (cAssertFailure) { break; } exit(1); } while (0) #ifndef TOLUA_TEMPLATE_BIND #define TOLUA_TEMPLATE_BIND(x) From 29d5f8eb0a728d9224ace739c1787f25aac82e0a Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 16:08:08 +0100 Subject: [PATCH 051/214] Added new test --- tests/ChunkBuffer/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ChunkBuffer/CMakeLists.txt b/tests/ChunkBuffer/CMakeLists.txt index 08d01d1a0..73dc79e25 100644 --- a/tests/ChunkBuffer/CMakeLists.txt +++ b/tests/ChunkBuffer/CMakeLists.txt @@ -14,3 +14,7 @@ add_test(NAME creatable-test COMMAND creatable-exe) add_executable(coordinates-exe Coordinates.cpp) target_link_libraries(coordinates-exe ChunkBuffer) add_test(NAME coordinates-test COMMAND coordinates-exe) + +add_executable(copies-exe Copies.cpp) +target_link_libraries(copies-exe ChunkBuffer) +add_test(NAME copies-test COMMAND copies-exe) From ba25f6b5244f37a3b79a496e8bc65447fc9bd2e4 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 16:15:45 +0100 Subject: [PATCH 052/214] Add arries copies tests --- tests/ChunkBuffer/Copies.cpp | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tests/ChunkBuffer/Copies.cpp diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkBuffer/Copies.cpp new file mode 100644 index 000000000..2f5d48e6a --- /dev/null +++ b/tests/ChunkBuffer/Copies.cpp @@ -0,0 +1,53 @@ + +#include "TestGlobals.h" +#include "ChunkBuffer.h" + + + +int main(int argc, char** argv) +{ + cChunkBuffer buffer; + + buffer.SetBlock(3,1,4,0xDE); + buffer.SetMeta(3,1,4,0xA); + + cChunkBuffer copy = buffer.Copy(); + testassert(copy.GetBlock(3,1,4) == 0xDE); + testassert(copy.GetMeta(3,1,4) == 0xA); + + BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[256 * 256 * 256]; + for (int i = 0; i < 256* 256 * 256; i += 4) + { + SrcBlockBuffer[i+0] = 0xDE; + SrcBlockBuffer[i+1] = 0xAD; + SrcBlockBuffer[i+2] = 0xBE; + SrcBlockBuffer[i+3] = 0xEF; + } + + buffer.SetBlocks(SrcBlockBuffer); + BLOCKTYPE * DstBlockBuffer = new BLOCKTYPE[256 * 256 * 256]; + buffer.CopyBlocks(DstBlockBuffer); + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (256 * 256 * 256) -1) == 0); + delete SrcBlockBuffer; + delete DstBlockBuffer; + SrcBlockBuffer = NULL; + DstBlockBuffer = NULL; + + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[256 * 256 * 256/2]; + for (int i = 0; i < 256* 256 * 256 / 2; i += 4) + { + SrcNibbleBuffer[i+0] = 0xEF; + SrcNibbleBuffer[i+1] = 0xDE; + SrcNibbleBuffer[i+2] = 0xAD; + SrcNibbleBuffer[i+3] = 0xBE; + } + + buffer.SetMeta(SrcNibbleBuffer); + NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[256 * 256 * 256/ 2]; + buffer.CopyMeta(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (256 * 256 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; +} From 0adb5c94b8230b7a65fc06f90c253576755cedcd Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 17:46:49 +0100 Subject: [PATCH 053/214] Fixed stupid buffer overflow in array setblocks --- src/ChunkBuffer.cpp | 6 +++--- src/ChunkBuffer.h | 4 ++-- tests/ChunkBuffer/Copies.cpp | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp index a41b8f61a..baeeff890 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkBuffer.cpp @@ -35,7 +35,7 @@ void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length memcpy( &a_dest[i * segment_length], &m_Sections[i]->m_BlockTypes, - sizeof(BLOCKTYPE) * length + sizeof(BLOCKTYPE) * tocopy ); } else @@ -43,7 +43,7 @@ void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length memset( &a_dest[i * segment_length], 0, - sizeof(BLOCKTYPE) * length + sizeof(BLOCKTYPE) * tocopy ); } } @@ -141,7 +141,7 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) { for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; if (m_Sections[i]) { memcpy(&m_Sections[i]->m_BlockTypes, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length); diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index 410532232..b1bd024d5 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -124,7 +124,7 @@ public: m_Sections[Section] = Allocate(); if(!m_Sections[Section]) { - ASSERT("Failed to allocate a new section in Chunkbuffer"); + ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return; } } @@ -169,7 +169,7 @@ public: m_Sections[Section] = Allocate(); if(!m_Sections[Section]) { - ASSERT("Failed to allocate a new section in Chunkbuffer"); + ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return; } } diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkBuffer/Copies.cpp index 2f5d48e6a..6bdf80268 100644 --- a/tests/ChunkBuffer/Copies.cpp +++ b/tests/ChunkBuffer/Copies.cpp @@ -15,8 +15,8 @@ int main(int argc, char** argv) testassert(copy.GetBlock(3,1,4) == 0xDE); testassert(copy.GetMeta(3,1,4) == 0xA); - BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[256 * 256 * 256]; - for (int i = 0; i < 256* 256 * 256; i += 4) + BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + for (int i = 0; i < 16 * 16 * 256; i += 4) { SrcBlockBuffer[i+0] = 0xDE; SrcBlockBuffer[i+1] = 0xAD; @@ -25,16 +25,16 @@ int main(int argc, char** argv) } buffer.SetBlocks(SrcBlockBuffer); - BLOCKTYPE * DstBlockBuffer = new BLOCKTYPE[256 * 256 * 256]; + BLOCKTYPE * DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; buffer.CopyBlocks(DstBlockBuffer); - testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (256 * 256 * 256) -1) == 0); + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); delete SrcBlockBuffer; delete DstBlockBuffer; SrcBlockBuffer = NULL; DstBlockBuffer = NULL; - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[256 * 256 * 256/2]; - for (int i = 0; i < 256* 256 * 256 / 2; i += 4) + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) { SrcNibbleBuffer[i+0] = 0xEF; SrcNibbleBuffer[i+1] = 0xDE; @@ -43,9 +43,9 @@ int main(int argc, char** argv) } buffer.SetMeta(SrcNibbleBuffer); - NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[256 * 256 * 256/ 2]; + NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; buffer.CopyMeta(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (256 * 256 * 256 /2) -1) == 0); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); delete SrcNibbleBuffer; delete DstNibbleBuffer; SrcNibbleBuffer = NULL; From 6124b5208cd91a510ade2ecbe1056ee2df36046f Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 17:47:45 +0100 Subject: [PATCH 054/214] quite gcov take 4 --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index fc17ddc2c..dc3ca5278 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec sh -c 'cp {} $(dirname {})/../$(basename {})' \; - coveralls --exclude lib --exclude Android >/dev/null + coveralls --exclude lib --exclude Android --gcov-options=-q fi From 4e6499c1c2d0473e0454c88128962154d0f8fc4f Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 17:51:20 +0100 Subject: [PATCH 055/214] Don't run start test under gcov --- CIbuild.sh | 2 +- uploadCoverage.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CIbuild.sh b/CIbuild.sh index 4d8b313a5..0e17f6e64 100755 --- a/CIbuild.sh +++ b/CIbuild.sh @@ -4,4 +4,4 @@ cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1; make -j 2; make -j 2 test; cd MCServer/; -echo stop | gcov $MCSERVER_PATH; +echo stop | $MCSERVER_PATH; diff --git a/uploadCoverage.sh b/uploadCoverage.sh index dc3ca5278..fc17ddc2c 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec sh -c 'cp {} $(dirname {})/../$(basename {})' \; - coveralls --exclude lib --exclude Android --gcov-options=-q + coveralls --exclude lib --exclude Android >/dev/null fi From 7ebb0afd4ec1949f169589ac98438a1322454b1c Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 17:52:46 +0100 Subject: [PATCH 056/214] Fail build on error --- CIbuild.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CIbuild.sh b/CIbuild.sh index 0e17f6e64..20785a488 100755 --- a/CIbuild.sh +++ b/CIbuild.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash - + +set -e + cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1; make -j 2; make -j 2 test; From 7ca33bd832575ea94f8409087c804feb86280c15 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 17:56:59 +0100 Subject: [PATCH 057/214] Fixed stupid error --- src/Chunk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Chunk.h b/src/Chunk.h index 26f1e9d10..038be42de 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -328,7 +328,7 @@ public: } inline void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta) { - if (!GetMeta(a_RelX, a_RelY, a_RelZ) == a_Meta) + if (!(GetMeta(a_RelX, a_RelY, a_RelZ) == a_Meta)) { MarkDirty(); m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); From 009f749962cca2e8914d60b29d971923af9c0226 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 10 May 2014 18:07:50 +0100 Subject: [PATCH 058/214] Coverage builds are called MCServer not MCServer_debug --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 73d7eb557..5260cfd17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ env: matrix: include: - compiler: gcc - env: TRAVIS_MCSERVER_BUILD_TYPE=COVERAGE MCSERVER_PATH=./MCServer_debug + env: TRAVIS_MCSERVER_BUILD_TYPE=COVERAGE MCSERVER_PATH=./MCServer # Notification Settings notifications: From 5c9f89526aeca7b32014cd78e323f74baddf1e36 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 11 May 2014 11:56:15 +0200 Subject: [PATCH 059/214] Rename HandleBlockDigCancel to FinishDigAnimtion. --- src/ClientHandle.cpp | 6 +++--- src/ClientHandle.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index d1962506d..9238418a4 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -878,7 +878,7 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB case DIG_STATUS_CANCELLED: { // Block breaking cancelled by player - HandleBlockDigCancel(); + FinishDigAnimation(); return; } @@ -998,7 +998,7 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo return; } - HandleBlockDigCancel(); + FinishDigAnimation(); cItemHandler * ItemHandler = cItemHandler::GetItemHandler(m_Player->GetEquippedItem()); @@ -1041,7 +1041,7 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo -void cClientHandle::HandleBlockDigCancel() +void cClientHandle::FinishDigAnimation() { if ( !m_HasStartedDigging || // Hasn't received the DIG_STARTED packet diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 03a716657..85d348eee 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -374,8 +374,8 @@ private: /** Handles the DIG_FINISHED dig packet: */ void HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta); - /** Handles the DIG_CANCELLED dig packet: */ - void HandleBlockDigCancel(); + /** The clients will receive a finished dig animation */ + void FinishDigAnimation(); /** Converts the protocol-formatted channel list (NUL-separated) into a proper string vector. */ AStringVector BreakApartPluginChannels(const AString & a_PluginChannels); From c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 11 May 2014 14:57:06 +0300 Subject: [PATCH 060/214] Statistic Manager --- src/Bindings/AllToLua.pkg | 1 + src/ClientHandle.cpp | 19 ++++- src/ClientHandle.h | 2 + src/Entities/Player.cpp | 21 ++++- src/Entities/Player.h | 7 ++ src/Protocol/Protocol.h | 2 + src/Protocol/Protocol125.cpp | 28 +++++++ src/Protocol/Protocol125.h | 1 + src/Protocol/Protocol17x.cpp | 48 +++++++++-- src/Protocol/Protocol17x.h | 1 + src/Protocol/ProtocolRecognizer.cpp | 10 +++ src/Protocol/ProtocolRecognizer.h | 1 + src/Statistics.cpp | 123 +++++++++++++++++++-------- src/Statistics.h | 48 +++++++++++ src/WorldStorage/StatSerializer.cpp | 126 ++++++++++++++++++++++++++++ src/WorldStorage/StatSerializer.h | 53 ++++++++++++ 16 files changed, 448 insertions(+), 43 deletions(-) create mode 100644 src/WorldStorage/StatSerializer.cpp create mode 100644 src/WorldStorage/StatSerializer.h diff --git a/src/Bindings/AllToLua.pkg b/src/Bindings/AllToLua.pkg index 1cd7c74f8..4fe86e1c5 100644 --- a/src/Bindings/AllToLua.pkg +++ b/src/Bindings/AllToLua.pkg @@ -76,6 +76,7 @@ $cfile "../CompositeChat.h" $cfile "../Map.h" $cfile "../MapManager.h" $cfile "../Scoreboard.h" +$cfile "../Statistics.h" diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 94f031ed6..03b1b0dc2 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -31,6 +31,8 @@ #include "CompositeChat.h" #include "Items/ItemSword.h" +#include "WorldStorage/StatSerializer.h" + #include "md5/md5.h" @@ -336,7 +338,13 @@ void cClientHandle::Authenticate(const AString & a_Name, const AString & a_UUID) // Send scoreboard data World->GetScoreBoard().SendTo(*this); - + +#if 0 + // Load stats + cStatSerializer StatSerializer(World->GetName(), m_Player->GetName(), &m_Player->GetStatManager()); + StatSerializer.Load(); +#endif + // Delay the first ping until the client "settles down" // This should fix #889, "BadCast exception, cannot convert bit to fm" error in client cTimer t1; @@ -2437,6 +2445,15 @@ void cClientHandle::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleTy +void cClientHandle::SendStatistics(const cStatManager & a_Manager) +{ + m_Protocol->SendStatistics(a_Manager); +} + + + + + void cClientHandle::SendTabCompletionResults(const AStringVector & a_Results) { m_Protocol->SendTabCompletionResults(a_Results); diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 4dc6ab074..0236d38fb 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -39,6 +39,7 @@ class cFallingBlock; class cItemHandler; class cWorld; class cCompositeChat; +class cStatManager; @@ -160,6 +161,7 @@ public: void SendSpawnMob (const cMonster & a_Mob); void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch); void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType = 0); + void SendStatistics (const cStatManager & a_Manager); void SendTabCompletionResults(const AStringVector & a_Results); void SendTeleportEntity (const cEntity & a_Entity); void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ); diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 6ac11c270..a42fe89cf 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -16,6 +16,8 @@ #include "../Items/ItemHandler.h" #include "../Vector3.h" +#include "../WorldStorage/StatSerializer.h" + #include "inifile/iniFile.h" #include "json/json.h" @@ -131,6 +133,15 @@ cPlayer::~cPlayer(void) SaveToDisk(); +#if 0 + /* Save statistics. */ + cStatSerializer StatSerializer(m_World->GetName(), m_PlayerName, &m_Stats); + if (!StatSerializer.Save()) + { + LOGERROR("Could not save stats for player %s", m_PlayerName.c_str()); + } +#endif + m_World->RemovePlayer( this ); m_ClientHandle = NULL; @@ -871,9 +882,13 @@ void cPlayer::KilledBy(cEntity * a_Killer) } else if (a_Killer->IsPlayer()) { - GetWorld()->BroadcastChatDeath(Printf("%s was killed by %s", GetName().c_str(), ((cPlayer *)a_Killer)->GetName().c_str())); + cPlayer* Killer = (cPlayer*)a_Killer; - m_World->GetScoreBoard().AddPlayerScore(((cPlayer *)a_Killer)->GetName(), cObjective::otPlayerKillCount, 1); + GetWorld()->BroadcastChatDeath(Printf("%s was killed by %s", GetName().c_str(), Killer->GetName().c_str())); + + Killer->GetStatManager().AddValue(statPlayerKills); + + m_World->GetScoreBoard().AddPlayerScore(Killer->GetName(), cObjective::otPlayerKillCount, 1); } else { @@ -883,6 +898,8 @@ void cPlayer::KilledBy(cEntity * a_Killer) GetWorld()->BroadcastChatDeath(Printf("%s was killed by a %s", GetName().c_str(), KillerClass.c_str())); } + m_Stats.AddValue(statDeaths); + m_World->GetScoreBoard().AddPlayerScore(GetName(), cObjective::otDeathCount, 1); } diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 6fc7e2875..82a138290 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -7,6 +7,8 @@ #include "../World.h" #include "../ClientHandle.h" +#include "../Statistics.h" + @@ -174,6 +176,9 @@ public: cTeam * UpdateTeam(void); // tolua_end + + /** Return the associated statistic and achievement manager. */ + cStatManager & GetStatManager() { return m_Stats; } void SetIP(const AString & a_IP); @@ -487,6 +492,8 @@ protected: cTeam * m_Team; + cStatManager m_Stats; + void ResolvePermissions(void); diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h index 8f152ad37..a543c6361 100644 --- a/src/Protocol/Protocol.h +++ b/src/Protocol/Protocol.h @@ -31,6 +31,7 @@ class cMonster; class cChunkDataSerializer; class cFallingBlock; class cCompositeChat; +class cStatManager; @@ -111,6 +112,7 @@ public: virtual void SendSpawnMob (const cMonster & a_Mob) = 0; virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) = 0; virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) = 0; + virtual void SendStatistics (const cStatManager & a_Manager) = 0; virtual void SendTabCompletionResults(const AStringVector & a_Results) = 0; virtual void SendTeleportEntity (const cEntity & a_Entity) = 0; virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) = 0; diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp index e7873cf7a..f3bdae3ac 100644 --- a/src/Protocol/Protocol125.cpp +++ b/src/Protocol/Protocol125.cpp @@ -99,6 +99,7 @@ enum PACKET_ENCHANT_ITEM = 0x6C, PACKET_UPDATE_SIGN = 0x82, PACKET_ITEM_DATA = 0x83, + PACKET_INCREMENT_STATISTIC = 0xC8, PACKET_PLAYER_LIST_ITEM = 0xC9, PACKET_PLAYER_ABILITIES = 0xca, PACKET_PLUGIN_MESSAGE = 0xfa, @@ -992,6 +993,33 @@ void cProtocol125::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleTyp +void cProtocol125::SendStatistics(const cStatManager & a_Manager) +{ + /* NOTE: + * Versions prior to minecraft 1.7 use an incremental statistic sync + * method. The current setup does not allow us to implement that, because + * of performance considerations. + */ +#if 0 + for (unsigned int i = 0; i < (unsigned int)statCount; ++i) + { + StatValue Value = m_Manager->GetValue((eStatistic) i); + + unsigned int StatID = cStatInfo::GetID((eStatistic) i); + + cCSLock Lock(m_CSPacket); + WriteByte(PACKET_INCREMENT_STATISTIC); + WriteInt(StatID); + WriteByte(Value); /* Can overflow! */ + Flush(); + } +#endif +} + + + + + void cProtocol125::SendTabCompletionResults(const AStringVector & a_Results) { // This protocol version doesn't support tab completion diff --git a/src/Protocol/Protocol125.h b/src/Protocol/Protocol125.h index 423e58d67..18a626a2d 100644 --- a/src/Protocol/Protocol125.h +++ b/src/Protocol/Protocol125.h @@ -84,6 +84,7 @@ public: virtual void SendSpawnMob (const cMonster & a_Mob) override; virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override; virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) override; + virtual void SendStatistics (const cStatManager & a_Manager) override; virtual void SendTabCompletionResults(const AStringVector & a_Results) override; virtual void SendTeleportEntity (const cEntity & a_Entity) override; virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override; diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 443723e40..3b21f7821 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -11,13 +11,19 @@ Implements the 1.7.x protocol classes: #include "json/json.h" #include "Protocol17x.h" #include "ChunkDataSerializer.h" +#include "PolarSSL++/Sha1Checksum.h" + #include "../ClientHandle.h" #include "../Root.h" #include "../Server.h" #include "../World.h" +#include "../StringCompression.h" +#include "../CompositeChat.h" +#include "../Statistics.h" + #include "../WorldStorage/FastNBT.h" #include "../WorldStorage/EnchantmentSerializer.h" -#include "../StringCompression.h" + #include "../Entities/ExpOrb.h" #include "../Entities/Minecart.h" #include "../Entities/FallingBlock.h" @@ -25,15 +31,15 @@ Implements the 1.7.x protocol classes: #include "../Entities/Pickup.h" #include "../Entities/Player.h" #include "../Entities/ItemFrame.h" +#include "../Entities/ArrowEntity.h" +#include "../Entities/FireworkEntity.h" + #include "../Mobs/IncludeAllMonsters.h" #include "../UI/Window.h" + #include "../BlockEntities/CommandBlockEntity.h" #include "../BlockEntities/MobHeadEntity.h" #include "../BlockEntities/FlowerPotEntity.h" -#include "../CompositeChat.h" -#include "../Entities/ArrowEntity.h" -#include "../Entities/FireworkEntity.h" -#include "PolarSSL++/Sha1Checksum.h" @@ -1169,6 +1175,28 @@ void cProtocol172::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleTyp +void cProtocol172::SendStatistics(const cStatManager & a_Manager) +{ + ASSERT(m_State == 3); // In game mode? + + cPacketizer Pkt(*this, 0x37); + Pkt.WriteVarInt(statCount); // TODO 2014-05-11 xdot: Optimization: Send "dirty" statistics only + + for (unsigned int i = 0; i < (unsigned int)statCount; ++i) + { + StatValue Value = a_Manager.GetValue((eStatistic) i); + + const AString & StatName = cStatInfo::GetName((eStatistic) i); + + Pkt.WriteString(StatName); + Pkt.WriteVarInt(Value); + } +} + + + + + void cProtocol172::SendTabCompletionResults(const AStringVector & a_Results) { ASSERT(m_State == 3); // In game mode? @@ -1843,13 +1871,19 @@ void cProtocol172::HandlePacketClientStatus(cByteBuffer & a_ByteBuffer) case 1: { // Request stats - // TODO + const cStatManager & Manager = m_Client->GetPlayer()->GetStatManager(); + SendStatistics(Manager); + break; } case 2: { // Open Inventory achievement - // TODO + cStatManager & Manager = m_Client->GetPlayer()->GetStatManager(); + Manager.AddValue(achOpenInv); + + SendStatistics(Manager); + break; } } diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h index dc111e737..3c6a8c085 100644 --- a/src/Protocol/Protocol17x.h +++ b/src/Protocol/Protocol17x.h @@ -116,6 +116,7 @@ public: virtual void SendSpawnMob (const cMonster & a_Mob) override; virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override; virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) override; + virtual void SendStatistics (const cStatManager & a_Manager) override; virtual void SendTabCompletionResults(const AStringVector & a_Results) override; virtual void SendTeleportEntity (const cEntity & a_Entity) override; virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override; diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp index 667fb5cef..b0cbb6def 100644 --- a/src/Protocol/ProtocolRecognizer.cpp +++ b/src/Protocol/ProtocolRecognizer.cpp @@ -675,6 +675,16 @@ void cProtocolRecognizer::SendSpawnVehicle(const cEntity & a_Vehicle, char a_Veh +void cProtocolRecognizer::SendStatistics(const cStatManager & a_Manager) +{ + ASSERT(m_Protocol != NULL); + m_Protocol->SendStatistics(a_Manager); +} + + + + + void cProtocolRecognizer::SendTabCompletionResults(const AStringVector & a_Results) { ASSERT(m_Protocol != NULL); diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h index 37f47379d..3a291bf7a 100644 --- a/src/Protocol/ProtocolRecognizer.h +++ b/src/Protocol/ProtocolRecognizer.h @@ -119,6 +119,7 @@ public: virtual void SendSpawnMob (const cMonster & a_Mob) override; virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override; virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) override; + virtual void SendStatistics (const cStatManager & a_Manager) override; virtual void SendTabCompletionResults(const AStringVector & a_Results) override; virtual void SendTeleportEntity (const cEntity & a_Entity) override; virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override; diff --git a/src/Statistics.cpp b/src/Statistics.cpp index 2c980d98e..94076f828 100644 --- a/src/Statistics.cpp +++ b/src/Statistics.cpp @@ -13,39 +13,39 @@ cStatInfo cStatInfo::ms_Info[statCount] = { // http://minecraft.gamepedia.com/Achievements /* Type | Name | Prerequisite */ - cStatInfo(achOpenInv, "openInventory"), - cStatInfo(achMineWood, "mineWood", achOpenInv), - cStatInfo(achCraftWorkbench, "buildWorkBench", achMineWood), - cStatInfo(achCraftPickaxe, "buildPickaxe", achCraftWorkbench), - cStatInfo(achCraftFurnace, "buildFurnace", achCraftPickaxe), - cStatInfo(achAcquireIron, "acquireIron", achCraftFurnace), - cStatInfo(achCraftHoe, "buildHoe", achCraftWorkbench), - cStatInfo(achMakeBread, "makeBread", achCraftHoe), - cStatInfo(achBakeCake, "bakeCake", achCraftHoe), - cStatInfo(achCraftBetterPick, "buildBetterPickaxe", achCraftPickaxe), - cStatInfo(achCookFish, "cookFish", achAcquireIron), - cStatInfo(achOnARail, "onARail", achAcquireIron), - cStatInfo(achCraftSword, "buildSword", achCraftWorkbench), - cStatInfo(achKillMonster, "killEnemy", achCraftSword), - cStatInfo(achKillCow, "killCow", achCraftSword), - cStatInfo(achFlyPig, "flyPig", achKillCow), - cStatInfo(achSnipeSkeleton, "snipeSkeleton", achKillMonster), - cStatInfo(achDiamonds, "diamonds", achAcquireIron), - cStatInfo(achEnterPortal, "portal", achDiamonds), - cStatInfo(achReturnToSender, "ghast", achEnterPortal), - cStatInfo(achBlazeRod, "blazeRod", achEnterPortal), - cStatInfo(achBrewPotion, "potion", achBlazeRod), - cStatInfo(achEnterTheEnd, "theEnd", achBlazeRod), - cStatInfo(achDefeatDragon, "theEnd2", achEnterTheEnd), - cStatInfo(achCraftEnchantTable, "enchantments", achDiamonds), - cStatInfo(achOverkill, "overkill", achCraftEnchantTable), - cStatInfo(achBookshelf, "bookcase", achCraftEnchantTable), - cStatInfo(achExploreAllBiomes, "exploreAllBiomes", achEnterTheEnd), - cStatInfo(achSpawnWither, "spawnWither", achDefeatDragon), - cStatInfo(achKillWither, "killWither", achSpawnWither), - cStatInfo(achFullBeacon, "fullBeacon", achKillWither), - cStatInfo(achBreedCow, "breedCow", achKillCow), - cStatInfo(achThrowDiamonds, "diamondsToYou", achDiamonds), + cStatInfo(achOpenInv, "achievement.openInventory"), + cStatInfo(achMineWood, "achievement.mineWood", achOpenInv), + cStatInfo(achCraftWorkbench, "achievement.buildWorkBench", achMineWood), + cStatInfo(achCraftPickaxe, "achievement.buildPickaxe", achCraftWorkbench), + cStatInfo(achCraftFurnace, "achievement.buildFurnace", achCraftPickaxe), + cStatInfo(achAcquireIron, "achievement.acquireIron", achCraftFurnace), + cStatInfo(achCraftHoe, "achievement.buildHoe", achCraftWorkbench), + cStatInfo(achMakeBread, "achievement.makeBread", achCraftHoe), + cStatInfo(achBakeCake, "achievement.bakeCake", achCraftHoe), + cStatInfo(achCraftBetterPick, "achievement.buildBetterPickaxe", achCraftPickaxe), + cStatInfo(achCookFish, "achievement.cookFish", achAcquireIron), + cStatInfo(achOnARail, "achievement.onARail", achAcquireIron), + cStatInfo(achCraftSword, "achievement.buildSword", achCraftWorkbench), + cStatInfo(achKillMonster, "achievement.killEnemy", achCraftSword), + cStatInfo(achKillCow, "achievement.killCow", achCraftSword), + cStatInfo(achFlyPig, "achievement.flyPig", achKillCow), + cStatInfo(achSnipeSkeleton, "achievement.snipeSkeleton", achKillMonster), + cStatInfo(achDiamonds, "achievement.diamonds", achAcquireIron), + cStatInfo(achEnterPortal, "achievement.portal", achDiamonds), + cStatInfo(achReturnToSender, "achievement.ghast", achEnterPortal), + cStatInfo(achBlazeRod, "achievement.blazeRod", achEnterPortal), + cStatInfo(achBrewPotion, "achievement.potion", achBlazeRod), + cStatInfo(achEnterTheEnd, "achievement.theEnd", achBlazeRod), + cStatInfo(achDefeatDragon, "achievement.theEnd2", achEnterTheEnd), + cStatInfo(achCraftEnchantTable, "achievement.enchantments", achDiamonds), + cStatInfo(achOverkill, "achievement.overkill", achCraftEnchantTable), + cStatInfo(achBookshelf, "achievement.bookcase", achCraftEnchantTable), + cStatInfo(achExploreAllBiomes, "achievement.exploreAllBiomes", achEnterTheEnd), + cStatInfo(achSpawnWither, "achievement.spawnWither", achDefeatDragon), + cStatInfo(achKillWither, "achievement.killWither", achSpawnWither), + cStatInfo(achFullBeacon, "achievement.fullBeacon", achKillWither), + cStatInfo(achBreedCow, "achievement.breedCow", achKillCow), + cStatInfo(achThrowDiamonds, "achievement.diamondsToYou", achDiamonds), // http://minecraft.gamepedia.com/Statistics @@ -57,6 +57,7 @@ cStatInfo cStatInfo::ms_Info[statCount] = { cStatInfo(statDistFallen, "stat.fallOneCm"), cStatInfo(statDistClimbed, "stat.climbOneCm"), cStatInfo(statDistFlown, "stat.flyOneCm"), + cStatInfo(statDistDove, "stat.diveOneCm"), cStatInfo(statDistMinecart, "stat.minecartOneCm"), cStatInfo(statDistBoat, "stat.boatOneCm"), cStatInfo(statDistPig, "stat.pigOneCm"), @@ -137,3 +138,59 @@ eStatistic cStatInfo::GetPrerequisite(const eStatistic a_Type) +cStatManager::cStatManager() +{ + Reset(); +} + + + + + +StatValue cStatManager::GetValue(const eStatistic a_Stat) const +{ + ASSERT((a_Stat > statInvalid) && (a_Stat < statCount)); + + return m_MainStats[a_Stat]; +} + + + + + +void cStatManager::SetValue(const eStatistic a_Stat, const StatValue a_Value) +{ + ASSERT((a_Stat > statInvalid) && (a_Stat < statCount)); + + m_MainStats[a_Stat] = a_Value; +} + + + + + +StatValue cStatManager::AddValue(const eStatistic a_Stat, const StatValue a_Delta) +{ + ASSERT((a_Stat > statInvalid) && (a_Stat < statCount)); + + m_MainStats[a_Stat] += a_Delta; + + return m_MainStats[a_Stat]; +} + + + + + +void cStatManager::Reset(void) +{ + for (unsigned int i = 0; i < (unsigned int)statCount; ++i) + { + m_MainStats[i] = 0; + } +} + + + + + diff --git a/src/Statistics.h b/src/Statistics.h index 540df38cc..f37f32e1e 100644 --- a/src/Statistics.h +++ b/src/Statistics.h @@ -9,6 +9,7 @@ +// tolua_begin enum eStatistic { // The order must match the order of cStatInfo::ms_Info @@ -77,6 +78,7 @@ enum eStatistic statCount }; +// tolua_end @@ -114,3 +116,49 @@ private: + +/* Signed (?) integral value. */ +typedef int StatValue; // tolua_export + + + + +/** Class that manages the statistics and achievements of a single player. */ +// tolua_begin +class cStatManager +{ +public: + // tolua_end + + cStatManager(); + + // tolua_begin + + /** Return the value of the specified stat. */ + StatValue GetValue(const eStatistic a_Stat) const; + + /** Set the value of the specified stat. */ + void SetValue(const eStatistic a_Stat, const StatValue a_Value); + + /** Reset everything. */ + void Reset(); + + /** Increment the specified stat. + * + * Returns the new value. + */ + StatValue AddValue(const eStatistic a_Stat, const StatValue a_Delta = 1); + + // tolua_end + +private: + + StatValue m_MainStats[statCount]; + + // TODO 10-05-2014 xdot: Use, mine, craft statistics + + +}; // tolua_export + + + diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp new file mode 100644 index 000000000..5c6724c60 --- /dev/null +++ b/src/WorldStorage/StatSerializer.cpp @@ -0,0 +1,126 @@ + +// StatSerializer.cpp + + +#include "Globals.h" +#include "StatSerializer.h" + +#include "../Statistics.h" + +#include + + + + + +cStatSerializer::cStatSerializer(const AString& a_WorldName, const AString& a_PlayerName, cStatManager* a_Manager) + : m_Manager(a_Manager) +{ + AString StatsPath; + Printf(StatsPath, "%s/stats", a_WorldName.c_str()); + + m_Path = StatsPath + "/" + a_PlayerName + ".dat"; + + /* Ensure that the directory exists. */ + cFile::CreateFolder(FILE_IO_PREFIX + StatsPath); +} + + + + + +bool cStatSerializer::Load(void) +{ + AString Data = cFile::ReadWholeFile(FILE_IO_PREFIX + m_Path); + if (Data.empty()) + { + return false; + } + + Json::Value Root; + Json::Reader Reader; + + if (Reader.parse(Data, Root, false)) + { + return LoadStatFromJSON(Root); + } + + return false; +} + + + + + +bool cStatSerializer::Save(void) +{ + Json::Value Root; + SaveStatToJSON(Root); + + cFile File; + if (!File.Open(FILE_IO_PREFIX + m_Path, cFile::fmWrite)) + { + return false; + } + + Json::StyledWriter Writer; + AString JsonData = Writer.write(Root); + + File.Write(JsonData.data(), JsonData.size()); + File.Close(); + + return true; +} + + + + + +void cStatSerializer::SaveStatToJSON(Json::Value & a_Out) +{ + for (unsigned int i = 0; i < (unsigned int)statCount; ++i) + { + StatValue Value = m_Manager->GetValue((eStatistic) i); + + if (Value != 0) + { + const AString & StatName = cStatInfo::GetName((eStatistic) i); + + a_Out[StatName] = Value; + } + } +} + + + + + +bool cStatSerializer::LoadStatFromJSON(const Json::Value & a_In) +{ + m_Manager->Reset(); + + for (Json::ValueIterator it = a_In.begin() ; it != a_In.end() ; ++it) + { + AString StatName = it.key().asString(); + + eStatistic StatType = cStatInfo::GetType(StatName); + + if (StatType == statInvalid) + { + LOGWARNING("Invalid statistic type %s", StatName.c_str()); + continue; + } + + m_Manager->SetValue(StatType, (*it).asInt()); + } + + return true; +} + + + + + + + + diff --git a/src/WorldStorage/StatSerializer.h b/src/WorldStorage/StatSerializer.h new file mode 100644 index 000000000..43514465b --- /dev/null +++ b/src/WorldStorage/StatSerializer.h @@ -0,0 +1,53 @@ + +// StatSerializer.h + +// Declares the cStatSerializer class that is used for saving stats into JSON + + + + + +#pragma once + +#include "json/json.h" + + + + + +// fwd: +class cStatManager; + + + + +class cStatSerializer +{ +public: + + cStatSerializer(const AString& a_WorldName, const AString& a_PlayerName, cStatManager* a_Manager); + + bool Load(void); + + bool Save(void); + + +protected: + + void SaveStatToJSON(Json::Value & a_Out); + + bool LoadStatFromJSON(const Json::Value & a_In); + + +private: + + cStatManager* m_Manager; + + AString m_Path; + + +} ; + + + + From 9278bb732d115251776b12ebb45d0192c7fdd916 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 11 May 2014 15:52:02 +0100 Subject: [PATCH 061/214] Fixed a bug in writting zeros to a non-allocated section --- src/ChunkBuffer.cpp | 11 ++ src/ChunkBuffer.h | 12 ++ tests/ChunkBuffer/Coordinates.cpp | 204 ++++++++++++++++-------------- 3 files changed, 134 insertions(+), 93 deletions(-) diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp index baeeff890..96077b966 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkBuffer.cpp @@ -295,3 +295,14 @@ void cChunkBuffer::Free(cChunkBuffer::sChunkSection * ptr) const +void cChunkBuffer::ZeroSection(cChunkBuffer::sChunkSection * ptr) const +{ + memset(ptr->m_BlockTypes,0x00,sizeof(ptr->m_BlockTypes)); + memset(ptr->m_BlockMeta,0x00,sizeof(ptr->m_BlockMeta)); + memset(ptr->m_BlockLight,0x00,sizeof(ptr->m_BlockLight)); + memset(ptr->m_BlockSkyLight,0x00,sizeof(ptr->m_BlockSkyLight)); +} + + + + diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index b1bd024d5..e16575bb2 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -121,12 +121,17 @@ public: int Section = a_RelY / CHUNK_SECTION_HEIGHT; if(!m_Sections[Section]) { + if(a_Block == 0x00) + { + return; + } m_Sections[Section] = Allocate(); if(!m_Sections[Section]) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return; } + ZeroSection(m_Sections[Section]); } int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); m_Sections[Section]->m_BlockTypes[Index] = a_Block; @@ -166,12 +171,17 @@ public: int Section = a_RelY / CHUNK_SECTION_HEIGHT; if(!m_Sections[Section]) { + if((a_Nibble & 0xf) == 0x00) + { + return; + } m_Sections[Section] = Allocate(); if(!m_Sections[Section]) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return; } + ZeroSection(m_Sections[Section]); } int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); m_Sections[Section]->m_BlockMeta[Index / 2] = static_cast( @@ -247,6 +257,8 @@ private: sChunkSection * Allocate() const; void Free(sChunkSection * ptr) const; + + void ZeroSection(sChunkSection * ptr) const; }; diff --git a/tests/ChunkBuffer/Coordinates.cpp b/tests/ChunkBuffer/Coordinates.cpp index a6a8aa18f..b9861df23 100644 --- a/tests/ChunkBuffer/Coordinates.cpp +++ b/tests/ChunkBuffer/Coordinates.cpp @@ -6,101 +6,119 @@ int main(int argc, char** argv) { - cChunkBuffer buffer; + { + cChunkBuffer buffer; + + // Empty chunks + buffer.SetBlock(0,0,0, 0xAB); + testassert(buffer.GetBlock(0,0,0) == 0xAB); + buffer.SetMeta(0,16,0, 0xC); + testassert(buffer.GetMeta(0,16,0) == 0xC); + + // loaded but not written segments + testassert(buffer.GetBlock(1,0,0) == 0x0); + testassert(buffer.GetMeta(1,16,0) == 0x0); + + // Notloaded segments + testassert(buffer.GetBlock(0,32,0) == 0x0); + testassert(buffer.GetMeta(0,48,0) == 0x0); + + // Out of Range + CheckAsserts( + buffer.SetBlock(-1, 0, 0, 0); + ); + CheckAsserts( + buffer.SetBlock(0, -1, 0, 0); + ); + CheckAsserts( + buffer.SetBlock(0, 0, -1, 0); + ); + CheckAsserts( + buffer.SetBlock(256, 0, 0, 0); + ); + CheckAsserts( + buffer.SetBlock(0, 256, 0, 0); + ); + CheckAsserts( + buffer.SetBlock(0, 0, 256, 0); + ); + + // Out of Range + CheckAsserts( + buffer.GetBlock(-1, 0, 0); + ); + CheckAsserts( + buffer.GetBlock(0, -1, 0); + ); + CheckAsserts( + buffer.GetBlock(0, 0, -1); + ); + CheckAsserts( + buffer.GetBlock(256, 0, 0); + ); + CheckAsserts( + buffer.GetBlock(0, 256, 0); + ); + CheckAsserts( + buffer.GetBlock(0, 0, 256); + ); + + // Out of Range + CheckAsserts( + buffer.SetMeta(-1, 0, 0, 0); + ); + CheckAsserts( + buffer.SetMeta(0, -1, 0, 0); + ); + CheckAsserts( + buffer.SetMeta(0, 0, -1, 0); + ); + CheckAsserts( + buffer.SetMeta(256, 0, 0, 0); + ); + CheckAsserts( + buffer.SetMeta(0, 256, 0, 0); + ); + CheckAsserts( + buffer.SetMeta(0, 0, 256, 0); + ); + + // Out of Range + CheckAsserts( + buffer.GetMeta(-1, 0, 0); + ); + CheckAsserts( + buffer.GetMeta(0, -1, 0); + ); + CheckAsserts( + buffer.GetMeta(0, 0, -1); + ); + CheckAsserts( + buffer.GetMeta(256, 0, 0); + ); + CheckAsserts( + buffer.GetMeta(0, 256, 0); + ); + CheckAsserts( + buffer.GetMeta(0, 0, 256); + ); + } - // Empty chunks - buffer.SetBlock(0,0,0, 0xAB); - testassert(buffer.GetBlock(0,0,0) == 0xAB); - buffer.SetMeta(0,16,0, 0xC); - testassert(buffer.GetMeta(0,16,0) == 0xC); + { + cChunkBuffer buffer; + + // Zero's + buffer.SetBlock(0,0,0, 0x0); + buffer.SetBlock(0,0,1, 0xAB); + testassert(buffer.GetBlock(0,0,0) == 0x0); + testassert(buffer.GetBlock(0,0,1) == 0xAB); + + buffer.SetMeta(0,16,0, 0x0); + buffer.SetMeta(0,16,1, 0xC); + testassert(buffer.GetMeta(0,16,0) == 0x0); + testassert(buffer.GetMeta(0,16,1) == 0xC); + } - // loaded but not written segments - testassert(buffer.GetBlock(1,0,0) == 0x0); - testassert(buffer.GetMeta(1,16,0) == 0x0); - - // Notloaded segments - testassert(buffer.GetBlock(0,32,0) == 0x0); - testassert(buffer.GetMeta(0,48,0) == 0x0); - - // Out of Range - CheckAsserts( - buffer.SetBlock(-1, 0, 0, 0); - ); - CheckAsserts( - buffer.SetBlock(0, -1, 0, 0); - ); - CheckAsserts( - buffer.SetBlock(0, 0, -1, 0); - ); - CheckAsserts( - buffer.SetBlock(256, 0, 0, 0); - ); - CheckAsserts( - buffer.SetBlock(0, 256, 0, 0); - ); - CheckAsserts( - buffer.SetBlock(0, 0, 256, 0); - ); - - // Out of Range - CheckAsserts( - buffer.GetBlock(-1, 0, 0); - ); - CheckAsserts( - buffer.GetBlock(0, -1, 0); - ); - CheckAsserts( - buffer.GetBlock(0, 0, -1); - ); - CheckAsserts( - buffer.GetBlock(256, 0, 0); - ); - CheckAsserts( - buffer.GetBlock(0, 256, 0); - ); - CheckAsserts( - buffer.GetBlock(0, 0, 256); - ); - - // Out of Range - CheckAsserts( - buffer.SetMeta(-1, 0, 0, 0); - ); - CheckAsserts( - buffer.SetMeta(0, -1, 0, 0); - ); - CheckAsserts( - buffer.SetMeta(0, 0, -1, 0); - ); - CheckAsserts( - buffer.SetMeta(256, 0, 0, 0); - ); - CheckAsserts( - buffer.SetMeta(0, 256, 0, 0); - ); - CheckAsserts( - buffer.SetMeta(0, 0, 256, 0); - ); - - // Out of Range - CheckAsserts( - buffer.GetMeta(-1, 0, 0); - ); - CheckAsserts( - buffer.GetMeta(0, -1, 0); - ); - CheckAsserts( - buffer.GetMeta(0, 0, -1); - ); - CheckAsserts( - buffer.GetMeta(256, 0, 0); - ); - CheckAsserts( - buffer.GetMeta(0, 256, 0); - ); - CheckAsserts( - buffer.GetMeta(0, 0, 256); - ); return 0; } From 79ab80718ef18f174c73ecb804cb8604e0717fa5 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 11 May 2014 15:57:56 +0100 Subject: [PATCH 062/214] Cerated array copy tests for block and skylight --- tests/ChunkBuffer/Copies.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkBuffer/Copies.cpp index 6bdf80268..a6c83f75d 100644 --- a/tests/ChunkBuffer/Copies.cpp +++ b/tests/ChunkBuffer/Copies.cpp @@ -50,4 +50,40 @@ int main(int argc, char** argv) delete DstNibbleBuffer; SrcNibbleBuffer = NULL; DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) + { + SrcNibbleBuffer[i+0] = 0xDE; + SrcNibbleBuffer[i+1] = 0xAD; + SrcNibbleBuffer[i+2] = 0xBE; + SrcNibbleBuffer[i+3] = 0xEF; + } + + buffer.SetLight(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) + { + SrcNibbleBuffer[i+0] = 0xAD; + SrcNibbleBuffer[i+1] = 0xBE; + SrcNibbleBuffer[i+2] = 0xEF; + SrcNibbleBuffer[i+3] = 0xDE; + } + + buffer.SetSkyLight(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopySkyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; } From 9568c223ff5b507ab436931ddf716e5978cbc35e Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 11 May 2014 18:24:21 +0100 Subject: [PATCH 063/214] SkyLight defaults to 0xFF --- src/ChunkBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp index 96077b966..73ccd9c02 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkBuffer.cpp @@ -300,7 +300,7 @@ void cChunkBuffer::ZeroSection(cChunkBuffer::sChunkSection * ptr) const memset(ptr->m_BlockTypes,0x00,sizeof(ptr->m_BlockTypes)); memset(ptr->m_BlockMeta,0x00,sizeof(ptr->m_BlockMeta)); memset(ptr->m_BlockLight,0x00,sizeof(ptr->m_BlockLight)); - memset(ptr->m_BlockSkyLight,0x00,sizeof(ptr->m_BlockSkyLight)); + memset(ptr->m_BlockSkyLight,0xFF,sizeof(ptr->m_BlockSkyLight)); } From a6940445f66948f2dbaa5eaffaa6a89cc15942cb Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 11 May 2014 18:29:47 +0100 Subject: [PATCH 064/214] test 0 values --- tests/ChunkBuffer/Copies.cpp | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkBuffer/Copies.cpp index a6c83f75d..07879d129 100644 --- a/tests/ChunkBuffer/Copies.cpp +++ b/tests/ChunkBuffer/Copies.cpp @@ -86,4 +86,49 @@ int main(int argc, char** argv) delete DstNibbleBuffer; SrcNibbleBuffer = NULL; DstNibbleBuffer = NULL; + + SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); + buffer.SetBlocks(SrcBlockBuffer); + DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + buffer.CopyBlocks(DstBlockBuffer); + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); + delete SrcBlockBuffer; + delete DstBlockBuffer; + SrcBlockBuffer = NULL; + DstBlockBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + buffer.SetMeta(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyMeta(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + buffer.SetLight(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); + buffer.SetSkyLight(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopySkyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; } From e3c6c8f3ddffdc368ebbc1a7688de2ca1b97167c Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 11 May 2014 20:30:54 +0300 Subject: [PATCH 065/214] Fixed stat serialization --- src/ClientHandle.cpp | 8 -------- src/Entities/Player.cpp | 31 +++++++++++++++++++---------- src/Statistics.cpp | 2 +- src/WorldStorage/StatSerializer.cpp | 27 ++++++++++++++++++++----- 4 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 03b1b0dc2..c4f4e496a 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -31,8 +31,6 @@ #include "CompositeChat.h" #include "Items/ItemSword.h" -#include "WorldStorage/StatSerializer.h" - #include "md5/md5.h" @@ -339,12 +337,6 @@ void cClientHandle::Authenticate(const AString & a_Name, const AString & a_UUID) // Send scoreboard data World->GetScoreBoard().SendTo(*this); -#if 0 - // Load stats - cStatSerializer StatSerializer(World->GetName(), m_Player->GetName(), &m_Player->GetStatManager()); - StatSerializer.Load(); -#endif - // Delay the first ping until the client "settles down" // This should fix #889, "BadCast exception, cannot convert bit to fm" error in client cTimer t1; diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index a42fe89cf..1df473eb2 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -133,15 +133,6 @@ cPlayer::~cPlayer(void) SaveToDisk(); -#if 0 - /* Save statistics. */ - cStatSerializer StatSerializer(m_World->GetName(), m_PlayerName, &m_Stats); - if (!StatSerializer.Save()) - { - LOGERROR("Could not save stats for player %s", m_PlayerName.c_str()); - } -#endif - m_World->RemovePlayer( this ); m_ClientHandle = NULL; @@ -1638,6 +1629,12 @@ bool cPlayer::LoadFromDisk() m_Inventory.LoadFromJson(root["inventory"]); m_LoadedWorldName = root.get("world", "world").asString(); + + /* Load the player stats. + * We use the default world name (like bukkit) because stats are shared between dimensions/worlds. + */ + cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats); + StatSerializer.Load(); LOGD("Player \"%s\" was read from file, spawning at {%.2f, %.2f, %.2f} in world \"%s\"", m_PlayerName.c_str(), GetPosX(), GetPosY(), GetPosZ(), m_LoadedWorldName.c_str() @@ -1709,6 +1706,17 @@ bool cPlayer::SaveToDisk() LOGERROR("ERROR WRITING PLAYER JSON TO FILE \"%s\"", SourceFile.c_str()); return false; } + + /* Save the player stats. + * We use the default world name (like bukkit) because stats are shared between dimensions/worlds. + */ + cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), m_PlayerName, &m_Stats); + if (!StatSerializer.Save()) + { + LOGERROR("Could not save stats for player %s", m_PlayerName.c_str()); + return false; + } + return true; } @@ -1723,7 +1731,10 @@ cPlayer::StringList cPlayer::GetResolvedPermissions() const PermissionMap& ResolvedPermissions = m_ResolvedPermissions; for( PermissionMap::const_iterator itr = ResolvedPermissions.begin(); itr != ResolvedPermissions.end(); ++itr ) { - if( itr->second ) Permissions.push_back( itr->first ); + if (itr->second) + { + Permissions.push_back( itr->first ); + } } return Permissions; diff --git a/src/Statistics.cpp b/src/Statistics.cpp index 94076f828..65addb0dd 100644 --- a/src/Statistics.cpp +++ b/src/Statistics.cpp @@ -114,7 +114,7 @@ eStatistic cStatInfo::GetType(const AString & a_Name) { for (unsigned int i = 0; i < ARRAYCOUNT(ms_Info); ++i) { - if (NoCaseCompare(ms_Info[i].m_Name, a_Name)) + if (NoCaseCompare(ms_Info[i].m_Name, a_Name) == 0) { return ms_Info[i].m_Type; } diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp index 5c6724c60..66e5e1e9e 100644 --- a/src/WorldStorage/StatSerializer.cpp +++ b/src/WorldStorage/StatSerializer.cpp @@ -7,8 +7,6 @@ #include "../Statistics.h" -#include - @@ -19,7 +17,7 @@ cStatSerializer::cStatSerializer(const AString& a_WorldName, const AString& a_Pl AString StatsPath; Printf(StatsPath, "%s/stats", a_WorldName.c_str()); - m_Path = StatsPath + "/" + a_PlayerName + ".dat"; + m_Path = StatsPath + "/" + a_PlayerName + ".json"; /* Ensure that the directory exists. */ cFile::CreateFolder(FILE_IO_PREFIX + StatsPath); @@ -88,6 +86,8 @@ void cStatSerializer::SaveStatToJSON(Json::Value & a_Out) a_Out[StatName] = Value; } + + // TODO 2014-05-11 xdot: Save "progress" } } @@ -107,11 +107,28 @@ bool cStatSerializer::LoadStatFromJSON(const Json::Value & a_In) if (StatType == statInvalid) { - LOGWARNING("Invalid statistic type %s", StatName.c_str()); + LOGWARNING("Invalid statistic type \"%s\"", StatName.c_str()); continue; } - m_Manager->SetValue(StatType, (*it).asInt()); + Json::Value & Node = *it; + + if (Node.isInt()) + { + m_Manager->SetValue(StatType, Node.asInt()); + } + else if (Node.isObject()) + { + StatValue Value = Node.get("value", 0).asInt(); + + // TODO 2014-05-11 xdot: Load "progress" + + m_Manager->SetValue(StatType, Value); + } + else + { + LOGWARNING("Invalid statistic value for type \"%s\"", StatName.c_str()); + } } return true; From 5d39ecc64b3c690b2da05936c73c9442511b9509 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 11 May 2014 18:42:38 +0100 Subject: [PATCH 066/214] Fixed bug that caused Array Setters to always create segments --- src/ChunkBuffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp index 73ccd9c02..141601113 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkBuffer.cpp @@ -151,7 +151,7 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != segment_length) + if (j != (segment_length - 1)) { m_Sections[i] = Allocate(); memcpy( @@ -186,7 +186,7 @@ void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != segment_length) + if (j != (segment_length - 1)) { m_Sections[i] = Allocate(); memcpy( @@ -222,7 +222,7 @@ void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != segment_length) + if (j != (segment_length - 1)) { m_Sections[i] = Allocate(); memcpy( @@ -258,7 +258,7 @@ void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0xFF; j++); - if (j != segment_length) + if (j != (segment_length -1)) { m_Sections[i] = Allocate(); memcpy( From c46f240d818e5e6aa7c1ffae95bd03f979aae8ba Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 11 May 2014 19:24:09 +0100 Subject: [PATCH 067/214] Added several more testsfor arrays and coordinates --- src/ChunkBuffer.cpp | 20 ++++++++++++++++---- tests/ChunkBuffer/CMakeLists.txt | 5 +++++ tests/ChunkBuffer/Copies.cpp | 1 - 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp index 141601113..99bcdebef 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkBuffer.cpp @@ -151,7 +151,7 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != (segment_length - 1)) + if (j != segment_length) { m_Sections[i] = Allocate(); memcpy( @@ -159,6 +159,9 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); + memset(m_Sections[i]->m_BlockMeta,0x00,sizeof(m_Sections[i]->m_BlockMeta)); + memset(m_Sections[i]->m_BlockLight,0x00,sizeof(m_Sections[i]->m_BlockLight)); + memset(m_Sections[i]->m_BlockSkyLight,0xFF,sizeof(m_Sections[i]->m_BlockSkyLight)); } else { @@ -186,7 +189,7 @@ void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != (segment_length - 1)) + if (j != segment_length) { m_Sections[i] = Allocate(); memcpy( @@ -194,6 +197,9 @@ void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); + memset(m_Sections[i]->m_BlockTypes,0x00,sizeof(m_Sections[i]->m_BlockTypes)); + memset(m_Sections[i]->m_BlockLight,0x00,sizeof(m_Sections[i]->m_BlockLight)); + memset(m_Sections[i]->m_BlockSkyLight,0xFF,sizeof(m_Sections[i]->m_BlockSkyLight)); } else { @@ -222,7 +228,7 @@ void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != (segment_length - 1)) + if (j != segment_length) { m_Sections[i] = Allocate(); memcpy( @@ -230,6 +236,9 @@ void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); + memset(m_Sections[i]->m_BlockTypes,0x00,sizeof(m_Sections[i]->m_BlockTypes)); + memset(m_Sections[i]->m_BlockMeta,0x00,sizeof(m_Sections[i]->m_BlockMeta)); + memset(m_Sections[i]->m_BlockSkyLight,0xFF,sizeof(m_Sections[i]->m_BlockSkyLight)); } else { @@ -258,7 +267,7 @@ void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0xFF; j++); - if (j != (segment_length -1)) + if (j != segment_length) { m_Sections[i] = Allocate(); memcpy( @@ -266,6 +275,9 @@ void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); + memset(m_Sections[i]->m_BlockTypes,0x00,sizeof(m_Sections[i]->m_BlockTypes)); + memset(m_Sections[i]->m_BlockMeta,0x00,sizeof(m_Sections[i]->m_BlockMeta)); + memset(m_Sections[i]->m_BlockLight,0x00,sizeof(m_Sections[i]->m_BlockLight)); } else { diff --git a/tests/ChunkBuffer/CMakeLists.txt b/tests/ChunkBuffer/CMakeLists.txt index 73dc79e25..b216b1d39 100644 --- a/tests/ChunkBuffer/CMakeLists.txt +++ b/tests/ChunkBuffer/CMakeLists.txt @@ -18,3 +18,8 @@ add_test(NAME coordinates-test COMMAND coordinates-exe) add_executable(copies-exe Copies.cpp) target_link_libraries(copies-exe ChunkBuffer) add_test(NAME copies-test COMMAND copies-exe) + +add_executable(arraystocoords-exe ArraytoCoord.cpp) +target_link_libraries(arraystocoords-exe ChunkBuffer) +add_test(NAME arraystocoords-test COMMAND arraystocoords-exe) + diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkBuffer/Copies.cpp index 07879d129..eb149f25f 100644 --- a/tests/ChunkBuffer/Copies.cpp +++ b/tests/ChunkBuffer/Copies.cpp @@ -99,7 +99,6 @@ int main(int argc, char** argv) DstBlockBuffer = NULL; SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); buffer.SetMeta(SrcNibbleBuffer); DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; From 97dc7d8f660c39a037526fa3d164066de218a6a2 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 11 May 2014 19:40:32 +0100 Subject: [PATCH 068/214] Added some more tests --- tests/ChunkBuffer/ArraytoCoord.cpp | 81 ++++++++ tests/ChunkBuffer/Copies.cpp | 285 +++++++++++++++++------------ 2 files changed, 246 insertions(+), 120 deletions(-) create mode 100644 tests/ChunkBuffer/ArraytoCoord.cpp diff --git a/tests/ChunkBuffer/ArraytoCoord.cpp b/tests/ChunkBuffer/ArraytoCoord.cpp new file mode 100644 index 000000000..a765c5302 --- /dev/null +++ b/tests/ChunkBuffer/ArraytoCoord.cpp @@ -0,0 +1,81 @@ + +#include "TestGlobals.h" +#include "ChunkBuffer.h" + + + +int main(int argc, char** argv) +{ + { + cChunkBuffer buffer; + + BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); + SrcBlockBuffer[7+4*16+5*16*16] = 0xCD; + buffer.SetBlocks(SrcBlockBuffer); + testassert(buffer.GetBlock(7,5,4) == 0xCD); + delete SrcBlockBuffer; + SrcBlockBuffer = NULL; + + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + SrcNibbleBuffer[(6+1*16+2*16*16)/2] = 0xE; + buffer.SetMeta(SrcNibbleBuffer); + testassert(buffer.GetMeta(6,2,1) == 0xE); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + SrcNibbleBuffer[(6+1*16+2*16*16)/2] = 0xE; + buffer.SetLight(SrcNibbleBuffer); + testassert(buffer.GetBlockLight(6,2,1) == 0xE); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + SrcNibbleBuffer[(6+1*16+2*16*16)/2] = 0xE; + buffer.SetSkyLight(SrcNibbleBuffer); + testassert(buffer.GetSkyLight(6,2,1) == 0xE); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + } + + { + cChunkBuffer buffer; + + BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); + SrcBlockBuffer[7+4*16+24*16*16] = 0xCD; + buffer.SetBlocks(SrcBlockBuffer); + testassert(buffer.GetBlock(7,24,4) == 0xCD); + delete SrcBlockBuffer; + SrcBlockBuffer = NULL; + + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + SrcNibbleBuffer[(6+1*16+24*16*16)/2] = 0xE; + buffer.SetMeta(SrcNibbleBuffer); + testassert(buffer.GetMeta(6,24,1) == 0xE); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + SrcNibbleBuffer[(6+1*16+24*16*16)/2] = 0xE; + buffer.SetLight(SrcNibbleBuffer); + testassert(buffer.GetBlockLight(6,24,1) == 0xE); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + SrcNibbleBuffer[(6+1*16+24*16*16)/2] = 0xE; + buffer.SetSkyLight(SrcNibbleBuffer); + testassert(buffer.GetSkyLight(6,24,1) == 0xE); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + } +} + diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkBuffer/Copies.cpp index eb149f25f..b37414ce4 100644 --- a/tests/ChunkBuffer/Copies.cpp +++ b/tests/ChunkBuffer/Copies.cpp @@ -6,128 +6,173 @@ int main(int argc, char** argv) { - cChunkBuffer buffer; - - buffer.SetBlock(3,1,4,0xDE); - buffer.SetMeta(3,1,4,0xA); - - cChunkBuffer copy = buffer.Copy(); - testassert(copy.GetBlock(3,1,4) == 0xDE); - testassert(copy.GetMeta(3,1,4) == 0xA); - - BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; - for (int i = 0; i < 16 * 16 * 256; i += 4) { - SrcBlockBuffer[i+0] = 0xDE; - SrcBlockBuffer[i+1] = 0xAD; - SrcBlockBuffer[i+2] = 0xBE; - SrcBlockBuffer[i+3] = 0xEF; + cChunkBuffer buffer; + + buffer.SetBlock(3,1,4,0xDE); + buffer.SetMeta(3,1,4,0xA); + + cChunkBuffer copy = buffer.Copy(); + testassert(copy.GetBlock(3,1,4) == 0xDE); + testassert(copy.GetMeta(3,1,4) == 0xA); + + BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + for (int i = 0; i < 16 * 16 * 256; i += 4) + { + SrcBlockBuffer[i+0] = 0xDE; + SrcBlockBuffer[i+1] = 0xAD; + SrcBlockBuffer[i+2] = 0xBE; + SrcBlockBuffer[i+3] = 0xEF; + } + + buffer.SetBlocks(SrcBlockBuffer); + BLOCKTYPE * DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + buffer.CopyBlocks(DstBlockBuffer); + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); + delete SrcBlockBuffer; + delete DstBlockBuffer; + SrcBlockBuffer = NULL; + DstBlockBuffer = NULL; + + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) + { + SrcNibbleBuffer[i+0] = 0xEF; + SrcNibbleBuffer[i+1] = 0xDE; + SrcNibbleBuffer[i+2] = 0xAD; + SrcNibbleBuffer[i+3] = 0xBE; + } + + buffer.SetMeta(SrcNibbleBuffer); + NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyMeta(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) + { + SrcNibbleBuffer[i+0] = 0xDE; + SrcNibbleBuffer[i+1] = 0xAD; + SrcNibbleBuffer[i+2] = 0xBE; + SrcNibbleBuffer[i+3] = 0xEF; + } + + buffer.SetLight(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) + { + SrcNibbleBuffer[i+0] = 0xAD; + SrcNibbleBuffer[i+1] = 0xBE; + SrcNibbleBuffer[i+2] = 0xEF; + SrcNibbleBuffer[i+3] = 0xDE; + } + + buffer.SetSkyLight(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopySkyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); + buffer.SetBlocks(SrcBlockBuffer); + DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + buffer.CopyBlocks(DstBlockBuffer); + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); + delete SrcBlockBuffer; + delete DstBlockBuffer; + SrcBlockBuffer = NULL; + DstBlockBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + buffer.SetMeta(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyMeta(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + buffer.SetLight(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); + buffer.SetSkyLight(SrcNibbleBuffer); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopySkyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; } - - buffer.SetBlocks(SrcBlockBuffer); - BLOCKTYPE * DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; - buffer.CopyBlocks(DstBlockBuffer); - testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); - delete SrcBlockBuffer; - delete DstBlockBuffer; - SrcBlockBuffer = NULL; - DstBlockBuffer = NULL; - - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) { - SrcNibbleBuffer[i+0] = 0xEF; - SrcNibbleBuffer[i+1] = 0xDE; - SrcNibbleBuffer[i+2] = 0xAD; - SrcNibbleBuffer[i+3] = 0xBE; + cChunkBuffer buffer; + + BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); + BLOCKTYPE * DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + buffer.CopyBlocks(DstBlockBuffer); + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); + delete SrcBlockBuffer; + delete DstBlockBuffer; + SrcBlockBuffer = NULL; + DstBlockBuffer = NULL; + + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyMeta(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); + DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopySkyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; } - - buffer.SetMeta(SrcNibbleBuffer); - NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopyMeta(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; - - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) - { - SrcNibbleBuffer[i+0] = 0xDE; - SrcNibbleBuffer[i+1] = 0xAD; - SrcNibbleBuffer[i+2] = 0xBE; - SrcNibbleBuffer[i+3] = 0xEF; - } - - buffer.SetLight(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; - - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) - { - SrcNibbleBuffer[i+0] = 0xAD; - SrcNibbleBuffer[i+1] = 0xBE; - SrcNibbleBuffer[i+2] = 0xEF; - SrcNibbleBuffer[i+3] = 0xDE; - } - - buffer.SetSkyLight(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopySkyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; - - SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; - memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - buffer.SetBlocks(SrcBlockBuffer); - DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; - buffer.CopyBlocks(DstBlockBuffer); - testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); - delete SrcBlockBuffer; - delete DstBlockBuffer; - SrcBlockBuffer = NULL; - DstBlockBuffer = NULL; - - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - buffer.SetMeta(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopyMeta(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; - - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - buffer.SetLight(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; - - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); - buffer.SetSkyLight(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopySkyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; } From 6cb348395468020ebac978d5a4968953e49d8b90 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 11 May 2014 21:41:25 +0300 Subject: [PATCH 069/214] Fixed compilation --- src/Entities/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Entities/CMakeLists.txt b/src/Entities/CMakeLists.txt index c9ca44d38..205cb2cca 100644 --- a/src/Entities/CMakeLists.txt +++ b/src/Entities/CMakeLists.txt @@ -10,3 +10,5 @@ file(GLOB SOURCE ) add_library(Entities ${SOURCE}) + +target_link_libraries(Entities WorldStorage) From c0727c426572745c72a61d26a84754d5a641d562 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 11 May 2014 22:35:41 +0200 Subject: [PATCH 070/214] Initial VillageGen implementation. WIP, doesn't generate anything yet. Ref.: 740. --- .../Prefabs/PlainsVillagePrefabs.cpp | 3726 +++++++++++++++++ src/Generating/Prefabs/PlainsVillagePrefabs.h | 15 + src/Generating/Prefabs/SandVillagePrefabs.cpp | 1887 +++++++++ src/Generating/Prefabs/SandVillagePrefabs.h | 15 + src/Generating/VillageGen.cpp | 116 + src/Generating/VillageGen.h | 48 + 6 files changed, 5807 insertions(+) create mode 100644 src/Generating/Prefabs/PlainsVillagePrefabs.cpp create mode 100644 src/Generating/Prefabs/PlainsVillagePrefabs.h create mode 100644 src/Generating/Prefabs/SandVillagePrefabs.cpp create mode 100644 src/Generating/Prefabs/SandVillagePrefabs.h create mode 100644 src/Generating/VillageGen.cpp create mode 100644 src/Generating/VillageGen.h diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp new file mode 100644 index 000000000..f59e22fb3 --- /dev/null +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -0,0 +1,3726 @@ + +// PlainsVillagePrefabs.cpp + +// Defines the prefabs in the group PlainsVillage + +// NOTE: This file has been generated automatically by GalExport! +// Any manual changes will be overwritten by the next automatic export! + +#include "Globals.h" +#include "PlainsVillagePrefabs.h" + + + + + +const cPrefab::sDef g_PlainsVillagePrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Forge: + // The data has been exported from the gallery Plains, area index 51, ID 102, created by Aloe_vera + { + // Size: + 12, 8, 11, // SizeX = 12, SizeY = 8, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 11, 7, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 6\n" /* wooddoorblock */ + "h: 10: 0\n" /* lava */ + "i: 54: 2\n" /* chest */ + "j: 61: 2\n" /* furnace */ + "k:102: 0\n" /* glasspane */ + "l: 64:12\n" /* wooddoorblock */ + "m: 19: 0\n" /* sponge */ + "n:139: 0\n" /* cobblestonewall */ + "o:101: 0\n" /* ironbars */ + "p: 53: 2\n" /* woodstairs */ + "q: 53: 7\n" /* woodstairs */ + "r: 50: 2\n" /* torch */ + "s: 50: 1\n" /* torch */ + "t: 53: 6\n" /* woodstairs */ + "u: 53: 3\n" /* woodstairs */ + "v: 43: 0\n" /* doubleslab */ + "w: 44: 0\n" /* step */, + + // Block data: + // Level 0 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ ".....abbbc.." + /* 1 */ ".ddddddddc.." + /* 2 */ ".ddddddddc.." + /* 3 */ ".ddddddddddd" + /* 4 */ ".ddddddddddd" + /* 5 */ ".ddddddddddd" + /* 6 */ ".ddddddddddd" + /* 7 */ ".ddddddddddd" + /* 8 */ ".ddddd.mmmmm" + /* 9 */ ".ddddd.mmmmm" + /* 10 */ ".......mmmmm" + + // Level 1 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".efffe......" + /* 2 */ ".f...g......" + /* 3 */ ".f...ed..ddd" + /* 4 */ ".f...f...dhd" + /* 5 */ ".f...f...dhd" + /* 6 */ ".f...fijjdhd" + /* 7 */ ".f...edddddd" + /* 8 */ ".f...f.mmmmm" + /* 9 */ ".efffe.mmmmm" + /* 10 */ ".......mmmmm" + + // Level 2 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".ekkke......" + /* 2 */ ".k...l......" + /* 3 */ ".k...en..n.d" + /* 4 */ ".k...k.....o" + /* 5 */ ".f...k.....o" + /* 6 */ ".k...k.....o" + /* 7 */ ".k...edooood" + /* 8 */ ".k...f.mmmmm" + /* 9 */ ".ekkke.mmmmm" + /* 10 */ ".......mmmmm" + + // Level 3 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "ppppppp....." + /* 1 */ "qfffffq....." + /* 2 */ ".f...f......" + /* 3 */ ".f..rfd..dod" + /* 4 */ ".f...f...o.d" + /* 5 */ ".f...f...o.d" + /* 6 */ ".fs..f...o.d" + /* 7 */ ".f...fdddddd" + /* 8 */ ".f...f.mmmmm" + /* 9 */ "tffffftmmmmm" + /* 10 */ "uuuuuuummmmm" + + // Level 4 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "ppppppp....." + /* 2 */ "qfffffq....." + /* 3 */ ".f...fvvvvvv" + /* 4 */ ".f...fvwwwwv" + /* 5 */ ".f...fvwwwwv" + /* 6 */ ".f...fvwwwwv" + /* 7 */ ".f...fvvvvvv" + /* 8 */ "tffffftmmmmm" + /* 9 */ "uuuuuuummmmm" + /* 10 */ ".......mmmmm" + + // Level 5 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "ppppppp....." + /* 3 */ "qfffffq....." + /* 4 */ ".f...f......" + /* 5 */ ".f...f......" + /* 6 */ ".f...f......" + /* 7 */ "tffffft....." + /* 8 */ "uuuuuuummmmm" + /* 9 */ ".......mmmmm" + /* 10 */ ".......mmmmm" + + // Level 6 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "ppppppp....." + /* 4 */ "qfffffq....." + /* 5 */ ".f...f......" + /* 6 */ "tffffft....." + /* 7 */ "uuuuuuu....." + /* 8 */ ".......mmmmm" + /* 9 */ ".......mmmmm" + /* 10 */ ".......mmmmm" + + // Level 7 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "............" + /* 4 */ "ppppppp....." + /* 5 */ "fffffff....." + /* 6 */ "uuuuuuu....." + /* 7 */ "............" + /* 8 */ ".......mmmmm" + /* 9 */ ".......mmmmm" + /* 10 */ ".......mmmmm", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Forge + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_100: + // The data has been exported from the gallery Plains, area index 49, ID 100, created by Aloe_vera + { + // Size: + 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 5, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 5\n" /* wooddoorblock */ + "h: 64:12\n" /* wooddoorblock */ + "i:102: 0\n" /* glasspane */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 50: 3\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 53: 6\n" /* woodstairs */ + "o: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "..abc.." + /* 1 */ ".ddddd." + /* 2 */ ".ddddd." + /* 3 */ ".ddddd." + /* 4 */ ".ddddd." + /* 5 */ ".ddddd." + /* 6 */ "......." + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".efgfe." + /* 2 */ ".f...f." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ ".efffe." + /* 6 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".efhfe." + /* 2 */ ".i...i." + /* 3 */ ".i...i." + /* 4 */ ".i...i." + /* 5 */ ".eiiie." + /* 6 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "jjjjjjj" + /* 1 */ "kfffffk" + /* 2 */ ".fl.lf." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ "nfffffn" + /* 6 */ "ooooooo" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "jjjjjjj" + /* 2 */ "kfffffk" + /* 3 */ ".f...f." + /* 4 */ "nfffffn" + /* 5 */ "ooooooo" + /* 6 */ "......." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "jjjjjjj" + /* 3 */ "fffffff" + /* 4 */ "ooooooo" + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_100 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_103: + // The data has been exported from the gallery Plains, area index 52, ID 103, created by Aloe_vera + { + // Size: + 11, 7, 9, // SizeX = 11, SizeY = 7, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 6, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 5\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 50: 3\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 50: 4\n" /* torch */ + "o: 53: 6\n" /* woodstairs */ + "p: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....abc...." + /* 1 */ ".ddddddddd." + /* 2 */ ".ddddddddd." + /* 3 */ ".ddddddddd." + /* 4 */ ".ddddddddd." + /* 5 */ ".ddddddddd." + /* 6 */ ".ddddddddd." + /* 7 */ ".ddddddddd." + /* 8 */ "..........." + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".efffgfffe." + /* 2 */ ".f.......f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".f.......f." + /* 6 */ ".f.......f." + /* 7 */ ".efffffffe." + /* 8 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ehhfifhhe." + /* 2 */ ".h.......h." + /* 3 */ ".h.......h." + /* 4 */ ".f.......f." + /* 5 */ ".h.......h." + /* 6 */ ".h.......h." + /* 7 */ ".ehhhfhhhe." + /* 8 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "jjjjjjjjjjj" + /* 1 */ "kfffffffffk" + /* 2 */ ".f..l.l..f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".f.......f." + /* 6 */ ".f...n...f." + /* 7 */ "offfffffffo" + /* 8 */ "ppppppppppp" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "jjjjjjjjjjj" + /* 2 */ "kfffffffffk" + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".f.......f." + /* 6 */ "offfffffffo" + /* 7 */ "ppppppppppp" + /* 8 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "jjjjjjjjjjj" + /* 3 */ "kfffffffffk" + /* 4 */ ".f.......f." + /* 5 */ "offfffffffo" + /* 6 */ "ppppppppppp" + /* 7 */ "..........." + /* 8 */ "..........." + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "jjjjjjjjjjj" + /* 4 */ "fffffffffff" + /* 5 */ "ppppppppppp" + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "...........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_103 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_105: + // The data has been exported from the gallery Plains, area index 54, ID 105, created by Aloe_vera + { + // Size: + 7, 6, 9, // SizeX = 7, SizeY = 6, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 5, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:170: 0\n" /* haybale */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 4: 0\n" /* cobblestone */ + "f: 17: 0\n" /* tree */ + "g: 5: 0\n" /* wood */ + "h:170: 4\n" /* haybale */ + "i:170: 8\n" /* haybale */ + "j: 54: 2\n" /* chest */ + "k: 50: 4\n" /* torch */ + "l: 53: 0\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 5\n" /* woodstairs */ + "o: 53: 4\n" /* woodstairs */ + "p: 53: 1\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "abcccd." + /* 1 */ ".eeeee." + /* 2 */ ".eeeee." + /* 3 */ ".eeeee." + /* 4 */ ".eeeee." + /* 5 */ ".eeeee." + /* 6 */ ".eeeee." + /* 7 */ ".eeeee." + /* 8 */ "......." + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".f..af." + /* 2 */ ".g...g." + /* 3 */ ".ga.hg." + /* 4 */ ".fihif." + /* 5 */ ".gaaag." + /* 6 */ ".gijag." + /* 7 */ ".fgfgf." + /* 8 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ ".k...k." + /* 1 */ ".f...f." + /* 2 */ ".g...g." + /* 3 */ ".g...g." + /* 4 */ ".fh..f." + /* 5 */ ".ghiag." + /* 6 */ ".ghiig." + /* 7 */ ".fgfgf." + /* 8 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "ln...op" + /* 1 */ "lgggggp" + /* 2 */ "lg...gp" + /* 3 */ "lg...gp" + /* 4 */ "lg...gp" + /* 5 */ "lgaa.gp" + /* 6 */ "lgiaigp" + /* 7 */ "lgggggp" + /* 8 */ "ln...op" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ ".ln.op." + /* 1 */ ".lgggp." + /* 2 */ ".lg.gp." + /* 3 */ ".lg.gp." + /* 4 */ ".lg.gp." + /* 5 */ ".lg.gp." + /* 6 */ ".lg.gp." + /* 7 */ ".lgggp." + /* 8 */ ".ln.op." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "..lgp.." + /* 1 */ "..lgp.." + /* 2 */ "..lgp.." + /* 3 */ "..lgp.." + /* 4 */ "..lgp.." + /* 5 */ "..lgp.." + /* 6 */ "..lgp.." + /* 7 */ "..lgp.." + /* 8 */ "..lgp..", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_105 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_106: + // The data has been exported from the gallery Plains, area index 55, ID 106, created by Aloe_vera + { + // Size: + 15, 8, 9, // SizeX = 15, SizeY = 8, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 7, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 3: 0\n" /* dirt */ + "f: 17: 0\n" /* tree */ + "g:107: 0\n" /* fencegate */ + "h:107: 4\n" /* fencegate */ + "i: 5: 0\n" /* wood */ + "j:107: 6\n" /* fencegate */ + "k: 85: 0\n" /* fence */ + "l:170: 0\n" /* haybale */ + "m: 19: 0\n" /* sponge */ + "n:170: 4\n" /* haybale */ + "o:170: 8\n" /* haybale */ + "p: 50: 1\n" /* torch */ + "q: 50: 2\n" /* torch */ + "r: 53: 2\n" /* woodstairs */ + "s: 53: 7\n" /* woodstairs */ + "t: 53: 6\n" /* woodstairs */ + "u: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ ".abbbbbbbbbbbc." + /* 1 */ ".ddddddddddddd." + /* 2 */ ".deeeeeeeeeeed." + /* 3 */ ".deeeeeeeeeeed." + /* 4 */ ".deeeeeeeeeeed." + /* 5 */ ".deeeeeeeeeeed." + /* 6 */ ".deeeeeeeeeeed." + /* 7 */ ".ddddddddddddd." + /* 8 */ "..............." + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".fghgighgigjgf." + /* 2 */ ".k...k...k...k." + /* 3 */ ".k...k...k...k." + /* 4 */ ".k...k...k...k." + /* 5 */ ".k...k...k...k." + /* 6 */ ".kl..k..nko..k." + /* 7 */ ".fkkkikkkikkkf." + /* 8 */ "..............." + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".f...i...i...f." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ ".f...i...i...f." + /* 8 */ "..............." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".fp.qip.qip.qf." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ ".f...i...i...f." + /* 8 */ "..............." + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "rrrrrrrrrrrrrrr" + /* 1 */ "siiiiiiiiiiiiis" + /* 2 */ ".i...........i." + /* 3 */ ".i...........i." + /* 4 */ ".i...........i." + /* 5 */ ".i...........i." + /* 6 */ ".i...........i." + /* 7 */ "tiiiiiiiiiiiiit" + /* 8 */ "uuuuuuuuuuuuuuu" + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "rrrrrrrrrrrrrrr" + /* 2 */ "siiiiiiiiiiiiis" + /* 3 */ ".i...........i." + /* 4 */ ".i...........i." + /* 5 */ ".i...........i." + /* 6 */ "tiiiiiiiiiiiiit" + /* 7 */ "uuuuuuuuuuuuuuu" + /* 8 */ "..............." + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "rrrrrrrrrrrrrrr" + /* 3 */ "siiiiiiiiiiiiis" + /* 4 */ ".i...........i." + /* 5 */ "tiiiiiiiiiiiiit" + /* 6 */ "uuuuuuuuuuuuuuu" + /* 7 */ "..............." + /* 8 */ "..............." + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "rrrrrrrrrrrrrrr" + /* 4 */ "iiiiiiiiiiiiiii" + /* 5 */ "uuuuuuuuuuuuuuu" + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "...............", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_106 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_109: + // The data has been exported from the gallery Plains, area index 58, ID 109, created by Aloe_vera + { + // Size: + 7, 14, 13, // SizeX = 7, SizeY = 14, SizeZ = 13 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 13, 12, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A: 85: 0\n" /* fence */ + "B:126: 8\n" /* woodenslab */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h: 65: 3\n" /* ladder */ + "i: 53: 3\n" /* woodstairs */ + "j: 53: 7\n" /* woodstairs */ + "k: 64:12\n" /* wooddoorblock */ + "l:102: 0\n" /* glasspane */ + "m: 19: 0\n" /* sponge */ + "n: 50: 1\n" /* torch */ + "o: 50: 2\n" /* torch */ + "p:171:14\n" /* carpet */ + "q: 50: 3\n" /* torch */ + "r: 53: 2\n" /* woodstairs */ + "s: 53: 0\n" /* woodstairs */ + "t: 53: 1\n" /* woodstairs */ + "u: 53: 5\n" /* woodstairs */ + "v: 53: 4\n" /* woodstairs */ + "w: 17: 4\n" /* tree */ + "x: 17: 8\n" /* tree */ + "y: 54: 2\n" /* chest */ + "z: 50: 4\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "..abc.." + /* 1 */ ".ddddd." + /* 2 */ ".ddddd." + /* 3 */ ".ddddd." + /* 4 */ ".ddddd." + /* 5 */ ".ddddd." + /* 6 */ ".ddddd." + /* 7 */ ".ddddd." + /* 8 */ ".ddddd." + /* 9 */ ".ddddd." + /* 10 */ ".ddddd." + /* 11 */ ".ddddd." + /* 12 */ "......." + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".efgfe." + /* 2 */ ".f..hf." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ ".ei.ie." + /* 6 */ ".f...f." + /* 7 */ ".fi.if." + /* 8 */ ".f...f." + /* 9 */ ".f.j.f." + /* 10 */ ".f...f." + /* 11 */ ".efffe." + /* 12 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".efkfe." + /* 2 */ ".l..hl." + /* 3 */ ".l...l." + /* 4 */ ".l...l." + /* 5 */ ".e...e." + /* 6 */ ".l...l." + /* 7 */ ".l...l." + /* 8 */ ".fn.of." + /* 9 */ ".l.p.l." + /* 10 */ ".l...l." + /* 11 */ ".ellle." + /* 12 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".efffe." + /* 2 */ ".f.qhf." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ "re...er" + /* 6 */ "sf...ft" + /* 7 */ "sf...ft" + /* 8 */ "sf...ft" + /* 9 */ "sf...ft" + /* 10 */ "sf...ft" + /* 11 */ "sefffft" + /* 12 */ "su...vt" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ewwwe." + /* 2 */ ".xffhx." + /* 3 */ ".xfffx." + /* 4 */ ".xfffx." + /* 5 */ ".ewwwe." + /* 6 */ ".sf.ft." + /* 7 */ ".sf.ft." + /* 8 */ ".sf.ft." + /* 9 */ ".sf.ft." + /* 10 */ ".sf.ft." + /* 11 */ ".sffft." + /* 12 */ ".su.vt." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".eflfe." + /* 2 */ ".f..hf." + /* 3 */ ".f...f." + /* 4 */ ".f.y.f." + /* 5 */ ".efffe." + /* 6 */ "..sft.." + /* 7 */ "..sft.." + /* 8 */ "..sft.." + /* 9 */ "..sft.." + /* 10 */ "..sft.." + /* 11 */ "..sft.." + /* 12 */ "..sft.." + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".eflfe." + /* 2 */ ".f..hf." + /* 3 */ ".l...l." + /* 4 */ ".f...f." + /* 5 */ ".efffe." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".eflfe." + /* 2 */ ".f..hf." + /* 3 */ ".f...f." + /* 4 */ ".f.z.f." + /* 5 */ ".efffe." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ewwwe." + /* 2 */ ".xffhx." + /* 3 */ ".xfffx." + /* 4 */ ".xfffx." + /* 5 */ ".ewwwe." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".eAAAe." + /* 2 */ ".A...A." + /* 3 */ ".A...A." + /* 4 */ ".A...A." + /* 5 */ ".eAAAe." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 10 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".e...e." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ ".e...e." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 11 + /* z\x* 0123456 */ + /* 0 */ "su...vt" + /* 1 */ "sefffet" + /* 2 */ "sfBBBft" + /* 3 */ "sfBBBft" + /* 4 */ "sfBBBft" + /* 5 */ "sffffft" + /* 6 */ "su...vt" + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 12 + /* z\x* 0123456 */ + /* 0 */ ".su.vt." + /* 1 */ ".sffft." + /* 2 */ ".sffft." + /* 3 */ ".sffft." + /* 4 */ ".sffft." + /* 5 */ ".sffft." + /* 6 */ ".su.vt." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 13 + /* z\x* 0123456 */ + /* 0 */ "..sft.." + /* 1 */ "..sft.." + /* 2 */ "..sft.." + /* 3 */ "..sft.." + /* 4 */ "..sft.." + /* 5 */ "..sft.." + /* 6 */ "..sft.." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ ".......", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_109 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_20: + // The data has been exported from the gallery Plains, area index 5, ID 20, created by tonibm1999 + { + // Size: + 15, 2, 9, // SizeX = 15, SizeY = 2, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 1, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 17: 0\n" /* tree */ + "b: 60: 7\n" /* tilleddirt */ + "c: 8: 0\n" /* water */ + "d: 50: 5\n" /* torch */ + "e: 59: 7\n" /* crops */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "aaaaaaamaaaaaaa" + /* 1 */ "abbcbbamabbcbba" + /* 2 */ "abbcbbamabbcbba" + /* 3 */ "abbcbbamabbcbba" + /* 4 */ "abbcbbamabbcbba" + /* 5 */ "abbcbbamabbcbba" + /* 6 */ "abbcbbamabbcbba" + /* 7 */ "abbcbbamabbcbba" + /* 8 */ "aaaaaaamaaaaaaa" + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "dmmmmmdmdmmmmmd" + /* 1 */ "meemeemmmeemeem" + /* 2 */ "memmmemmmeemeem" + /* 3 */ "memmmmmmmeemeem" + /* 4 */ "meemmemmmeemeem" + /* 5 */ "meemmemmmeemeem" + /* 6 */ "mmemmemmmeemeem" + /* 7 */ "mmememmmmeemeem" + /* 8 */ "dmmmmmdmdmmmmmd", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_20 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_26: + // The data has been exported from the gallery Plains, area index 9, ID 26, created by Aloe_vera + { + // Size: + 10, 6, 11, // SizeX = 10, SizeY = 6, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 5, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 4: 0\n" /* cobblestone */ + "b: 5: 0\n" /* wood */ + "c: 2: 0\n" /* grass */ + "d: 67: 2\n" /* stairs */ + "e: 43: 0\n" /* doubleslab */ + "f: 67: 0\n" /* stairs */ + "g: 67: 3\n" /* stairs */ + "h: 17: 0\n" /* tree */ + "i: 53: 1\n" /* woodstairs */ + "j: 85: 0\n" /* fence */ + "k: 53: 0\n" /* woodstairs */ + "l: 64: 4\n" /* wooddoorblock */ + "m: 19: 0\n" /* sponge */ + "n: 64: 0\n" /* wooddoorblock */ + "o:102: 0\n" /* glasspane */ + "p: 72: 0\n" /* woodplate */ + "q: 64:12\n" /* wooddoorblock */ + "r: 64: 8\n" /* wooddoorblock */ + "s: 53: 5\n" /* woodstairs */ + "t: 53: 4\n" /* woodstairs */ + "u: 50: 1\n" /* torch */ + "v: 50: 2\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "......mmmm" + /* 1 */ ".aaaaammmm" + /* 2 */ ".abbbammmm" + /* 3 */ ".abbbacccc" + /* 4 */ "daeeeacccc" + /* 5 */ "faeeeecccc" + /* 6 */ "gaeeeacccc" + /* 7 */ ".aeeeacccc" + /* 8 */ ".aeeeacccc" + /* 9 */ ".aaaaammmm" + /* 10 */ "......mmmm" + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "......mmmm" + /* 1 */ ".hbbbhmmmm" + /* 2 */ ".bijkbmmmm" + /* 3 */ ".b...bjjjj" + /* 4 */ ".b...b...j" + /* 5 */ ".l...n...j" + /* 6 */ ".b...b...j" + /* 7 */ ".bee.b...j" + /* 8 */ ".b...bjjjj" + /* 9 */ ".hbbbhmmmm" + /* 10 */ "......mmmm" + + // Level 2 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "......mmmm" + /* 1 */ ".hooohmmmm" + /* 2 */ ".o.p.ommmm" + /* 3 */ ".o...o...." + /* 4 */ ".b...b...." + /* 5 */ ".q...r...." + /* 6 */ ".b...b...." + /* 7 */ ".o...o...." + /* 8 */ ".o...o...." + /* 9 */ ".hooohmmmm" + /* 10 */ "......mmmm" + + // Level 3 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "ks...timmm" + /* 1 */ "khbbbhimmm" + /* 2 */ "kb...bimmm" + /* 3 */ "kb...bi..." + /* 4 */ "kbu.vbi..." + /* 5 */ "kb...bi..." + /* 6 */ "kbu.vbi..." + /* 7 */ "kb...bi..." + /* 8 */ "kb...bi..." + /* 9 */ "khbbbhimmm" + /* 10 */ "ks...timmm" + + // Level 4 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "mks.timmmm" + /* 1 */ "mkbbbimmmm" + /* 2 */ "mkb.bimmmm" + /* 3 */ "mkb.bim..." + /* 4 */ "mkb.bim..." + /* 5 */ "mkb.bim..." + /* 6 */ "mkb.bim..." + /* 7 */ "mkb.bim..." + /* 8 */ "mkb.bim..." + /* 9 */ "mkbbbimmmm" + /* 10 */ "mks.timmmm" + + // Level 5 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "mmkbimmmmm" + /* 1 */ "mmkbimmmmm" + /* 2 */ "mmkbimmmmm" + /* 3 */ "mmkbimm..." + /* 4 */ "mmkbimm..." + /* 5 */ "mmkbimm..." + /* 6 */ "mmkbimm..." + /* 7 */ "mmkbimm..." + /* 8 */ "mmkbimm..." + /* 9 */ "mmkbimmmmm" + /* 10 */ "mmkbimmmmm", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_26 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_4: + // The data has been exported from the gallery Plains, area index 0, ID 4, created by Aloe_vera + { + // Size: + 16, 7, 16, // SizeX = 16, SizeY = 7, SizeZ = 16 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 15, 6, 15, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 5: 0\n" /* wood */ + "f: 67: 3\n" /* stairs */ + "g: 17: 0\n" /* tree */ + "h: 64: 5\n" /* wooddoorblock */ + "i:102: 0\n" /* glasspane */ + "j: 64:12\n" /* wooddoorblock */ + "k: 53: 2\n" /* woodstairs */ + "l: 53: 1\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 7\n" /* woodstairs */ + "o: 53: 6\n" /* woodstairs */ + "p: 53: 3\n" /* woodstairs */ + "q: 53: 0\n" /* woodstairs */ + "r: 53: 5\n" /* woodstairs */ + "s: 53: 4\n" /* woodstairs */ + "t: 50: 3\n" /* torch */ + "u: 50: 2\n" /* torch */ + "v: 50: 4\n" /* torch */ + "w: 50: 1\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "........abc....." + /* 1 */ ".dddddddddddddd." + /* 2 */ ".deeeeeeeeeeeed." + /* 3 */ ".deeeeeeeeeeeed." + /* 4 */ ".deeeeeeeeeeeed." + /* 5 */ ".deeeeeeeeeeeed." + /* 6 */ ".deeeeeeeeeeeed." + /* 7 */ ".ddddddddeeeeed." + /* 8 */ "mmmmmafcdeeeeed." + /* 9 */ "mmmmmmmmdeeeeed." + /* 10 */ "mmmmmmmmdeeeeed." + /* 11 */ "mmmmmmmmdeeeeed." + /* 12 */ "mmmmmmmmdeeeeed." + /* 13 */ "mmmmmmmmdeeeeed." + /* 14 */ "mmmmmmmmddddddd." + /* 15 */ "mmmmmmmm........" + + // Level 1 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ ".geeeeeeghgeeeg." + /* 2 */ ".e............e." + /* 3 */ ".e............e." + /* 4 */ ".e............e." + /* 5 */ ".e............e." + /* 6 */ ".e............e." + /* 7 */ ".geeeeheg.....e." + /* 8 */ "mmmmmm.me.....e." + /* 9 */ "mmmmmmmme.....e." + /* 10 */ "mmmmmmmme.....e." + /* 11 */ "mmmmmmmme.....e." + /* 12 */ "mmmmmmmme.....e." + /* 13 */ "mmmmmmmme.....e." + /* 14 */ "mmmmmmmmgeeeeeg." + /* 15 */ "mmmmmmmm........" + + // Level 2 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ ".geiieiigjgiieg." + /* 2 */ ".i............e." + /* 3 */ ".i............i." + /* 4 */ ".i............i." + /* 5 */ ".i............e." + /* 6 */ ".i............i." + /* 7 */ ".geiiejeg.....i." + /* 8 */ "mmmmmm.me.....e." + /* 9 */ "mmmmmmmmi.....i." + /* 10 */ "mmmmmmmmi.....i." + /* 11 */ "mmmmmmmme.....e." + /* 12 */ "mmmmmmmmi.....i." + /* 13 */ "mmmmmmmmi.....i." + /* 14 */ "mmmmmmmmgiiiiig." + /* 15 */ "mmmmmmmm........" + + // Level 3 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "kkkkkkkkkkkkkkkl" + /* 1 */ "ngeeeeeegegeeegl" + /* 2 */ ".e............el" + /* 3 */ ".e............el" + /* 4 */ ".e............el" + /* 5 */ ".e............el" + /* 6 */ ".e............el" + /* 7 */ "ogeeeeeeg.....el" + /* 8 */ "pppppppqe.....el" + /* 9 */ "mmmmmmmqe.....el" + /* 10 */ "mmmmmmmqe.....el" + /* 11 */ "mmmmmmmqe.....el" + /* 12 */ "mmmmmmmqe.....el" + /* 13 */ "mmmmmmmqe.....el" + /* 14 */ "mmmmmmmqgeeeeegl" + /* 15 */ "mmmmmmmqr.....sl" + + // Level 4 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "kkkkkkkkkkkkkkk." + /* 2 */ "neeeeeeeeeeeeel." + /* 3 */ ".e.........t.el." + /* 4 */ ".e..........uel." + /* 5 */ ".e......v....el." + /* 6 */ "oeeeeeeeee...el." + /* 7 */ "ppppppppqew..el." + /* 8 */ "mmmmmmmmqe...el." + /* 9 */ "mmmmmmmmqe...el." + /* 10 */ "mmmmmmmmqe...el." + /* 11 */ "mmmmmmmmqe...el." + /* 12 */ "mmmmmmmmqe...el." + /* 13 */ "mmmmmmmmqe...el." + /* 14 */ "mmmmmmmmqeeeeel." + /* 15 */ "mmmmmmmmqr...sl." + + // Level 5 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "kkkkkkkkkkkkkl.." + /* 3 */ "neeeeeeeeeeeel.." + /* 4 */ ".ew.........el.." + /* 5 */ "oeeeeeeeeee.el.." + /* 6 */ "pppppppppqe.el.." + /* 7 */ ".........qe.el.." + /* 8 */ "mmmmmmmm.qe.el.." + /* 9 */ "mmmmmmmm.qe.el.." + /* 10 */ "mmmmmmmm.qe.el.." + /* 11 */ "mmmmmmmm.qe.el.." + /* 12 */ "mmmmmmmm.qe.el.." + /* 13 */ "mmmmmmmm.qevel.." + /* 14 */ "mmmmmmmm.qeeel.." + /* 15 */ "mmmmmmmm.qr.sl.." + + // Level 6 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "kkkkkkkkkkkkk..." + /* 4 */ "eeeeeeeeeeeel..." + /* 5 */ "ppppppppppqel..." + /* 6 */ "mmmmmmmmmmqel..." + /* 7 */ "mmmmmmmmmmqel..." + /* 8 */ "mmmmmmmmmmqel..." + /* 9 */ "mmmmmmmmmmqel..." + /* 10 */ "mmmmmmmmmmqel..." + /* 11 */ "mmmmmmmmmmqel..." + /* 12 */ "mmmmmmmmmmqel..." + /* 13 */ "mmmmmmmmmmqel..." + /* 14 */ "mmmmmmmmmmqel..." + /* 15 */ "mmmmmmmmmmqel...", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_4 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_60: + // The data has been exported from the gallery Plains, area index 17, ID 60, created by Aloe_vera + { + // Size: + 10, 2, 7, // SizeX = 10, SizeY = 2, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 1, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 17: 0\n" /* tree */ + "b: 60: 7\n" /* tilleddirt */ + "c: 8: 0\n" /* water */ + "d: 59: 7\n" /* crops */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "aaaaaaaaaa" + /* 1 */ "abbbbbbbba" + /* 2 */ "abbbbbbbba" + /* 3 */ "acccccccca" + /* 4 */ "abbbbbbbba" + /* 5 */ "abbbbbbbba" + /* 6 */ "aaaaaaaaaa" + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".dddddddd." + /* 2 */ ".dddddddd." + /* 3 */ ".........." + /* 4 */ ".dddddddd." + /* 5 */ ".dddddddd." + /* 6 */ "..........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_60 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_66: + // The data has been exported from the gallery Plains, area index 23, ID 66, created by xoft + { + // Size: + 12, 7, 7, // SizeX = 12, SizeY = 7, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 11, 6, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 2: 0\n" /* grass */ + "b: 3: 0\n" /* dirt */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 64: 1\n" /* wooddoorblock */ + "h: 53: 3\n" /* woodstairs */ + "i: 53: 1\n" /* woodstairs */ + "j: 85: 0\n" /* fence */ + "k: 53: 0\n" /* woodstairs */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n:102: 0\n" /* glasspane */ + "o: 64: 8\n" /* wooddoorblock */ + "p: 50: 3\n" /* torch */ + "q: 72: 0\n" /* woodplate */ + "r: 50: 4\n" /* torch */ + "s: 53: 7\n" /* woodstairs */ + "t: 47: 0\n" /* bookshelf */ + "u: 50: 1\n" /* torch */ + "v: 50: 2\n" /* torch */ + "w: 53: 6\n" /* woodstairs */ + "x: 5: 0\n" /* wood */, + + // Block data: + // Level 0 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "aaaaaaabbbaa" + /* 1 */ "abbbbbbbbbba" + /* 2 */ "abbbbbbbbbba" + /* 3 */ "abbbbbbbbbba" + /* 4 */ "abbbbbbbbbba" + /* 5 */ "abbbbbbbbbba" + /* 6 */ "aaaaaaaaaaaa" + + // Level 1 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ ".......cde.." + /* 1 */ ".ffffffffff." + /* 2 */ ".ffffffffff." + /* 3 */ ".ffffffffff." + /* 4 */ ".ffffffffff." + /* 5 */ ".ffffffffff." + /* 6 */ "............" + + // Level 2 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".fffffffgff." + /* 2 */ ".fh.ijk...f." + /* 3 */ ".fj.......f." + /* 4 */ ".fl.ijkijkf." + /* 5 */ ".ffffffffff." + /* 6 */ "............" + + // Level 3 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".fnnfnnfoff." + /* 2 */ ".n..pq.p.pn." + /* 3 */ ".nq.......n." + /* 4 */ ".n..rq.rq.n." + /* 5 */ ".fnnfnnfnnf." + /* 6 */ "............" + + // Level 4 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "llllllllllll" + /* 1 */ "sffffffffffs" + /* 2 */ ".fttttttttf." + /* 3 */ ".fu......vf." + /* 4 */ ".fttttttttf." + /* 5 */ "wffffffffffw" + /* 6 */ "hhhhhhhhhhhh" + + // Level 5 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "llllllllllll" + /* 2 */ "sxxxxxxxxxxs" + /* 3 */ ".xxxxxxxxxx." + /* 4 */ "wxxxxxxxxxxw" + /* 5 */ "hhhhhhhhhhhh" + /* 6 */ "............" + + // Level 6 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "llllllllllll" + /* 3 */ "xxxxxxxxxxxx" + /* 4 */ "hhhhhhhhhhhh" + /* 5 */ "............" + /* 6 */ "............", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_66 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_87: + // The data has been exported from the gallery Plains, area index 38, ID 87, created by Aloe_vera + { + // Size: + 11, 7, 9, // SizeX = 11, SizeY = 7, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 6, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 67: 3\n" /* stairs */ + "f: 17: 0\n" /* tree */ + "g: 5: 0\n" /* wood */ + "h: 64: 5\n" /* wooddoorblock */ + "i: 64: 7\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 64:12\n" /* wooddoorblock */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 7\n" /* woodstairs */ + "o: 17: 4\n" /* tree */ + "p: 17: 8\n" /* tree */ + "q: 50: 3\n" /* torch */ + "r: 50: 4\n" /* torch */ + "s: 53: 6\n" /* woodstairs */ + "t: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....abc...." + /* 1 */ ".ddddddddd." + /* 2 */ ".ddddddddd." + /* 3 */ ".ddddddddd." + /* 4 */ ".ddddddddd." + /* 5 */ ".ddddddddd." + /* 6 */ ".ddddddddd." + /* 7 */ ".ddddddddd." + /* 8 */ "....aec...." + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".fggfhfggf." + /* 2 */ ".g.......g." + /* 3 */ ".g.......g." + /* 4 */ ".f.......f." + /* 5 */ ".g.......g." + /* 6 */ ".g.......g." + /* 7 */ ".fggfifggf." + /* 8 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".fjjfkfjjf." + /* 2 */ ".j.......j." + /* 3 */ ".j.......j." + /* 4 */ ".f.......f." + /* 5 */ ".j.......j." + /* 6 */ ".j.......j." + /* 7 */ ".fjjfkfjjf." + /* 8 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "lllllllllll" + /* 1 */ "nfooooooofn" + /* 2 */ ".p..q.q..p." + /* 3 */ ".p.......p." + /* 4 */ ".p.......p." + /* 5 */ ".p.......p." + /* 6 */ ".p..r.r..p." + /* 7 */ "sfooooooofs" + /* 8 */ "ttttttttttt" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "lllllllllll" + /* 2 */ "ngggggggggn" + /* 3 */ ".g.......g." + /* 4 */ ".g.......g." + /* 5 */ ".g.......g." + /* 6 */ "sgggggggggs" + /* 7 */ "ttttttttttt" + /* 8 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "lllllllllll" + /* 3 */ "ngggggggggn" + /* 4 */ ".g.......g." + /* 5 */ "sgggggggggs" + /* 6 */ "ttttttttttt" + /* 7 */ "..........." + /* 8 */ "..........." + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "lllllllllll" + /* 4 */ "ggggggggggg" + /* 5 */ "ttttttttttt" + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "...........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_87 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_90: + // The data has been exported from the gallery Plains, area index 39, ID 90, created by STR_Warrior + { + // Size: + 15, 8, 16, // SizeX = 15, SizeY = 8, SizeZ = 16 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 7, 15, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A: 53: 7\n" /* woodstairs */ + "B: 53: 4\n" /* woodstairs */ + "C: 53: 5\n" /* woodstairs */ + "D: 53: 6\n" /* woodstairs */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 43: 0\n" /* doubleslab */ + "f: 17: 0\n" /* tree */ + "g: 5: 0\n" /* wood */ + "h: 64: 7\n" /* wooddoorblock */ + "i: 96: 8\n" /* trapdoor */ + "j: 61: 2\n" /* furnace */ + "k: 53: 3\n" /* woodstairs */ + "l: 85: 0\n" /* fence */ + "m: 19: 0\n" /* sponge */ + "n: 53: 2\n" /* woodstairs */ + "o: 53: 1\n" /* woodstairs */ + "p: 53: 0\n" /* woodstairs */ + "q: 47: 0\n" /* bookshelf */ + "r:102: 0\n" /* glasspane */ + "s: 64:12\n" /* wooddoorblock */ + "t: 72: 0\n" /* woodplate */ + "u: 17: 4\n" /* tree */ + "v: 17: 8\n" /* tree */ + "w: 50: 3\n" /* torch */ + "x: 50: 1\n" /* torch */ + "y: 50: 4\n" /* torch */ + "z: 50: 2\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "......abc......" + /* 1 */ ".ddddddddddddd." + /* 2 */ ".deeeedddddddd." + /* 3 */ ".deeeedddddddd." + /* 4 */ ".ddddddddddddd." + /* 5 */ ".ddddddddddddd." + /* 6 */ ".ddddddddddddd." + /* 7 */ "mddddddddddddd." + /* 8 */ "mmmmmmmmdddddd." + /* 9 */ "mmmmmmmmdddddd." + /* 10 */ "mmmmmmmmdddddd." + /* 11 */ "mmmmmmmmdddddd." + /* 12 */ "mmmmmmmmdddddd." + /* 13 */ "mmmmmmmmdddddd." + /* 14 */ "mmmmmmmmdddddd." + /* 15 */ "mmmmmmmm......." + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".fggggfhfggggf." + /* 2 */ ".g...i.......g." + /* 3 */ ".gjeee......kg." + /* 4 */ ".f..........lg." + /* 5 */ ".g..........ng." + /* 6 */ ".g.olp..ol...g." + /* 7 */ "mfggggggfn...f." + /* 8 */ "mmmmmmmmg....g." + /* 9 */ "mmmmmmmmgk...g." + /* 10 */ "mmmmmmmmgl..kg." + /* 11 */ "mmmmmmmmgn..lg." + /* 12 */ "mmmmmmmmg...ng." + /* 13 */ "mmmmmmmmgq..qg." + /* 14 */ "mmmmmmmmfggggf." + /* 15 */ "mmmmmmmm......." + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".fgrrgfsfgrrgf." + /* 2 */ ".g...........g." + /* 3 */ ".g...........r." + /* 4 */ ".f..........tr." + /* 5 */ ".g...........r." + /* 6 */ ".g..t....t...g." + /* 7 */ "mfgrrrrgf....f." + /* 8 */ "mmmmmmmmg....g." + /* 9 */ "mmmmmmmmr....r." + /* 10 */ "mmmmmmmmrt...r." + /* 11 */ "mmmmmmmmr...tr." + /* 12 */ "mmmmmmmmr....r." + /* 13 */ "mmmmmmmmgq..qg." + /* 14 */ "mmmmmmmmfgrrgf." + /* 15 */ "mmmmmmmm......." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".fuuuuuuuuuuuf." + /* 2 */ ".v....w.w....v." + /* 3 */ ".v...........v." + /* 4 */ ".vx..........v." + /* 5 */ ".v...........v." + /* 6 */ ".v......y....v." + /* 7 */ "mfuuuuuufx..zv." + /* 8 */ "mmmmmmmmv....v." + /* 9 */ "mmmmmmmmv....v." + /* 10 */ "mmmmmmmmv....v." + /* 11 */ "mmmmmmmmv....v." + /* 12 */ "mmmmmmmmv....v." + /* 13 */ "mmmmmmmmv.yy.v." + /* 14 */ "mmmmmmmmfuuuuf." + /* 15 */ "mmmmmmmm......." + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "nnnnnnnnnnnnnno" + /* 1 */ "pgggggggggggggo" + /* 2 */ "pgAAAAAAAAAABgo" + /* 3 */ "pgC.........Bgo" + /* 4 */ "pgC.........Bgo" + /* 5 */ "pgC.........Bgo" + /* 6 */ "pgCDDDDDDD..Bgo" + /* 7 */ "pggggggggC..Bgo" + /* 8 */ "pkkkkkkpgC..Bgo" + /* 9 */ "mmmmmmmpgC..Bgo" + /* 10 */ "mmmmmmmpgC..Bgo" + /* 11 */ "mmmmmmmpgC..Bgo" + /* 12 */ "mmmmmmmpgC..Bgo" + /* 13 */ "mmmmmmmpgCDDBgo" + /* 14 */ "mmmmmmmpggggggo" + /* 15 */ "mmmmmmmpkkkkkkk" + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "mmmmmmmmmmmmmmm" + /* 1 */ "mpnnnnnnnnnnnom" + /* 2 */ "mpgggggggggggom" + /* 3 */ "mpgggggggggggom" + /* 4 */ "mpgggggggggggom" + /* 5 */ "mpgggggggggggom" + /* 6 */ "mpgggggggggggom" + /* 7 */ "mpkkkkkkkggggom" + /* 8 */ "mmmmmmmmpggggom" + /* 9 */ "mmmmmmmmpggggom" + /* 10 */ "mmmmmmmmpggggom" + /* 11 */ "mmmmmmmmpggggom" + /* 12 */ "mmmmmmmmpggggom" + /* 13 */ "mmmmmmmmpggggom" + /* 14 */ "mmmmmmmmkkkkkom" + /* 15 */ "mmmmmmmmmmmmmmm" + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "mmmmmmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmmmmmm" + /* 2 */ "mmnnnnnnnnnnnmm" + /* 3 */ "mmpgggggggggomm" + /* 4 */ "mmpgggggggggomm" + /* 5 */ "mmpgggggggggomm" + /* 6 */ "mmkkkkkkkkggomm" + /* 7 */ "mmmmmmmmmpggomm" + /* 8 */ "mmmmmmmmmpggomm" + /* 9 */ "mmmmmmmmmpggomm" + /* 10 */ "mmmmmmmmmpggomm" + /* 11 */ "mmmmmmmmmpggomm" + /* 12 */ "mmmmmmmmmpggomm" + /* 13 */ "mmmmmmmmmkkkomm" + /* 14 */ "mmmmmmmmmmmmmmm" + /* 15 */ "mmmmmmmmmmmmmmm" + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "mmmmmmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmmmmmm" + /* 2 */ "mmmmmmmmmmmmmmm" + /* 3 */ "mmmpnnnnnnnommm" + /* 4 */ "mmmpgggggggommm" + /* 5 */ "mmmpkkkkkkpommm" + /* 6 */ "mmmmmmmmmmpommm" + /* 7 */ "mmmmmmmmmmpommm" + /* 8 */ "mmmmmmmmmmpommm" + /* 9 */ "mmmmmmmmmmpommm" + /* 10 */ "mmmmmmmmmmpommm" + /* 11 */ "mmmmmmmmmmpommm" + /* 12 */ "mmmmmmmmmmpkmmm" + /* 13 */ "mmmmmmmmmmmmmmm" + /* 14 */ "mmmmmmmmmmmmmmm" + /* 15 */ "mmmmmmmmmmmmmmm", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_90 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_91: + // The data has been exported from the gallery Plains, area index 40, ID 91, created by xoft + { + // Size: + 9, 7, 7, // SizeX = 9, SizeY = 7, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 6, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 2: 0\n" /* grass */ + "b: 3: 0\n" /* dirt */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 5\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 64:12\n" /* wooddoorblock */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 7\n" /* woodstairs */ + "o: 50: 3\n" /* torch */ + "p: 53: 6\n" /* woodstairs */ + "q: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "aaabbbaaa" + /* 1 */ "abbbbbbba" + /* 2 */ "abbbbbbba" + /* 3 */ "abbbbbbba" + /* 4 */ "abbbbbbba" + /* 5 */ "abbbbbbba" + /* 6 */ "aaaaaaaaa" + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "...cde..." + /* 1 */ ".fffffff." + /* 2 */ ".fffffff." + /* 3 */ ".fffffff." + /* 4 */ ".fffffff." + /* 5 */ ".fffffff." + /* 6 */ "........." + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".ghhihhg." + /* 2 */ ".h.....h." + /* 3 */ ".h.....h." + /* 4 */ ".h.....h." + /* 5 */ ".ghhhhhg." + /* 6 */ "........." + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".gjhkhjg." + /* 2 */ ".j.....j." + /* 3 */ ".j.....j." + /* 4 */ ".j.....j." + /* 5 */ ".gjjhjjg." + /* 6 */ "........." + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "lllllllll" + /* 1 */ "nghhhhhgn" + /* 2 */ ".h.o.o.h." + /* 3 */ ".h.....h." + /* 4 */ ".h.....h." + /* 5 */ "pghhhhhgp" + /* 6 */ "qqqqqqqqq" + + // Level 5 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "lllllllll" + /* 2 */ "nhhhhhhhn" + /* 3 */ ".h.....h." + /* 4 */ "phhhhhhhp" + /* 5 */ "qqqqqqqqq" + /* 6 */ "........." + + // Level 6 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "lllllllll" + /* 3 */ "hhhhhhhhh" + /* 4 */ "qqqqqqqqq" + /* 5 */ "........." + /* 6 */ ".........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_91 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_92: + // The data has been exported from the gallery Plains, area index 41, ID 92, created by xoft + { + // Size: + 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 5, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 5\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 50: 3\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 53: 6\n" /* woodstairs */ + "o: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....abc...." + /* 1 */ ".ddddddddd." + /* 2 */ ".ddddddddd." + /* 3 */ ".ddddddddd." + /* 4 */ ".ddddddddd." + /* 5 */ ".ddddddddd." + /* 6 */ "..........." + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".efffgfffe." + /* 2 */ ".f.......f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".efffffffe." + /* 6 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ehhfifhhe." + /* 2 */ ".h.......h." + /* 3 */ ".h.......h." + /* 4 */ ".h.......h." + /* 5 */ ".ehhhfhhhe." + /* 6 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "jjjjjjjjjjj" + /* 1 */ "kfffffffffk" + /* 2 */ ".f..l.l.ff." + /* 3 */ ".f......ff." + /* 4 */ ".f......ff." + /* 5 */ "nfffffffffn" + /* 6 */ "ooooooooooo" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "jjjjjjjjjjj" + /* 2 */ "kfffffffffk" + /* 3 */ ".fffffffff." + /* 4 */ "nfffffffffn" + /* 5 */ "ooooooooooo" + /* 6 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "jjjjjjjjjjj" + /* 3 */ "fffffffffff" + /* 4 */ "ooooooooooo" + /* 5 */ "..........." + /* 6 */ "...........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_92 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_93: + // The data has been exported from the gallery Plains, area index 42, ID 93, created by xoft + { + // Size: + 11, 6, 11, // SizeX = 11, SizeY = 6, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 5, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 5\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 53: 1\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 50: 3\n" /* torch */ + "o: 50: 4\n" /* torch */ + "p: 53: 6\n" /* woodstairs */ + "q: 50: 1\n" /* torch */ + "r: 50: 2\n" /* torch */ + "s: 53: 3\n" /* woodstairs */ + "t: 53: 0\n" /* woodstairs */ + "u: 53: 5\n" /* woodstairs */ + "v: 53: 4\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....abc...." + /* 1 */ ".ddddddddd." + /* 2 */ ".ddddddddd." + /* 3 */ ".ddddddddd." + /* 4 */ ".ddddddddd." + /* 5 */ ".ddddddddd." + /* 6 */ ".....ddddd." + /* 7 */ "mmmm.ddddd." + /* 8 */ "mmmm.ddddd." + /* 9 */ "mmmm.ddddd." + /* 10 */ "mmmm......." + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".efffgfffe." + /* 2 */ ".f.......f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".efffe...f." + /* 6 */ ".....f...f." + /* 7 */ "mmmm.f...f." + /* 8 */ "mmmm.f...f." + /* 9 */ "mmmm.efffe." + /* 10 */ "mmmm......." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ehhfifhhe." + /* 2 */ ".h.......h." + /* 3 */ ".h.......h." + /* 4 */ ".h.......h." + /* 5 */ ".ehhhe...f." + /* 6 */ ".....h...h." + /* 7 */ "mmmm.h...h." + /* 8 */ "mmmm.h...h." + /* 9 */ "mmmm.ehhhe." + /* 10 */ "mmmm......." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "jjjjjjjjjjj" + /* 1 */ "kfffffffffl" + /* 2 */ ".f..n.n..fl" + /* 3 */ ".f.......fl" + /* 4 */ ".f...o...fl" + /* 5 */ "pfffffq.rfl" + /* 6 */ "sssssf...fl" + /* 7 */ "mmmmtf...fl" + /* 8 */ "mmmmtf...fl" + /* 9 */ "mmmmtfffffl" + /* 10 */ "mmmmtu...vl" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "jjjjjjjjjl." + /* 2 */ "kffffffffl." + /* 3 */ ".f......fl." + /* 4 */ "pffffff.fl." + /* 5 */ "ssssssf.fl." + /* 6 */ ".....tf.fl." + /* 7 */ "mmmm.tf.fl." + /* 8 */ "mmmm.tf.fl." + /* 9 */ "mmmm.tfffl." + /* 10 */ "mmmm.tu.vl." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "jjjjjjjjj.." + /* 3 */ "ffffffffl.." + /* 4 */ "sssssstfl.." + /* 5 */ "......tfl.." + /* 6 */ "......tfl.." + /* 7 */ "mmmm..tfl.." + /* 8 */ "mmmm..tfl.." + /* 9 */ "mmmm..tfl.." + /* 10 */ "mmmm..tfl..", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_93 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_94: + // The data has been exported from the gallery Plains, area index 43, ID 94, created by xoft + { + // Size: + 15, 6, 11, // SizeX = 15, SizeY = 6, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 5, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 5\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 0\n" /* woodstairs */ + "l: 53: 1\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 50: 3\n" /* torch */ + "o: 50: 4\n" /* torch */ + "p: 50: 2\n" /* torch */ + "q: 50: 1\n" /* torch */ + "r: 53: 3\n" /* woodstairs */ + "s: 53: 5\n" /* woodstairs */ + "t: 53: 4\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "......abc......" + /* 1 */ ".ddddddddddddd." + /* 2 */ ".ddddddddddddd." + /* 3 */ ".ddddddddddddd." + /* 4 */ ".ddddddddddddd." + /* 5 */ ".ddddddddddddd." + /* 6 */ ".ddddd...ddddd." + /* 7 */ ".ddddd...ddddd." + /* 8 */ ".ddddd...ddddd." + /* 9 */ ".ddddd...ddddd." + /* 10 */ "..............." + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".efffffgfffffe." + /* 2 */ ".f...........f." + /* 3 */ ".f...........f." + /* 4 */ ".f...........f." + /* 5 */ ".f...efffe...f." + /* 6 */ ".f...f...f...f." + /* 7 */ ".f...f...f...f." + /* 8 */ ".f...f...f...f." + /* 9 */ ".efffe...efffe." + /* 10 */ "..............." + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".ehhhhfifhhhhe." + /* 2 */ ".h...........h." + /* 3 */ ".h...........h." + /* 4 */ ".h...........h." + /* 5 */ ".f...ehhhe...f." + /* 6 */ ".h...h...h...h." + /* 7 */ ".h...h...h...h." + /* 8 */ ".h...h...h...h." + /* 9 */ ".ehhhe...ehhhe." + /* 10 */ "..............." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "jjjjjjjjjjjjjjj" + /* 1 */ "kfffffffffffffl" + /* 2 */ "kf....n.n....fl" + /* 3 */ "kf...........fl" + /* 4 */ "kf...o...o...fl" + /* 5 */ "kf..pfffffq..fl" + /* 6 */ "kf...frrrf...fl" + /* 7 */ "kf...fl.kf...fl" + /* 8 */ "kf...fl.kf...fl" + /* 9 */ "kfffffl.kfffffl" + /* 10 */ "ks...tl.ks...tl" + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".jjjjjjjjjjjjl." + /* 2 */ ".kfffffffffffl." + /* 3 */ ".kfffffffffffl." + /* 4 */ ".kfffffffffffl." + /* 5 */ ".kffflrrrrfffl." + /* 6 */ ".kfffl...kfffl." + /* 7 */ ".kfffl...kfffl." + /* 8 */ ".kfffl...kfffl." + /* 9 */ ".kfffl...kfffl." + /* 10 */ ".ks.tl...ks.tl." + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..kjjjjjjjjjj.." + /* 3 */ "..kfffffffffl.." + /* 4 */ "..kflrrrrrkfl.." + /* 5 */ "..kfl.....kfl.." + /* 6 */ "..kfl.....kfl.." + /* 7 */ "..kfl.....kfl.." + /* 8 */ "..kfl.....kfl.." + /* 9 */ "..kfl.....kfl.." + /* 10 */ "..kfl.....kfl..", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_94 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_97: + // The data has been exported from the gallery Plains, area index 46, ID 97, created by Aloe_vera + { + // Size: + 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 5, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 5\n" /* wooddoorblock */ + "h: 53: 3\n" /* woodstairs */ + "i: 85: 0\n" /* fence */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 1\n" /* woodstairs */ + "l: 53: 0\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n:102: 0\n" /* glasspane */ + "o: 64:12\n" /* wooddoorblock */ + "p: 50: 3\n" /* torch */ + "q: 72: 0\n" /* woodplate */ + "r: 53: 7\n" /* woodstairs */ + "s: 47: 0\n" /* bookshelf */ + "t: 50: 1\n" /* torch */ + "u: 50: 2\n" /* torch */ + "v: 53: 6\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....abc...." + /* 1 */ ".ddddddddd." + /* 2 */ ".ddddddddd." + /* 3 */ ".ddddddddd." + /* 4 */ ".ddddddddd." + /* 5 */ ".ddddddddd." + /* 6 */ "..........." + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".efffgfffe." + /* 2 */ ".fh.....hf." + /* 3 */ ".fi.....if." + /* 4 */ ".fj.kil.jf." + /* 5 */ ".efffffffe." + /* 6 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ennfofnne." + /* 2 */ ".n..p.p..n." + /* 3 */ ".nq.....qn." + /* 4 */ ".n...q...n." + /* 5 */ ".ennnfnnne." + /* 6 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "jjjjjjjjjjj" + /* 1 */ "rfffffffffr" + /* 2 */ ".fsssssssf." + /* 3 */ ".ft.....uf." + /* 4 */ ".fsssssssf." + /* 5 */ "vfffffffffv" + /* 6 */ "hhhhhhhhhhh" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "jjjjjjjjjjj" + /* 2 */ "rfffffffffr" + /* 3 */ ".f.......f." + /* 4 */ "vfffffffffv" + /* 5 */ "hhhhhhhhhhh" + /* 6 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "jjjjjjjjjjj" + /* 3 */ "fffffffffff" + /* 4 */ "hhhhhhhhhhh" + /* 5 */ "..........." + /* 6 */ "...........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_97 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_98: + // The data has been exported from the gallery Plains, area index 47, ID 98, created by Aloe_vera + { + // Size: + 12, 7, 9, // SizeX = 12, SizeY = 7, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 11, 6, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 5\n" /* wooddoorblock */ + "h: 53: 3\n" /* woodstairs */ + "i: 85: 0\n" /* fence */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 1\n" /* woodstairs */ + "l: 53: 0\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n:102: 0\n" /* glasspane */ + "o: 64:13\n" /* wooddoorblock */ + "p: 64:12\n" /* wooddoorblock */ + "q: 50: 3\n" /* torch */ + "r: 72: 0\n" /* woodplate */ + "s: 53: 7\n" /* woodstairs */ + "t: 47: 0\n" /* bookshelf */ + "u: 50: 1\n" /* torch */ + "v: 50: 2\n" /* torch */ + "w: 53: 6\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "....abbc...." + /* 1 */ ".dddddddddd." + /* 2 */ ".dddddddddd." + /* 3 */ ".dddddddddd." + /* 4 */ ".dddddddddd." + /* 5 */ ".dddddddddd." + /* 6 */ ".dddddddddd." + /* 7 */ ".dddddddddd." + /* 8 */ "............" + + // Level 1 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".efffggfffe." + /* 2 */ ".f........f." + /* 3 */ ".fh......hf." + /* 4 */ ".fi......if." + /* 5 */ ".fj......jf." + /* 6 */ ".f.kilkil.f." + /* 7 */ ".effffffffe." + /* 8 */ "............" + + // Level 2 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".ennfopfnne." + /* 2 */ ".n..q..q..n." + /* 3 */ ".n........n." + /* 4 */ ".fr......rf." + /* 5 */ ".n........n." + /* 6 */ ".n..r..r..n." + /* 7 */ ".ennfnnfnne." + /* 8 */ "............" + + // Level 3 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "jjjjjjjjjjjj" + /* 1 */ "sffffffffffs" + /* 2 */ ".fttttttttf." + /* 3 */ ".f........f." + /* 4 */ ".fu......vf." + /* 5 */ ".f........f." + /* 6 */ ".fttttttttf." + /* 7 */ "wffffffffffw" + /* 8 */ "hhhhhhhhhhhh" + + // Level 4 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "jjjjjjjjjjjj" + /* 2 */ "sffffffffffs" + /* 3 */ ".fttttttttf." + /* 4 */ ".f........f." + /* 5 */ ".fttttttttf." + /* 6 */ "wffffffffffw" + /* 7 */ "hhhhhhhhhhhh" + /* 8 */ "............" + + // Level 5 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "jjjjjjjjjjjj" + /* 3 */ "sffffffffffs" + /* 4 */ ".f........f." + /* 5 */ "wffffffffffw" + /* 6 */ "hhhhhhhhhhhh" + /* 7 */ "............" + /* 8 */ "............" + + // Level 6 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "jjjjjjjjjjjj" + /* 4 */ "ffffffffffff" + /* 5 */ "hhhhhhhhhhhh" + /* 6 */ "............" + /* 7 */ "............" + /* 8 */ "............", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_98 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // PlainsVillage_99: + // The data has been exported from the gallery Plains, area index 48, ID 99, created by Aloe_vera + { + // Size: + 11, 7, 13, // SizeX = 11, SizeY = 7, SizeZ = 13 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 6, 12, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 67: 0\n" /* stairs */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 4: 0\n" /* cobblestone */ + "e: 43: 0\n" /* doubleslab */ + "f: 2: 0\n" /* grass */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 5\n" /* wooddoorblock */ + "j: 53: 3\n" /* woodstairs */ + "k: 85: 0\n" /* fence */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 64: 7\n" /* wooddoorblock */ + "o:102: 0\n" /* glasspane */ + "p: 64:12\n" /* wooddoorblock */ + "q: 72: 0\n" /* woodplate */ + "r: 53: 7\n" /* woodstairs */ + "s: 50: 1\n" /* torch */ + "t: 50: 2\n" /* torch */ + "u: 53: 6\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....abc...." + /* 1 */ ".ddddddddd." + /* 2 */ ".deeeedddd." + /* 3 */ ".deeeedddd." + /* 4 */ ".deeeedddd." + /* 5 */ ".deeeedddd." + /* 6 */ ".deeeedddd." + /* 7 */ ".ddddddddd." + /* 8 */ "..fffffff.." + /* 9 */ "mmfffffffmm" + /* 10 */ "mmfffffffmm" + /* 11 */ "mmfffffffmm" + /* 12 */ "mmfffffffmm" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ghhhihhhg." + /* 2 */ ".h.e....jh." + /* 3 */ ".h.e....kh." + /* 4 */ ".h.e....lh." + /* 5 */ ".h.......h." + /* 6 */ ".h.......h." + /* 7 */ ".ghhhnhhhg." + /* 8 */ "..k.....k.." + /* 9 */ "mmk.....kmm" + /* 10 */ "mmk.....kmm" + /* 11 */ "mmk.....kmm" + /* 12 */ "mmkkkkkkkmm" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".goohphoog." + /* 2 */ ".o.......o." + /* 3 */ ".o......qo." + /* 4 */ ".h.......h." + /* 5 */ ".o.......o." + /* 6 */ ".o.......o." + /* 7 */ ".goohphoog." + /* 8 */ "..........." + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm" + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "lllllllllll" + /* 1 */ "rhhhhhhhhhr" + /* 2 */ ".h.......h." + /* 3 */ ".h.......h." + /* 4 */ ".hs.....th." + /* 5 */ ".h.......h." + /* 6 */ ".h.......h." + /* 7 */ "uhhhhhhhhhu" + /* 8 */ "jjjjjjjjjjj" + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "lllllllllll" + /* 2 */ "rhhhhhhhhhr" + /* 3 */ ".h.......h." + /* 4 */ ".h.......h." + /* 5 */ ".h.......h." + /* 6 */ "uhhhhhhhhhu" + /* 7 */ "jjjjjjjjjjj" + /* 8 */ "..........." + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "lllllllllll" + /* 3 */ "rhhhhhhhhhr" + /* 4 */ ".h.......h." + /* 5 */ "uhhhhhhhhhu" + /* 6 */ "jjjjjjjjjjj" + /* 7 */ "..........." + /* 8 */ "..........." + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "lllllllllll" + /* 4 */ "hhhhhhhhhhh" + /* 5 */ "jjjjjjjjjjj" + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "..........." + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // PlainsVillage_99 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // RoofedWell: + // The data has been exported from the gallery Plains, area index 119, ID 271, created by STR_Warrior + { + // Size: + 7, 15, 7, // SizeX = 7, SizeY = 15, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 14, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 1: 0\n" /* stone */ + "b: 4: 0\n" /* cobblestone */ + "c: 8: 0\n" /* water */ + "d: 3: 0\n" /* dirt */ + "e: 2: 0\n" /* grass */ + "f: 13: 0\n" /* gravel */ + "g:118: 3\n" /* cauldronblock */ + "h: 85: 0\n" /* fence */ + "i: 53: 2\n" /* woodstairs */ + "j: 53: 7\n" /* woodstairs */ + "k: 5: 0\n" /* wood */ + "l: 53: 4\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 5\n" /* woodstairs */ + "o: 53: 6\n" /* woodstairs */ + "p: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaaaaa" + /* 3 */ "aaaaaaa" + /* 4 */ "aaaaaaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "eefffee" + /* 1 */ "ebbbbbe" + /* 2 */ "fbcccbf" + /* 3 */ "fbcccbf" + /* 4 */ "fbcccbf" + /* 5 */ "ebbbbbe" + /* 6 */ "eefffee" + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".bbbbb." + /* 2 */ ".b...b." + /* 3 */ ".b.g.b." + /* 4 */ ".b...b." + /* 5 */ ".bbbbb." + /* 6 */ "......." + + // Level 10 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".h...h." + /* 2 */ "......." + /* 3 */ "...h..." + /* 4 */ "......." + /* 5 */ ".h...h." + /* 6 */ "......." + + // Level 11 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".h...h." + /* 2 */ "......." + /* 3 */ "...h..." + /* 4 */ "......." + /* 5 */ ".h...h." + /* 6 */ "......." + + // Level 12 + /* z\x* 0123456 */ + /* 0 */ "iiiiiii" + /* 1 */ "jkjjjkj" + /* 2 */ ".l...n." + /* 3 */ ".l.h.n." + /* 4 */ ".l...n." + /* 5 */ "okoooko" + /* 6 */ "ppppppp" + + // Level 13 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "iiiiiii" + /* 2 */ "jkjjjkj" + /* 3 */ ".k.h.k." + /* 4 */ "okoooko" + /* 5 */ "ppppppp" + /* 6 */ "......." + + // Level 14 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "iiiiiii" + /* 3 */ "kkkkkkk" + /* 4 */ "ppppppp" + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // RoofedWell + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Windmill: + // The data has been exported from the gallery Plains, area index 60, ID 111, created by Aloe_vera + { + // Size: + 9, 16, 13, // SizeX = 9, SizeY = 16, SizeZ = 13 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 15, 12, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 67: 3\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 54: 4\n" /* chest */ + "h:154: 4\n" /* hopper */ + "i: 64: 6\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 85: 0\n" /* fence */ + "l: 64:12\n" /* wooddoorblock */ + "m: 19: 0\n" /* sponge */ + "n: 50: 2\n" /* torch */ + "o: 35: 0\n" /* wool */ + "p: 17: 4\n" /* tree */ + "q: 17: 8\n" /* tree */ + "r: 53: 2\n" /* woodstairs */ + "s: 53: 7\n" /* woodstairs */ + "t: 53: 6\n" /* woodstairs */ + "u: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".aaaaa..." + /* 5 */ ".aaaaab.." + /* 6 */ ".aaaaac.." + /* 7 */ ".aaaaad.." + /* 8 */ ".aaaaa..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".efffe..." + /* 5 */ ".f...f..." + /* 6 */ ".fgh.i..." + /* 7 */ ".f...f..." + /* 8 */ ".efffe..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".ejjje..." + /* 5 */ ".j...f..." + /* 6 */ ".j.k.l..." + /* 7 */ ".j...f..." + /* 8 */ ".ejjje..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".efffe..." + /* 5 */ ".f..nf..." + /* 6 */ ".f.k.f..." + /* 7 */ ".f..nf..k" + /* 8 */ ".efffe..o" + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".epppe..." + /* 5 */ ".q...q..." + /* 6 */ ".q.k.q..." + /* 7 */ ".q...q..k" + /* 8 */ ".epppe..o" + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 5 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".efffe..." + /* 5 */ ".f...f..." + /* 6 */ ".f.k.f..k" + /* 7 */ ".f...f..o" + /* 8 */ ".efffe..o" + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 6 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".ejjje..." + /* 5 */ ".j...j..." + /* 6 */ ".j.k.j..k" + /* 7 */ ".j...j..o" + /* 8 */ ".ejjje..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 7 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.o" + /* 1 */ "mmmmmmm.o" + /* 2 */ "mmmmmmm.o" + /* 3 */ "........." + /* 4 */ ".efffe..." + /* 5 */ ".f...f..k" + /* 6 */ ".f.k.f..o" + /* 7 */ ".f...f..o" + /* 8 */ ".efffe..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 8 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.k" + /* 1 */ "mmmmmmm.k" + /* 2 */ "mmmmmmm.o" + /* 3 */ "........o" + /* 4 */ ".epppe..o" + /* 5 */ ".q...q..k" + /* 6 */ ".q.k.q..o" + /* 7 */ ".q...q..k" + /* 8 */ ".epppe..k" + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 9 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.k" + /* 3 */ "rrrrrrr.k" + /* 4 */ "sfffffs.o" + /* 5 */ ".f...f..o" + /* 6 */ ".f.kppppp" + /* 7 */ ".f...f..o" + /* 8 */ "tffffft.o" + /* 9 */ "uuuuuuu.k" + /* 10 */ "mmmmmmm.k" + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 10 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "mmmmmmm.." + /* 4 */ "rrrrrrr.k" + /* 5 */ "sfffffs.k" + /* 6 */ ".f...f..o" + /* 7 */ "tffffft.k" + /* 8 */ "uuuuuuu.o" + /* 9 */ "mmmmmmm.o" + /* 10 */ "mmmmmmm.o" + /* 11 */ "mmmmmmm.k" + /* 12 */ "mmmmmmm.k" + + // Level 11 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "mmmmmmm.." + /* 4 */ "mmmmmmm.." + /* 5 */ "rrrrrrr.o" + /* 6 */ "fffffff.o" + /* 7 */ "uuuuuuu.k" + /* 8 */ "mmmmmmm.." + /* 9 */ "mmmmmmm.." + /* 10 */ "mmmmmmm.o" + /* 11 */ "mmmmmmm.o" + /* 12 */ "mmmmmmm.o" + + // Level 12 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........." + /* 5 */ "........o" + /* 6 */ "........k" + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." + + // Level 13 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........o" + /* 5 */ "........o" + /* 6 */ "........k" + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." + + // Level 14 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........o" + /* 5 */ "........k" + /* 6 */ "........." + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." + + // Level 15 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........o" + /* 5 */ "........k" + /* 6 */ "........." + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ ".........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Windmill +}; // g_PlainsVillagePrefabs + + + + + + +const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Well: + // The data has been exported from the gallery Plains, area index 1, ID 5, created by Aloe_vera + { + // Size: + 4, 13, 4, // SizeX = 4, SizeY = 13, SizeZ = 4 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 3, 12, 3, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 1: 0\n" /* stone */ + "b: 4: 0\n" /* cobblestone */ + "c: 8: 0\n" /* water */ + "d: 85: 0\n" /* fence */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123 */ + /* 0 */ "aaaa" + /* 1 */ "aaaa" + /* 2 */ "aaaa" + /* 3 */ "aaaa" + + // Level 1 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 2 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 3 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 4 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 5 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 6 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 7 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 8 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 9 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "b..b" + /* 2 */ "b..b" + /* 3 */ "bbbb" + + // Level 10 + /* z\x* 0123 */ + /* 0 */ "d..d" + /* 1 */ "...." + /* 2 */ "...." + /* 3 */ "d..d" + + // Level 11 + /* z\x* 0123 */ + /* 0 */ "d..d" + /* 1 */ "...." + /* 2 */ "...." + /* 3 */ "d..d" + + // Level 12 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bbbb" + /* 2 */ "bbbb" + /* 3 */ "bbbb", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Well +}; + + + + + +// The prefab counts: + +const size_t g_PlainsVillagePrefabsCount = ARRAYCOUNT(g_PlainsVillagePrefabs); + +const size_t g_PlainsVillageStartingPrefabsCount = ARRAYCOUNT(g_PlainsVillageStartingPrefabs); + diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.h b/src/Generating/Prefabs/PlainsVillagePrefabs.h new file mode 100644 index 000000000..087783b1e --- /dev/null +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.h @@ -0,0 +1,15 @@ + +// PlainsVillagePrefabs.h + +// Declares the prefabs in the group PlainsVillage + +#include "../Prefab.h" + + + + + +extern const cPrefab::sDef g_PlainsVillagePrefabs[]; +extern const cPrefab::sDef g_PlainsVillageStartingPrefabs[]; +extern const size_t g_PlainsVillagePrefabsCount; +extern const size_t g_PlainsVillageStartingPrefabsCount; diff --git a/src/Generating/Prefabs/SandVillagePrefabs.cpp b/src/Generating/Prefabs/SandVillagePrefabs.cpp new file mode 100644 index 000000000..23af0f0a6 --- /dev/null +++ b/src/Generating/Prefabs/SandVillagePrefabs.cpp @@ -0,0 +1,1887 @@ + +// SandVillagePrefabs.cpp + +// Defines the prefabs in the group SandVillage + +// NOTE: This file has been generated automatically by GalExport! +// Any manual changes will be overwritten by the next automatic export! + +#include "Globals.h" +#include "SandVillagePrefabs.h" + + + + + +const cPrefab::sDef g_SandVillagePrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // DoubleField: + // The data has been exported from the gallery Desert, area index 5, ID 75, created by tonibm1999 + { + // Size: + 13, 2, 9, // SizeX = 13, SizeY = 2, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 1, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 24: 0\n" /* sandstone */ + "b: 60: 7\n" /* tilleddirt */ + "c: 8: 0\n" /* water */ + "d: 50: 5\n" /* torch */ + "e: 59: 7\n" /* crops */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "aaaaaaaaaaaaa" + /* 1 */ "abbcbbabbcbba" + /* 2 */ "abbcbbabbcbba" + /* 3 */ "abbcbbabbcbba" + /* 4 */ "abbcbbabbcbba" + /* 5 */ "abbcbbabbcbba" + /* 6 */ "abbcbbabbcbba" + /* 7 */ "abbcbbabbcbba" + /* 8 */ "aaaaaaaaaaaaa" + + // Level 1 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "d.....d.....d" + /* 1 */ ".......ee.ee." + /* 2 */ ".......ee.ee." + /* 3 */ ".......ee.ee." + /* 4 */ ".......ee.ee." + /* 5 */ ".......ee.ee." + /* 6 */ ".......ee.ee." + /* 7 */ ".......ee.ee." + /* 8 */ "d.....d.....d", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // DoubleField + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House11x7: + // The data has been exported from the gallery Desert, area index 6, ID 81, created by Aloe_vera + { + // Size: + 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 5, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 5\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64:12\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n: 50: 1\n" /* torch */ + "o: 50: 2\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....abc...." + /* 1 */ ".ddddddddd." + /* 2 */ ".ddddddddd." + /* 3 */ ".ddddddddd." + /* 4 */ ".ddddddddd." + /* 5 */ ".ddddddddd." + /* 6 */ "..........." + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ddddedddd." + /* 2 */ ".d.......d." + /* 3 */ ".d.......d." + /* 4 */ ".d.......d." + /* 5 */ ".ddddddddd." + /* 6 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".dffdgdffd." + /* 2 */ ".f.......f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".dffdfdffd." + /* 6 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "bbbbbbbbbbb" + /* 1 */ "hdddddddddh" + /* 2 */ ".d..i.i..d." + /* 3 */ ".d.......d." + /* 4 */ ".d..j.j..d." + /* 5 */ "kdddddddddk" + /* 6 */ "lllllllllll" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "bbbbbbbbbbb" + /* 2 */ "hdddddddddh" + /* 3 */ ".dn.....od." + /* 4 */ "kdddddddddk" + /* 5 */ "lllllllllll" + /* 6 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "bbbbbbbbbbb" + /* 3 */ "ddddddddddd" + /* 4 */ "lllllllllll" + /* 5 */ "..........." + /* 6 */ "...........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House11x7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House11x9: + // The data has been exported from the gallery Desert, area index 11, ID 115, created by xoft + { + // Size: + 11, 7, 9, // SizeX = 11, SizeY = 7, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 6, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 5\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64:12\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....abc...." + /* 1 */ ".ddddddddd." + /* 2 */ ".ddddddddd." + /* 3 */ ".ddddddddd." + /* 4 */ ".ddddddddd." + /* 5 */ ".ddddddddd." + /* 6 */ ".ddddddddd." + /* 7 */ ".ddddddddd." + /* 8 */ "..........." + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ddddedddd." + /* 2 */ ".d.......d." + /* 3 */ ".d.......d." + /* 4 */ ".d.......d." + /* 5 */ ".d.......d." + /* 6 */ ".d.......d." + /* 7 */ ".ddddddddd." + /* 8 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".dffdgdffd." + /* 2 */ ".f.......f." + /* 3 */ ".f.......f." + /* 4 */ ".d.......d." + /* 5 */ ".f.......f." + /* 6 */ ".f.......f." + /* 7 */ ".dfffdfffd." + /* 8 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "bbbbbbbbbbb" + /* 1 */ "hdddddddddh" + /* 2 */ ".d..i.i..d." + /* 3 */ ".d.......d." + /* 4 */ ".d.......d." + /* 5 */ ".d.......d." + /* 6 */ ".d...j...d." + /* 7 */ "kdddddddddk" + /* 8 */ "lllllllllll" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "bbbbbbbbbbb" + /* 2 */ "hdddddddddh" + /* 3 */ ".d.......d." + /* 4 */ ".d.......d." + /* 5 */ ".d.......d." + /* 6 */ "kdddddddddk" + /* 7 */ "lllllllllll" + /* 8 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "bbbbbbbbbbb" + /* 3 */ "hdddddddddh" + /* 4 */ ".d.......d." + /* 5 */ "kdddddddddk" + /* 6 */ "lllllllllll" + /* 7 */ "..........." + /* 8 */ "..........." + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "bbbbbbbbbbb" + /* 4 */ "ddddddddddd" + /* 5 */ "lllllllllll" + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "...........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House11x9 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House13x7: + // The data has been exported from the gallery Desert, area index 15, ID 125, created by Aloe_vera + { + // Size: + 13, 6, 7, // SizeX = 13, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 5, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 5\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64:12\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ ".....abc....." + /* 1 */ ".ddddddddddd." + /* 2 */ ".ddddddddddd." + /* 3 */ ".ddddddddddd." + /* 4 */ ".ddddddddddd." + /* 5 */ ".ddddddddddd." + /* 6 */ "............." + + // Level 1 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ ".dddddeddddd." + /* 2 */ ".d.........d." + /* 3 */ ".d.........d." + /* 4 */ ".d.........d." + /* 5 */ ".ddddddddddd." + /* 6 */ "............." + + // Level 2 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ ".dfffdgdfffd." + /* 2 */ ".f.........f." + /* 3 */ ".f.........f." + /* 4 */ ".f.........f." + /* 5 */ ".dffdfffdffd." + /* 6 */ "............." + + // Level 3 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "bbbbbbbbbbbbb" + /* 1 */ "hdddddddddddh" + /* 2 */ ".d...i.i...d." + /* 3 */ ".d.........d." + /* 4 */ ".d..j...j..d." + /* 5 */ "kdddddddddddk" + /* 6 */ "lllllllllllll" + + // Level 4 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "bbbbbbbbbbbbb" + /* 2 */ "hdddddddddddh" + /* 3 */ ".d.........d." + /* 4 */ "kdddddddddddk" + /* 5 */ "lllllllllllll" + /* 6 */ "............." + + // Level 5 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "bbbbbbbbbbbbb" + /* 3 */ "ddddddddddddd" + /* 4 */ "lllllllllllll" + /* 5 */ "............." + /* 6 */ ".............", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House13x7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House13x9: + // The data has been exported from the gallery Desert, area index 12, ID 116, created by xoft + { + // Size: + 13, 7, 9, // SizeX = 13, SizeY = 7, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 6, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 5\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64:12\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ ".....abc....." + /* 1 */ ".ddddddddddd." + /* 2 */ ".ddddddddddd." + /* 3 */ ".ddddddddddd." + /* 4 */ ".ddddddddddd." + /* 5 */ ".ddddddddddd." + /* 6 */ ".ddddddddddd." + /* 7 */ ".ddddddddddd." + /* 8 */ "............." + + // Level 1 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ ".dddddeddddd." + /* 2 */ ".d.........d." + /* 3 */ ".d.........d." + /* 4 */ ".d.........d." + /* 5 */ ".d.........d." + /* 6 */ ".d.........d." + /* 7 */ ".ddddddddddd." + /* 8 */ "............." + + // Level 2 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ ".dfffdgdfffd." + /* 2 */ ".f.........f." + /* 3 */ ".f.........f." + /* 4 */ ".d.........d." + /* 5 */ ".f.........f." + /* 6 */ ".f.........f." + /* 7 */ ".dffdffdfffd." + /* 8 */ "............." + + // Level 3 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "bbbbbbbbbbbbb" + /* 1 */ "hdddddddddddh" + /* 2 */ ".d...i.i...d." + /* 3 */ ".d.........d." + /* 4 */ ".d.........d." + /* 5 */ ".d.........d." + /* 6 */ ".d..j..j...d." + /* 7 */ "kdddddddddddk" + /* 8 */ "lllllllllllll" + + // Level 4 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "bbbbbbbbbbbbb" + /* 2 */ "hdddddddddddh" + /* 3 */ ".d.........d." + /* 4 */ ".d.........d." + /* 5 */ ".d.........d." + /* 6 */ "kdddddddddddk" + /* 7 */ "lllllllllllll" + /* 8 */ "............." + + // Level 5 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "bbbbbbbbbbbbb" + /* 3 */ "hdddddddddddh" + /* 4 */ ".d.........d." + /* 5 */ "kdddddddddddk" + /* 6 */ "lllllllllllll" + /* 7 */ "............." + /* 8 */ "............." + + // Level 6 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "bbbbbbbbbbbbb" + /* 4 */ "ddddddddddddd" + /* 5 */ "lllllllllllll" + /* 6 */ "............." + /* 7 */ "............." + /* 8 */ ".............", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House13x9 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House15x9: + // The data has been exported from the gallery Desert, area index 13, ID 118, created by xoft + { + // Size: + 15, 7, 9, // SizeX = 15, SizeY = 7, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 6, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 5\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64:12\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ ".....abc......." + /* 1 */ ".ddddddddddddd." + /* 2 */ ".ddddddddddddd." + /* 3 */ ".ddddddddddddd." + /* 4 */ ".ddddddddddddd." + /* 5 */ ".ddddddddddddd." + /* 6 */ ".ddddddddddddd." + /* 7 */ ".ddddddddddddd." + /* 8 */ "..............." + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".dddddeddddddd." + /* 2 */ ".d...........d." + /* 3 */ ".d...........d." + /* 4 */ ".d...........d." + /* 5 */ ".d...........d." + /* 6 */ ".d...........d." + /* 7 */ ".ddddddddddddd." + /* 8 */ "..............." + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".dfffdgdffdffd." + /* 2 */ ".f...........f." + /* 3 */ ".f...........f." + /* 4 */ ".d...........d." + /* 5 */ ".f...........f." + /* 6 */ ".f...........f." + /* 7 */ ".dffdffdffdffd." + /* 8 */ "..............." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "bbbbbbbbbbbbbbb" + /* 1 */ "hdddddddddddddh" + /* 2 */ ".d...i.i..i..d." + /* 3 */ ".d...........d." + /* 4 */ ".d...........d." + /* 5 */ ".d...........d." + /* 6 */ ".d..j..j..j..d." + /* 7 */ "kdddddddddddddk" + /* 8 */ "lllllllllllllll" + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "bbbbbbbbbbbbbbb" + /* 2 */ "hdddddddddddddh" + /* 3 */ ".d...........d." + /* 4 */ ".d...........d." + /* 5 */ ".d...........d." + /* 6 */ "kdddddddddddddk" + /* 7 */ "lllllllllllllll" + /* 8 */ "..............." + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "bbbbbbbbbbbbbbb" + /* 3 */ "hdddddddddddddh" + /* 4 */ ".d...........d." + /* 5 */ "kdddddddddddddk" + /* 6 */ "lllllllllllllll" + /* 7 */ "..............." + /* 8 */ "..............." + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "bbbbbbbbbbbbbbb" + /* 4 */ "ddddddddddddddd" + /* 5 */ "lllllllllllllll" + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "...............", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House15x9 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House16x9: + // The data has been exported from the gallery Desert, area index 16, ID 126, created by Aloe_vera + { + // Size: + 16, 7, 9, // SizeX = 16, SizeY = 7, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 15, 6, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 5\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64:12\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "........abc....." + /* 1 */ ".dddddddddddddd." + /* 2 */ ".dddddddddddddd." + /* 3 */ ".dddddddddddddd." + /* 4 */ ".dddddddddddddd." + /* 5 */ ".dddddddddddddd." + /* 6 */ ".dddddddddddddd." + /* 7 */ ".dddddddddddddd." + /* 8 */ "................" + + // Level 1 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ ".ddddddddeddddd." + /* 2 */ ".d............d." + /* 3 */ ".d............d." + /* 4 */ ".d............d." + /* 5 */ ".d............d." + /* 6 */ ".d............d." + /* 7 */ ".dddddddddddddd." + /* 8 */ "................" + + // Level 2 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ ".dffdfffdgdfffd." + /* 2 */ ".f............f." + /* 3 */ ".f............f." + /* 4 */ ".d............d." + /* 5 */ ".f............f." + /* 6 */ ".f............f." + /* 7 */ ".dffdffdfffdffd." + /* 8 */ "................" + + // Level 3 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "bbbbbbbbbbbbbbbb" + /* 1 */ "hddddddddddddddh" + /* 2 */ ".d..i...i.i...d." + /* 3 */ ".d............d." + /* 4 */ ".d............d." + /* 5 */ ".d............d." + /* 6 */ ".d..j..j...j..d." + /* 7 */ "kddddddddddddddk" + /* 8 */ "llllllllllllllll" + + // Level 4 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "bbbbbbbbbbbbbbbb" + /* 2 */ "hddddddddddddddh" + /* 3 */ ".d............d." + /* 4 */ ".d............d." + /* 5 */ ".d............d." + /* 6 */ "kddddddddddddddk" + /* 7 */ "llllllllllllllll" + /* 8 */ "................" + + // Level 5 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "bbbbbbbbbbbbbbbb" + /* 3 */ "hddddddddddddddh" + /* 4 */ ".d............d." + /* 5 */ "kddddddddddddddk" + /* 6 */ "llllllllllllllll" + /* 7 */ "................" + /* 8 */ "................" + + // Level 6 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "bbbbbbbbbbbbbbbb" + /* 4 */ "dddddddddddddddd" + /* 5 */ "llllllllllllllll" + /* 6 */ "................" + /* 7 */ "................" + /* 8 */ "................", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House16x9 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House7x7: + // The data has been exported from the gallery Desert, area index 8, ID 112, created by Aloe_vera + { + // Size: + 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 5, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 5\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64:12\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j:128: 6\n" /* sandstonestairs */ + "k:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "...abc." + /* 1 */ ".ddddd." + /* 2 */ ".ddddd." + /* 3 */ ".ddddd." + /* 4 */ ".ddddd." + /* 5 */ ".ddddd." + /* 6 */ "......." + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ddded." + /* 2 */ ".d...d." + /* 3 */ ".d...d." + /* 4 */ ".d...d." + /* 5 */ ".ddddd." + /* 6 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".dfdgd." + /* 2 */ ".f...f." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ ".dfffd." + /* 6 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "bbbbbbb" + /* 1 */ "hdddddh" + /* 2 */ ".d.i.d." + /* 3 */ ".d...d." + /* 4 */ ".d...d." + /* 5 */ "jdddddj" + /* 6 */ "kkkkkkk" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "bbbbbbb" + /* 2 */ "hdddddh" + /* 3 */ ".d...d." + /* 4 */ "jdddddj" + /* 5 */ "kkkkkkk" + /* 6 */ "......." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "bbbbbbb" + /* 3 */ "ddddddd" + /* 4 */ "kkkkkkk" + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House7x7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House9x7: + // The data has been exported from the gallery Desert, area index 9, ID 113, created by xoft + { + // Size: + 9, 6, 7, // SizeX = 9, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 5, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 5\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64:12\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "...abc..." + /* 1 */ ".ddddddd." + /* 2 */ ".ddddddd." + /* 3 */ ".ddddddd." + /* 4 */ ".ddddddd." + /* 5 */ ".ddddddd." + /* 6 */ "........." + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".dddeddd." + /* 2 */ ".d.....d." + /* 3 */ ".d.....d." + /* 4 */ ".d.....d." + /* 5 */ ".ddddddd." + /* 6 */ "........." + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".dfdgdfd." + /* 2 */ ".f.....f." + /* 3 */ ".f.....f." + /* 4 */ ".f.....f." + /* 5 */ ".dffdffd." + /* 6 */ "........." + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "bbbbbbbbb" + /* 1 */ "hdddddddh" + /* 2 */ ".d.i.i.d." + /* 3 */ ".d.....d." + /* 4 */ ".d..j..d." + /* 5 */ "kdddddddk" + /* 6 */ "lllllllll" + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "bbbbbbbbb" + /* 2 */ "hdddddddh" + /* 3 */ ".d.....d." + /* 4 */ "kdddddddk" + /* 5 */ "lllllllll" + /* 6 */ "........." + + // Level 5 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "bbbbbbbbb" + /* 3 */ "ddddddddd" + /* 4 */ "lllllllll" + /* 5 */ "........." + /* 6 */ ".........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House9x7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House9x9: + // The data has been exported from the gallery Desert, area index 10, ID 114, created by xoft + { + // Size: + 9, 7, 9, // SizeX = 9, SizeY = 7, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 6, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 1\n" /* wooddoorblock */ + "f:102: 0\n" /* glasspane */ + "g: 64: 8\n" /* wooddoorblock */ + "h:128: 7\n" /* sandstonestairs */ + "i: 50: 3\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "...abc..." + /* 1 */ ".ddddddd." + /* 2 */ ".ddddddd." + /* 3 */ ".ddddddd." + /* 4 */ ".ddddddd." + /* 5 */ ".ddddddd." + /* 6 */ ".ddddddd." + /* 7 */ ".ddddddd." + /* 8 */ "........." + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".dddeddd." + /* 2 */ ".d.....d." + /* 3 */ ".d.....d." + /* 4 */ ".d.....d." + /* 5 */ ".d.....d." + /* 6 */ ".d.....d." + /* 7 */ ".ddddddd." + /* 8 */ "........." + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".dfdgdfd." + /* 2 */ ".f.....f." + /* 3 */ ".f.....f." + /* 4 */ ".d.....d." + /* 5 */ ".f.....f." + /* 6 */ ".f.....f." + /* 7 */ ".dffdffd." + /* 8 */ "........." + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "bbbbbbbbb" + /* 1 */ "hdddddddh" + /* 2 */ ".d.i.i.d." + /* 3 */ ".d.....d." + /* 4 */ ".d.....d." + /* 5 */ ".d.....d." + /* 6 */ ".d..j..d." + /* 7 */ "kdddddddk" + /* 8 */ "lllllllll" + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "bbbbbbbbb" + /* 2 */ "hdddddddh" + /* 3 */ ".d.....d." + /* 4 */ ".d.....d." + /* 5 */ ".d.....d." + /* 6 */ "kdddddddk" + /* 7 */ "lllllllll" + /* 8 */ "........." + + // Level 5 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "bbbbbbbbb" + /* 3 */ "hdddddddh" + /* 4 */ ".d.....d." + /* 5 */ "kdddddddk" + /* 6 */ "lllllllll" + /* 7 */ "........." + /* 8 */ "........." + + // Level 6 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "bbbbbbbbb" + /* 4 */ "ddddddddd" + /* 5 */ "lllllllll" + /* 6 */ "........." + /* 7 */ "........." + /* 8 */ ".........", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House9x9 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseL14x12: + // The data has been exported from the gallery Desert, area index 7, ID 82, created by Aloe_vera + { + // Size: + 14, 6, 12, // SizeX = 14, SizeY = 6, SizeZ = 12 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 13, 5, 11, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e:128: 3\n" /* sandstonestairs */ + "f: 64: 5\n" /* wooddoorblock */ + "g:102: 0\n" /* glasspane */ + "h: 64:12\n" /* wooddoorblock */ + "i:128: 7\n" /* sandstonestairs */ + "j: 50: 3\n" /* torch */ + "k: 50: 4\n" /* torch */ + "l:128: 6\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:128: 5\n" /* sandstonestairs */ + "o:128: 4\n" /* sandstonestairs */ + "p: 50: 1\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".......abc...." + /* 1 */ ".dddddddddddd." + /* 2 */ ".dddddddddddd." + /* 3 */ ".dddddddddddd." + /* 4 */ ".dddddddddddd." + /* 5 */ ".dddddddddddd." + /* 6 */ "....aec.ddddd." + /* 7 */ "mmmmmmm.ddddd." + /* 8 */ "mmmmmmm.ddddd." + /* 9 */ "mmmmmmm.ddddd." + /* 10 */ "mmmmmmm.ddddd." + /* 11 */ "mmmmmmm......." + + // Level 1 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".dddddddfdddd." + /* 2 */ ".d..........d." + /* 3 */ ".d..........d." + /* 4 */ ".d..........d." + /* 5 */ ".ddddfddd...d." + /* 6 */ "........d...d." + /* 7 */ "mmmmmmm.d...d." + /* 8 */ "mmmmmmm.d...d." + /* 9 */ "mmmmmmm.d...d." + /* 10 */ "mmmmmmm.ddddd." + /* 11 */ "mmmmmmm......." + + // Level 2 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".dggdggdhdggd." + /* 2 */ ".g..........g." + /* 3 */ ".g..........g." + /* 4 */ ".g..........d." + /* 5 */ ".dggdhdgg...g." + /* 6 */ "........g...g." + /* 7 */ "mmmmmmm.d...d." + /* 8 */ "mmmmmmm.g...g." + /* 9 */ "mmmmmmm.g...g." + /* 10 */ "mmmmmmm.dgggd." + /* 11 */ "mmmmmmm......." + + // Level 3 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ "bbbbbbbbbbbbbb" + /* 1 */ "iddddddddddddc" + /* 2 */ ".d.....j.j..dc" + /* 3 */ ".d..........dc" + /* 4 */ ".d..k.k.....dc" + /* 5 */ "ldddddddd...dc" + /* 6 */ "eeeeeeead...dc" + /* 7 */ "mmmmmmmad...dc" + /* 8 */ "mmmmmmmad...dc" + /* 9 */ "mmmmmmmad...dc" + /* 10 */ "mmmmmmmadddddc" + /* 11 */ "mmmmmmman...oc" + + // Level 4 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ "bbbbbbbbbbbbb." + /* 2 */ "idddddddddddc." + /* 3 */ ".dp........dc." + /* 4 */ "lddddddddd.dc." + /* 5 */ "eeeeeeeead.dc." + /* 6 */ "........ad.dc." + /* 7 */ "mmmmmmm.ad.dc." + /* 8 */ "mmmmmmm.ad.dc." + /* 9 */ "mmmmmmm.adkdc." + /* 10 */ "mmmmmmm.adddc." + /* 11 */ "mmmmmmm.an.oc." + + // Level 5 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".............." + /* 2 */ "bbbbbbbbbbbb.." + /* 3 */ "dddddddddddc.." + /* 4 */ "eeeeeeeeeadc.." + /* 5 */ ".........adc.." + /* 6 */ ".........adc.." + /* 7 */ "mmmmmmm..adc.." + /* 8 */ "mmmmmmm..adc.." + /* 9 */ "mmmmmmm..adc.." + /* 10 */ "mmmmmmm..adc.." + /* 11 */ "mmmmmmm..adc..", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseL14x12 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseL14x12: + // The data has been exported from the gallery Desert, area index 14, ID 124, created by Aloe_vera + { + // Size: + 14, 7, 12, // SizeX = 14, SizeY = 7, SizeZ = 12 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 13, 6, 11, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e:128: 3\n" /* sandstonestairs */ + "f: 64: 5\n" /* wooddoorblock */ + "g: 64: 7\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j:128: 7\n" /* sandstonestairs */ + "k: 50: 3\n" /* torch */ + "l: 50: 2\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 50: 4\n" /* torch */ + "o:128: 6\n" /* sandstonestairs */ + "p: 50: 1\n" /* torch */ + "q:128: 5\n" /* sandstonestairs */ + "r:128: 4\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ "....abc......." + /* 1 */ ".dddddddddddd." + /* 2 */ ".dddddddddddd." + /* 3 */ ".dddddddddddd." + /* 4 */ ".dddddddddddd." + /* 5 */ ".dddddddddddd." + /* 6 */ ".dddddddddddd." + /* 7 */ ".dddddddddddd." + /* 8 */ "....aeddddddd." + /* 9 */ "mmmmm.ddddddd." + /* 10 */ "mmmmm.ddddddd." + /* 11 */ "mmmmm........." + + // Level 1 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".ddddfddddddd." + /* 2 */ ".d..........d." + /* 3 */ ".d..........d." + /* 4 */ ".d..........d." + /* 5 */ ".d..........d." + /* 6 */ ".d..........d." + /* 7 */ ".ddddgd.....d." + /* 8 */ "......d.....d." + /* 9 */ "mmmmm.d.....d." + /* 10 */ "mmmmm.ddddddd." + /* 11 */ "mmmmm........." + + // Level 2 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".dhhdidhhdhhd." + /* 2 */ ".h..........h." + /* 3 */ ".h..........h." + /* 4 */ ".d..........d." + /* 5 */ ".h..........h." + /* 6 */ ".h..........h." + /* 7 */ ".dhhdid.....d." + /* 8 */ "......h.....h." + /* 9 */ "mmmmm.h.....h." + /* 10 */ "mmmmm.dhhdhhd." + /* 11 */ "mmmmm........." + + // Level 3 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ "bbbbbbbbbbbbbb" + /* 1 */ "jddddddddddddc" + /* 2 */ ".d..k.k.....dc" + /* 3 */ ".d..........dc" + /* 4 */ ".d.........ldc" + /* 5 */ ".d..........dc" + /* 6 */ ".d..n.n.....dc" + /* 7 */ "oddddddp...ldc" + /* 8 */ "eeeeead.....dc" + /* 9 */ "mmmmmad.....dc" + /* 10 */ "mmmmmadddddddc" + /* 11 */ "mmmmmaq.....rc" + + // Level 4 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ "bbbbbbbbbbbbc." + /* 2 */ "jdddddddddddc." + /* 3 */ ".d.........dc." + /* 4 */ ".d.........dc." + /* 5 */ ".d.........dc." + /* 6 */ "oddddddd...dc." + /* 7 */ "eeeeeead...dc." + /* 8 */ "......ad...dc." + /* 9 */ "mmmmm.ad...dc." + /* 10 */ "mmmmm.adddddc." + /* 11 */ "mmmmm.aq...rc." + + // Level 5 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".............." + /* 2 */ "bbbbbbbbbbbb.." + /* 3 */ "jddddddddddc.." + /* 4 */ ".d........dc.." + /* 5 */ "odddddddd.dc.." + /* 6 */ "eeeeeeeed.dc.." + /* 7 */ ".......ad.dc.." + /* 8 */ ".......ad.dc.." + /* 9 */ "mmmmm..ad.dc.." + /* 10 */ "mmmmm..adddc.." + /* 11 */ "mmmmm..aq.rc.." + + // Level 6 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".............." + /* 2 */ ".............." + /* 3 */ "bbbbbbbbbbb..." + /* 4 */ "ddddddddddc..." + /* 5 */ "eeeeeeeeadc..." + /* 6 */ "........adc..." + /* 7 */ "........adc..." + /* 8 */ "........adc..." + /* 9 */ "mmmmm...adc..." + /* 10 */ "mmmmm...adc..." + /* 11 */ "mmmmm...adc...", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseL14x12 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // SingleField: + // The data has been exported from the gallery Desert, area index 17, ID 127, created by Aloe_vera + { + // Size: + 10, 2, 7, // SizeX = 10, SizeY = 2, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 1, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 24: 0\n" /* sandstone */ + "b: 60: 7\n" /* tilleddirt */ + "c: 8: 0\n" /* water */ + "d: 50: 5\n" /* torch */ + "e: 59: 7\n" /* crops */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "aaaaaaaaaa" + /* 1 */ "abbbbbbbba" + /* 2 */ "abbbbbbbba" + /* 3 */ "acccccccca" + /* 4 */ "abbbbbbbba" + /* 5 */ "abbbbbbbba" + /* 6 */ "aaaaaaaaaa" + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "d........d" + /* 1 */ ".eeeeeeee." + /* 2 */ ".eeeeeeee." + /* 3 */ ".........." + /* 4 */ ".eeeeeeee." + /* 5 */ ".eeeeeeee." + /* 6 */ "d........d", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // SingleField + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // SmallHut: + // The data has been exported from the gallery Desert, area index 4, ID 68, created by tonibm1999 + { + // Size: + 5, 5, 6, // SizeX = 5, SizeY = 5, SizeZ = 6 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 4, 5, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 24: 0\n" /* sandstone */ + "b:128: 3\n" /* sandstonestairs */ + "c: 24: 2\n" /* sandstone */ + "d: 50: 5\n" /* torch */ + "e: 26:10\n" /* bedblock */ + "f: 26: 2\n" /* bedblock */ + "g: 64: 3\n" /* wooddoorblock */ + "h: 64: 8\n" /* wooddoorblock */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aaaaa" + /* 2 */ "aaaaa" + /* 3 */ "aaaaa" + /* 4 */ "aaaaa" + /* 5 */ "..b.." + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "accca" + /* 1 */ "cdedc" + /* 2 */ "c.f.c" + /* 3 */ "c...c" + /* 4 */ "acgca" + /* 5 */ "....." + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "ac.ca" + /* 1 */ "c...c" + /* 2 */ "....." + /* 3 */ "c...c" + /* 4 */ "achca" + /* 5 */ "....." + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "accca" + /* 1 */ "c...c" + /* 2 */ "c...c" + /* 3 */ "c...c" + /* 4 */ "accca" + /* 5 */ "....." + + // Level 4 + /* z\x* 01234 */ + /* 0 */ ".aaa." + /* 1 */ "aaaaa" + /* 2 */ "aaaaa" + /* 3 */ "aaaaa" + /* 4 */ ".aaa." + /* 5 */ ".....", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // SmallHut +}; // g_SandVillagePrefabs + + + + + + +const cPrefab::sDef g_SandVillageStartingPrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Well: + // The data has been exported from the gallery Desert, area index 0, ID 1, created by Aloe_vera + { + // Size: + 4, 13, 4, // SizeX = 4, SizeY = 13, SizeZ = 4 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 3, 12, 3, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 1: 0\n" /* stone */ + "b: 24: 0\n" /* sandstone */ + "c: 8: 0\n" /* water */ + "d: 85: 0\n" /* fence */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123 */ + /* 0 */ "aaaa" + /* 1 */ "aaaa" + /* 2 */ "aaaa" + /* 3 */ "aaaa" + + // Level 1 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 2 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 3 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 4 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 5 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 6 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 7 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 8 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "b..b" + /* 2 */ "b..b" + /* 3 */ "bbbb" + + // Level 9 + /* z\x* 0123 */ + /* 0 */ "d..d" + /* 1 */ "...." + /* 2 */ "...." + /* 3 */ "d..d" + + // Level 10 + /* z\x* 0123 */ + /* 0 */ "d..d" + /* 1 */ "...." + /* 2 */ "...." + /* 3 */ "d..d" + + // Level 11 + /* z\x* 0123 */ + /* 0 */ "d..d" + /* 1 */ "...." + /* 2 */ "...." + /* 3 */ "d..d" + + // Level 12 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bbbb" + /* 2 */ "bbbb" + /* 3 */ "bbbb", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Well +}; + + + + + +// The prefab counts: + +const size_t g_SandVillagePrefabsCount = ARRAYCOUNT(g_SandVillagePrefabs); + +const size_t g_SandVillageStartingPrefabsCount = ARRAYCOUNT(g_SandVillageStartingPrefabs); + diff --git a/src/Generating/Prefabs/SandVillagePrefabs.h b/src/Generating/Prefabs/SandVillagePrefabs.h new file mode 100644 index 000000000..7b00db56f --- /dev/null +++ b/src/Generating/Prefabs/SandVillagePrefabs.h @@ -0,0 +1,15 @@ + +// SandVillagePrefabs.h + +// Declares the prefabs in the group SandVillage + +#include "../Prefab.h" + + + + + +extern const cPrefab::sDef g_SandVillagePrefabs[]; +extern const cPrefab::sDef g_SandVillageStartingPrefabs[]; +extern const size_t g_SandVillagePrefabsCount; +extern const size_t g_SandVillageStartingPrefabsCount; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp new file mode 100644 index 000000000..fb6191df2 --- /dev/null +++ b/src/Generating/VillageGen.cpp @@ -0,0 +1,116 @@ + +// VillageGen.cpp + +// Implements the cVillageGen class representing the village generator + +#include "Globals.h" +#include "VillageGen.h" +#include "Prefabs/PlainsVillagePrefabs.h" +#include "Prefabs/SandVillagePrefabs.h" + + + + + +class cVillageGen::cVillage : + public cGridStructGen::cStructure +{ + typedef cGridStructGen::cStructure super; + +public: + cVillage(int a_Seed, int a_OriginX, int a_OriginZ, cPrefabPiecePool & a_Prefabs) : + super(a_OriginX, a_OriginZ), + m_Seed(a_Seed), + m_Prefabs(a_Prefabs) + { + } + +protected: + /** Seed for the random functions */ + int m_Seed; + + /** Prefabs to use for buildings */ + cPrefabPiecePool & m_Prefabs; + + // cGrdStructGen::cStructure overrides: + virtual void DrawIntoChunk(cChunkDesc & a_Chunk) override + { + // TODO + } +} ; + + + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// cVillageGen: + +cPrefabPiecePool cVillageGen::m_SandVillage (g_SandVillagePrefabs, g_SandVillagePrefabsCount, g_SandVillageStartingPrefabs, g_SandVillageStartingPrefabsCount); +cPrefabPiecePool cVillageGen::m_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVillagePrefabsCount, g_PlainsVillageStartingPrefabs, g_PlainsVillageStartingPrefabsCount); + + + + + +cVillageGen::cVillageGen(int a_Seed, int a_GridSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen) : + super(a_Seed, a_GridSize, a_GridSize, 128, 128, 100), + m_BiomeGen(a_BiomeGen), + m_HeightGen(a_HeightGen) +{ +} + + + + + +cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_OriginZ) +{ + // Generate the biomes for the chunk surrounding the origin: + int ChunkX, ChunkZ; + cChunkDef::BlockToChunk(a_OriginX, a_OriginZ, ChunkX, ChunkZ); + cChunkDef::BiomeMap Biomes; + m_BiomeGen.GenBiomes(ChunkX, ChunkZ, Biomes); + + // Check if all the biomes are village-friendly: + // If just one is not, no village is created, because it's likely that an unfriendly biome is too close + cPrefabPiecePool * VillagePrefabs = NULL; + for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) + { + switch (Biomes[i]) + { + case biDesert: + case biDesertM: + { + // These biomes allow sand villages + VillagePrefabs = &m_SandVillage; + break; + } + case biPlains: + case biSavanna: + case biSavannaM: + case biSunflowerPlains: + { + // These biomes allow plains-style villages + VillagePrefabs = &m_PlainsVillage; + break; + } + default: + { + // Village-unfriendly biome, bail out with zero structure: + return cStructurePtr(); + } + } // switch (Biomes[i]) + } // for i - Biomes[] + + // Create a village based on the chosen prefabs: + if (VillagePrefabs == NULL) + { + return cStructurePtr(); + } + return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, *VillagePrefabs)); +} + + + + diff --git a/src/Generating/VillageGen.h b/src/Generating/VillageGen.h new file mode 100644 index 000000000..d3cc8ef9c --- /dev/null +++ b/src/Generating/VillageGen.h @@ -0,0 +1,48 @@ + +// VillageGen.h + +// Declares the cVillageGen class representing the village generator + + + + + +#pragma once + +#include "GridStructGen.h" +#include "PrefabPiecePool.h" + + + + + +class cVillageGen : + public cGridStructGen +{ + typedef cGridStructGen super; +public: + cVillageGen(int a_Seed, int a_GridSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen); + +protected: + class cVillage; // fwd: VillageGen.cpp + + /** The prefabs for the sand village. We're not exactly using the cPiecePool functionality, only the containment. */ + static cPrefabPiecePool m_SandVillage; + + /** The prefabs for the plains village. We're not exactly using the cPiecePool functionality, only the containment. */ + static cPrefabPiecePool m_PlainsVillage; + + /** The underlying biome generator that defines whether the village is created or not */ + cBiomeGen & m_BiomeGen; + + /** The underlying height generator, used to position the prefabs crossing chunk borders */ + cTerrainHeightGen & m_HeightGen; + + + // cGridStructGen overrides: + virtual cStructurePtr CreateStructure(int a_OriginX, int a_OriginZ) override; +} ; + + + + From 6c57b38b741787cd53a42b905d27e2d137ae194b Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 11 May 2014 13:44:30 -0700 Subject: [PATCH 071/214] Fixed a warning and a complaint about a never-read variable. --- src/BlockArea.cpp | 25 +++++++++++-------------- src/WorldStorage/WorldStorage.cpp | 1 - 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 9e20a0983..aff0bf9c6 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -2123,7 +2123,7 @@ void cBlockArea::MergeByStrategy(const cBlockArea & a_Src, int a_RelX, int a_Rel a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(), m_Size.x, m_Size.y, m_Size.z ); - break; + return; } // case msOverwrite case cBlockArea::msFillAir: @@ -2137,7 +2137,7 @@ void cBlockArea::MergeByStrategy(const cBlockArea & a_Src, int a_RelX, int a_Rel a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(), m_Size.x, m_Size.y, m_Size.z ); - break; + return; } // case msFillAir case cBlockArea::msImprint: @@ -2151,7 +2151,7 @@ void cBlockArea::MergeByStrategy(const cBlockArea & a_Src, int a_RelX, int a_Rel a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(), m_Size.x, m_Size.y, m_Size.z ); - break; + return; } // case msImprint case cBlockArea::msLake: @@ -2165,7 +2165,7 @@ void cBlockArea::MergeByStrategy(const cBlockArea & a_Src, int a_RelX, int a_Rel a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(), m_Size.x, m_Size.y, m_Size.z ); - break; + return; } // case msLake case cBlockArea::msSpongePrint: @@ -2179,7 +2179,7 @@ void cBlockArea::MergeByStrategy(const cBlockArea & a_Src, int a_RelX, int a_Rel a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(), m_Size.x, m_Size.y, m_Size.z ); - break; + return; } // case msSpongePrint case cBlockArea::msDifference: @@ -2193,7 +2193,7 @@ void cBlockArea::MergeByStrategy(const cBlockArea & a_Src, int a_RelX, int a_Rel a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(), m_Size.x, m_Size.y, m_Size.z ); - break; + return; } // case msDifference case cBlockArea::msMask: @@ -2207,16 +2207,13 @@ void cBlockArea::MergeByStrategy(const cBlockArea & a_Src, int a_RelX, int a_Rel a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(), m_Size.x, m_Size.y, m_Size.z ); - break; + return; } // case msMask - - default: - { - LOGWARNING("Unknown block area merge strategy: %d", a_Strategy); - ASSERT(!"Unknown block area merge strategy"); - break; - } } // switch (a_Strategy) + + LOGWARNING("Unknown block area merge strategy: %d", a_Strategy); + ASSERT(!"Unknown block area merge strategy"); + return; } diff --git a/src/WorldStorage/WorldStorage.cpp b/src/WorldStorage/WorldStorage.cpp index 54eaaca5c..6867ad5bc 100644 --- a/src/WorldStorage/WorldStorage.cpp +++ b/src/WorldStorage/WorldStorage.cpp @@ -243,7 +243,6 @@ void cWorldStorage::Execute(void) bool Success; do { - Success = false; if (m_ShouldTerminate) { return; From 3f9e00a3f3486c2845115e495d66f438f90825f3 Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 11 May 2014 16:25:21 -0700 Subject: [PATCH 072/214] Fixed a few more switch warnings. --- src/Generating/StructGen.cpp | 28 +++++++++---------- src/Mobs/Monster.cpp | 2 ++ src/WorldStorage/NBTChunkSerializer.cpp | 37 +++++++++++++------------ 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp index db9d5578c..636364e17 100644 --- a/src/Generating/StructGen.cpp +++ b/src/Generating/StructGen.cpp @@ -596,24 +596,22 @@ void cStructGenDirectOverhangs::GenFinish(cChunkDesc & a_ChunkDesc) // Interpolate between FloorLo and FloorHi: for (int z = 0; z < 16; z++) for (int x = 0; x < 16; x++) { - switch (a_ChunkDesc.GetBiome(x, z)) + EMCSBiome biome = a_ChunkDesc.GetBiome(x, z); + + if ((biome == biExtremeHills) || (biome == biExtremeHillsEdge)) { - case biExtremeHills: - case biExtremeHillsEdge: + int Lo = FloorLo[x + 17 * z] / 256; + int Hi = FloorHi[x + 17 * z] / 256; + for (int y = 0; y < SEGMENT_HEIGHT; y++) { - int Lo = FloorLo[x + 17 * z] / 256; - int Hi = FloorHi[x + 17 * z] / 256; - for (int y = 0; y < SEGMENT_HEIGHT; y++) + int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT; + if (Val < 0) { - int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT; - if (Val < 0) - { - a_ChunkDesc.SetBlockType(x, y + Segment, z, E_BLOCK_AIR); - } - } // for y - break; - } - } // switch (biome) + a_ChunkDesc.SetBlockType(x, y + Segment, z, E_BLOCK_AIR); + } + } // for y + break; + } // if (biome) } // for z, x // Swap the floors: diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 62670907f..5832edb9f 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -355,6 +355,8 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk) InStateEscaping(a_Dt); break; } + + case ATTACKING: break; } // switch (m_EMState) BroadcastMovementUpdate(); diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 2ac1d7962..ab80dd7c8 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -391,38 +391,41 @@ void cNBTChunkSerializer::AddFallingBlockEntity(cFallingBlock * a_FallingBlock) void cNBTChunkSerializer::AddMinecartEntity(cMinecart * a_Minecart) { - const char * EntityClass = NULL; - switch (a_Minecart->GetPayload()) - { - case cMinecart::mpNone: EntityClass = "MinecartRideable"; break; - case cMinecart::mpChest: EntityClass = "MinecartChest"; break; - case cMinecart::mpFurnace: EntityClass = "MinecartFurnace"; break; - case cMinecart::mpTNT: EntityClass = "MinecartTNT"; break; - case cMinecart::mpHopper: EntityClass = "MinecartHopper"; break; - default: - { - ASSERT(!"Unhandled minecart payload type"); - return; - } - } // switch (payload) - m_Writer.BeginCompound(""); - AddBasicEntity(a_Minecart, EntityClass); + switch (a_Minecart->GetPayload()) { case cMinecart::mpChest: { + AddBasicEntity(a_Minecart, "MinecartChest"); // Add chest contents into the Items tag: AddMinecartChestContents((cMinecartWithChest *)a_Minecart); break; } - case cMinecart::mpFurnace: { + AddBasicEntity(a_Minecart, "MinecartFurnace"); // TODO: Add "Push" and "Fuel" tags break; } + case cMinecart::mpHopper: + { + AddBasicEntity(a_Minecart, "MinecartHopper"); + // TODO: Add hopper contents? + break; + } + case cMinecart::mpTNT: + { + AddBasicEntity(a_Minecart, "MinecartTNT"); + break; + } + case cMinecart::mpNone: + { + AddBasicEntity(a_Minecart, "MinecartRideable"); + break; + } } // switch (Payload) + m_Writer.EndCompound(); } From 3a5e04d118a88dc33930866546007f59fdba951f Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 11 May 2014 16:54:42 -0700 Subject: [PATCH 073/214] More switch warnings. --- src/Generating/Trees.cpp | 34 ++++++++++++++++++++----- src/WorldStorage/NBTChunkSerializer.cpp | 7 +++++ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/Generating/Trees.cpp b/src/Generating/Trees.cpp index 4f1553c36..522f45148 100644 --- a/src/Generating/Trees.cpp +++ b/src/Generating/Trees.cpp @@ -174,7 +174,7 @@ void GetTreeImageByBiome(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_No { GetBirchTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks); } - break; + return; } case biTaiga: @@ -184,14 +184,14 @@ void GetTreeImageByBiome(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_No { // Conifers GetConiferTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks); - break; + return; } case biSwampland: { // Swamp trees: GetSwampTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks); - break; + return; } case biJungle: @@ -207,21 +207,21 @@ void GetTreeImageByBiome(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_No { GetJungleTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks); } - break; + return; } case biBirchForest: case biBirchForestHills: { GetBirchTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks); - break; + return; } case biBirchForestM: case biBirchForestHillsM: { GetTallBirchTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks); - break; + return; } case biRoofedForest: @@ -257,9 +257,29 @@ void GetTreeImageByBiome(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_No { // TODO: These need their special trees GetBirchTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks); - break; + return; + } + + case biDesert: + case biDesertHills: + case biRiver: + case biBeach: + case biHell: + case biSky: + case biOcean: + case biFrozenOcean: + case biFrozenRiver: + case biVariant: + case biNumBiomes: + case biNumVariantBiomes: + case biInvalidBiome: + { + // These biomes have no trees, or are non-biome members of the enum. + return; } } + + ASSERT(!"Invalid biome type!"); } diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index ab80dd7c8..7b7cd3c7e 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -653,6 +653,13 @@ void cNBTChunkSerializer::AddHangingEntity(cHangingEntity * a_Hanging) case BLOCK_FACE_YP: m_Writer.AddByte("Dir", (unsigned char)1); break; case BLOCK_FACE_ZM: m_Writer.AddByte("Dir", (unsigned char)0); break; case BLOCK_FACE_ZP: m_Writer.AddByte("Dir", (unsigned char)3); break; + + case BLOCK_FACE_XM: + case BLOCK_FACE_XP: + case BLOCK_FACE_NONE: + { + break; + } } } From b3d2b5b2c94193fd9364b26293b7d96b748ff96d Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 12 May 2014 17:05:09 +0300 Subject: [PATCH 074/214] cEntity::Killed(cEntity *) Handler; Achievement triggers; cPlayer::AwardAchievement() --- src/Entities/Entity.cpp | 5 +++ src/Entities/Entity.h | 3 ++ src/Entities/Pickup.cpp | 10 ++++++ src/Entities/Player.cpp | 70 +++++++++++++++++++++++++++++++++--- src/Entities/Player.h | 11 ++++++ src/Protocol/Protocol17x.cpp | 6 +--- src/UI/SlotArea.cpp | 42 +++++++++++++++++++++- src/UI/SlotArea.h | 6 ++++ 8 files changed, 143 insertions(+), 10 deletions(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 4cf10a219..9eb03acde 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -370,6 +370,11 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) if (m_Health <= 0) { KilledBy(a_TDI.Attacker); + + if (a_TDI.Attacker != NULL) + { + a_TDI.Attacker->Killed(this); + } } return true; } diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index df03d635b..a111b128d 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -299,6 +299,9 @@ public: /// Called when the health drops below zero. a_Killer may be NULL (environmental damage) virtual void KilledBy(cEntity * a_Killer); + /// Called when the entity kills another entity + virtual void Killed(cEntity * a_Victim) {} + /// Heals the specified amount of HPs void Heal(int a_HitPoints); diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp index 497b41683..0fd006485 100644 --- a/src/Entities/Pickup.cpp +++ b/src/Entities/Pickup.cpp @@ -192,6 +192,16 @@ bool cPickup::CollectedBy(cPlayer * a_Dest) int NumAdded = a_Dest->GetInventory().AddItem(m_Item); if (NumAdded > 0) { + // Check achievements + switch (m_Item.m_ItemType) + { + case E_BLOCK_LOG: a_Dest->AwardAchievement(achMineWood); break; + case E_ITEM_LEATHER: a_Dest->AwardAchievement(achKillCow); break; + case E_ITEM_DIAMOND: a_Dest->AwardAchievement(achDiamonds); break; + case E_ITEM_BLAZE_ROD: a_Dest->AwardAchievement(achBlazeRod); break; + default: break; + } + m_Item.m_ItemCount -= NumAdded; m_World->BroadcastCollectPickup(*this, *a_Dest); // Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;) diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 1df473eb2..48bb509b9 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -17,6 +17,7 @@ #include "../Vector3.h" #include "../WorldStorage/StatSerializer.h" +#include "../CompositeChat.h" #include "inifile/iniFile.h" #include "json/json.h" @@ -876,10 +877,6 @@ void cPlayer::KilledBy(cEntity * a_Killer) cPlayer* Killer = (cPlayer*)a_Killer; GetWorld()->BroadcastChatDeath(Printf("%s was killed by %s", GetName().c_str(), Killer->GetName().c_str())); - - Killer->GetStatManager().AddValue(statPlayerKills); - - m_World->GetScoreBoard().AddPlayerScore(Killer->GetName(), cObjective::otPlayerKillCount, 1); } else { @@ -898,6 +895,33 @@ void cPlayer::KilledBy(cEntity * a_Killer) +void cPlayer::Killed(cEntity * a_Victim) +{ + cScoreboard & ScoreBoard = m_World->GetScoreBoard(); + + if (a_Victim->IsPlayer()) + { + m_Stats.AddValue(statPlayerKills); + + ScoreBoard.AddPlayerScore(GetName(), cObjective::otPlayerKillCount, 1); + } + else if (a_Victim->IsMob()) + { + if (((cMonster *)a_Victim)->GetMobFamily() == cMonster::mfHostile) + { + AwardAchievement(achKillMonster); + } + + m_Stats.AddValue(statMobKills); + } + + ScoreBoard.AddPlayerScore(GetName(), cObjective::otTotalKillCount, 1); +} + + + + + void cPlayer::Respawn(void) { m_Health = GetMaxHealth(); @@ -1116,6 +1140,44 @@ void cPlayer::SetIP(const AString & a_IP) +unsigned int cPlayer::AwardAchievement(const eStatistic a_Ach) +{ + eStatistic Prerequisite = cStatInfo::GetPrerequisite(a_Ach); + + if (Prerequisite != statInvalid) + { + if (m_Stats.GetValue(Prerequisite) == 0) + { + return 0; + } + } + + StatValue Old = m_Stats.GetValue(a_Ach); + + if (Old > 0) + { + return m_Stats.AddValue(a_Ach); + } + else + { + cCompositeChat Msg; + Msg.AddTextPart(m_PlayerName + " has just earned the achievement "); + Msg.AddTextPart(cStatInfo::GetName(a_Ach)); // TODO 2014-05-12 xdot: Use the proper cCompositeChat submessage type and send the actual title + m_World->BroadcastChat(Msg); + + StatValue New = m_Stats.AddValue(a_Ach); + + /* Achievement Get! */ + m_ClientHandle->SendStatistics(m_Stats); + + return New; + } +} + + + + + void cPlayer::TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) { SetPosition(a_PosX, a_PosY, a_PosZ); diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 82a138290..b5c9d75cc 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -179,6 +179,15 @@ public: /** Return the associated statistic and achievement manager. */ cStatManager & GetStatManager() { return m_Stats; } + + /** Awards the player an achievement. + * + * If all prerequisites are met, this method will award the achievement and will broadcast a chat message. + * If the achievement has been already awarded to the player, this method will just increment the stat counter. + * + * Returns the _new_ stat value. (0 = Could not award achievement) + */ + unsigned int AwardAchievement(const eStatistic a_Ach); void SetIP(const AString & a_IP); @@ -311,6 +320,8 @@ public: void AbortEating(void); virtual void KilledBy(cEntity * a_Killer) override; + + virtual void Killed(cEntity * a_Victim) override; void Respawn(void); // tolua_export diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 3b21f7821..39feee16f 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1879,11 +1879,7 @@ void cProtocol172::HandlePacketClientStatus(cByteBuffer & a_ByteBuffer) case 2: { // Open Inventory achievement - cStatManager & Manager = m_Client->GetPlayer()->GetStatManager(); - Manager.AddValue(achOpenInv); - - SendStatistics(Manager); - + m_Client->GetPlayer()->AwardAchievement(achOpenInv); break; } } diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 788974f9c..1e3d8eaa4 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -496,6 +496,8 @@ void cSlotAreaCrafting::ClickedResult(cPlayer & a_Player) DraggingItem = Result; Recipe.ConsumeIngredients(Grid); Grid.CopyToItems(PlayerSlots); + + HandleCraftItem(Result, a_Player); } else if (DraggingItem.IsEqual(Result)) { @@ -505,6 +507,8 @@ void cSlotAreaCrafting::ClickedResult(cPlayer & a_Player) DraggingItem.m_ItemCount += Result.m_ItemCount; Recipe.ConsumeIngredients(Grid); Grid.CopyToItems(PlayerSlots); + + HandleCraftItem(Result, a_Player); } } @@ -594,6 +598,27 @@ cCraftingRecipe & cSlotAreaCrafting::GetRecipeForPlayer(cPlayer & a_Player) +void cSlotAreaCrafting::HandleCraftItem(const cItem & a_Result, cPlayer & a_Player) +{ + switch (a_Result.m_ItemType) + { + case E_BLOCK_WORKBENCH: a_Player.AwardAchievement(achCraftWorkbench); break; + case E_BLOCK_FURNACE: a_Player.AwardAchievement(achCraftFurnace); break; + case E_BLOCK_CAKE: a_Player.AwardAchievement(achBakeCake); break; + case E_BLOCK_ENCHANTMENT_TABLE: a_Player.AwardAchievement(achCraftEnchantTable); break; + case E_BLOCK_BOOKCASE: a_Player.AwardAchievement(achBookshelf); break; + case E_ITEM_WOODEN_PICKAXE: a_Player.AwardAchievement(achCraftPickaxe); break; + case E_ITEM_WOODEN_SWORD: a_Player.AwardAchievement(achCraftSword); break; + case E_ITEM_STONE_PICKAXE: a_Player.AwardAchievement(achCraftBetterPick); break; + case E_ITEM_WOODEN_HOE: a_Player.AwardAchievement(achCraftHoe); break; + case E_ITEM_BREAD: a_Player.AwardAchievement(achMakeBread); break; + default: break; + } +} + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cSlotAreaAnvil: @@ -1393,7 +1418,7 @@ void cSlotAreaFurnace::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) { // Something has changed in the window, broadcast the entire window to all clients ASSERT(a_ItemGrid == &(m_Furnace->GetContents())); - + m_ParentWindow.BroadcastWholeWindow(); } @@ -1401,6 +1426,21 @@ void cSlotAreaFurnace::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) +void cSlotAreaFurnace::HandleSmeltItem(const cItem & a_Result, cPlayer & a_Player) +{ + /** TODO 2014-05-12 xdot: Figure out when to call this method. */ + switch (a_Result.m_ItemType) + { + case E_ITEM_IRON: a_Player.AwardAchievement(achAcquireIron); break; + case E_ITEM_COOKED_FISH: a_Player.AwardAchievement(achCookFish); break; + default: break; + } +} + + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cSlotAreaInventoryBase: diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h index 4da6a672f..e297bcff7 100644 --- a/src/UI/SlotArea.h +++ b/src/UI/SlotArea.h @@ -254,6 +254,9 @@ protected: /// Retrieves the recipe for the specified player from the map, or creates one if not found cCraftingRecipe & GetRecipeForPlayer(cPlayer & a_Player); + + /// Called after an item has been crafted to handle statistics e.t.c. + void HandleCraftItem(const cItem & a_Result, cPlayer & a_Player); } ; @@ -397,6 +400,9 @@ protected: // cItemGrid::cListener overrides: virtual void OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) override; + + /// Called after an item has been smelted to handle statistics e.t.c. + void HandleSmeltItem(const cItem & a_Result, cPlayer & a_Player); } ; From aea866f5b10d5ab0226260b4d25c70b1cfd31d2a Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 12 May 2014 21:38:52 +0300 Subject: [PATCH 075/214] Movement Statistics --- src/Entities/Entity.cpp | 15 ++++++- src/Entities/Player.cpp | 86 ++++++++++++++++++++++++++++++++++++----- src/Entities/Player.h | 6 +++ src/Item.h | 2 +- src/Mobs/Monster.cpp | 4 +- src/Statistics.cpp | 2 +- 6 files changed, 101 insertions(+), 14 deletions(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 9eb03acde..c393f89fd 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -312,12 +312,16 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) if ((a_TDI.Attacker != NULL) && (a_TDI.Attacker->IsPlayer())) { + cPlayer * Player = (cPlayer *)a_TDI.Attacker; + // IsOnGround() only is false if the player is moving downwards - if (!((cPlayer *)a_TDI.Attacker)->IsOnGround()) // TODO: Better damage increase, and check for enchantments (and use magic critical instead of plain) + if (!Player->IsOnGround()) // TODO: Better damage increase, and check for enchantments (and use magic critical instead of plain) { a_TDI.FinalDamage += 2; m_World->BroadcastEntityAnimation(*this, 4); // Critical hit } + + Player->GetStatManager().AddValue(statDamageDealt, round(a_TDI.FinalDamage * 10)); } m_Health -= (short)a_TDI.FinalDamage; @@ -580,9 +584,16 @@ void cEntity::Tick(float a_Dt, cChunk & a_Chunk) if (m_AttachedTo != NULL) { - if ((m_Pos - m_AttachedTo->GetPosition()).Length() > 0.5) + Vector3d DeltaPos = m_Pos - m_AttachedTo->GetPosition(); + if (DeltaPos.Length() > 0.5) { SetPosition(m_AttachedTo->GetPosition()); + + if (IsPlayer()) + { + cPlayer * Player = (cPlayer *)this; + Player->UpdateMovementStats(DeltaPos); + } } } else diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 48bb509b9..3df7c4c34 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -194,6 +194,8 @@ void cPlayer::Tick(float a_Dt, cChunk & a_Chunk) return; } } + + m_Stats.AddValue(statMinutesPlayed, 1); if (!a_Chunk.IsValid()) { @@ -835,6 +837,8 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI) // Any kind of damage adds food exhaustion AddFoodExhaustion(0.3f); SendHealth(); + + m_Stats.AddValue(statDamageTaken, round(a_TDI.FinalDamage * 10)); return true; } return false; @@ -865,6 +869,8 @@ void cPlayer::KilledBy(cEntity * a_Killer) Pickups.Add(cItem(E_ITEM_RED_APPLE)); } + m_Stats.AddValue(statItemsDropped, Pickups.Size()); + m_World->SpawnItemPickups(Pickups, GetPosX(), GetPosY(), GetPosZ(), 10); SaveToDisk(); // Save it, yeah the world is a tough place ! @@ -1262,6 +1268,9 @@ void cPlayer::MoveTo( const Vector3d & a_NewPos ) // TODO: should do some checks to see if player is not moving through terrain // TODO: Official server refuses position packets too far away from each other, kicking "hacked" clients; we should, too + + Vector3d DeltaPos = a_NewPos - GetPosition(); + UpdateMovementStats(DeltaPos); SetPosition( a_NewPos ); SetStance(a_NewPos.y + 1.62); @@ -1492,10 +1501,7 @@ void cPlayer::TossEquippedItem(char a_Amount) Drops.push_back(DroppedItem); } - double vX = 0, vY = 0, vZ = 0; - EulerToVector(-GetYaw(), GetPitch(), vZ, vX, vY); - vY = -vY * 2 + 1.f; - m_World->SpawnItemPickups(Drops, GetPosX(), GetEyeHeight(), GetPosZ(), vX * 3, vY * 3, vZ * 3, true); // 'true' because created by player + TossItems(Drops); } @@ -1511,6 +1517,7 @@ void cPlayer::TossHeldItem(char a_Amount) char OriginalItemAmount = Item.m_ItemCount; Item.m_ItemCount = std::min(OriginalItemAmount, a_Amount); Drops.push_back(Item); + if (OriginalItemAmount > a_Amount) { Item.m_ItemCount = OriginalItemAmount - a_Amount; @@ -1521,10 +1528,7 @@ void cPlayer::TossHeldItem(char a_Amount) } } - double vX = 0, vY = 0, vZ = 0; - EulerToVector(-GetYaw(), GetPitch(), vZ, vX, vY); - vY = -vY * 2 + 1.f; - m_World->SpawnItemPickups(Drops, GetPosX(), GetEyeHeight(), GetPosZ(), vX * 3, vY * 3, vZ * 3, true); // 'true' because created by player + TossItems(Drops); } @@ -1536,10 +1540,21 @@ void cPlayer::TossPickup(const cItem & a_Item) cItems Drops; Drops.push_back(a_Item); + TossItems(Drops); +} + + + + + +void cPlayer::TossItems(const cItems & a_Items) +{ + m_Stats.AddValue(statItemsDropped, a_Items.Size()); + double vX = 0, vY = 0, vZ = 0; EulerToVector(-GetYaw(), GetPitch(), vZ, vX, vY); vY = -vY * 2 + 1.f; - m_World->SpawnItemPickups(Drops, GetPosX(), GetEyeHeight(), GetPosZ(), vX * 3, vY * 3, vZ * 3, true); // 'true' because created by player + m_World->SpawnItemPickups(a_Items, GetPosX(), GetEyeHeight(), GetPosZ(), vX * 3, vY * 3, vZ * 3, true); // 'true' because created by player } @@ -1935,6 +1950,59 @@ void cPlayer::HandleFloater() +void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos) +{ + StatValue Value = round(a_DeltaPos.Length() * 100); + + if (m_AttachedTo == NULL) + { + int PosX = POSX_TOINT; + int PosY = POSY_TOINT; + int PosZ = POSZ_TOINT; + + BLOCKTYPE Block; + NIBBLETYPE Meta; + if (!m_World->GetBlockTypeMeta(PosX, PosY, PosZ, Block, Meta)) + { + return; + } + + if ((Block == E_BLOCK_LADDER) && (a_DeltaPos.y > 0.0)) // Going up + { + m_Stats.AddValue(statDistClimbed, round(a_DeltaPos.y * 100)); + } + else + { + // TODO 2014-05-12 xdot: Other types + m_Stats.AddValue(statDistWalked, Value); + } + } + else + { + switch (m_AttachedTo->GetEntityType()) + { + case cEntity::etMinecart: m_Stats.AddValue(statDistMinecart, Value); break; + case cEntity::etBoat: m_Stats.AddValue(statDistBoat, Value); break; + case cEntity::etMonster: + { + cMonster * Monster = (cMonster *)m_AttachedTo; + switch (Monster->GetMobType()) + { + case cMonster::mtPig: m_Stats.AddValue(statDistPig, Value); break; + case cMonster::mtHorse: m_Stats.AddValue(statDistHorse, Value); break; + default: break; + } + break; + } + default: break; + } + } +} + + + + + void cPlayer::ApplyFoodExhaustionFromMovement() { if (IsGameModeCreative()) diff --git a/src/Entities/Player.h b/src/Entities/Player.h index b5c9d75cc..3de5e9c68 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -391,6 +391,9 @@ public: /** If true the player can fly even when he's not in creative. */ void SetCanFly(bool a_CanFly); + /** Update movement-related statistics. */ + void UpdateMovementStats(const Vector3d & a_DeltaPos); + /** Returns wheter the player can fly or not. */ virtual bool CanFly(void) const { return m_CanFly; } // tolua_end @@ -524,6 +527,9 @@ protected: /** Called in each tick if the player is fishing to make sure the floater dissapears when the player doesn't have a fishing rod as equipped item. */ void HandleFloater(void); + /** Tosses a list of items. */ + void TossItems(const cItems & a_Items); + /** Adds food exhaustion based on the difference between Pos and LastPos, sprinting status and swimming (in water block) */ void ApplyFoodExhaustionFromMovement(); diff --git a/src/Item.h b/src/Item.h index 2f65d5344..acbc880dc 100644 --- a/src/Item.h +++ b/src/Item.h @@ -228,7 +228,7 @@ public: void Add (const cItem & a_Item) {push_back(a_Item); } void Delete(int a_Idx); void Clear (void) {clear(); } - size_t Size (void) {return size(); } + size_t Size (void) const { return size(); } void Set (int a_Idx, short a_ItemType, char a_ItemCount, short a_ItemDamage); void Add (short a_ItemType, char a_ItemCount, short a_ItemDamage) diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 62670907f..f3b408e68 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -464,8 +464,10 @@ bool cMonster::DoTakeDamage(TakeDamageInfo & a_TDI) return false; } - if((m_SoundHurt != "") && (m_Health > 0)) + if ((m_SoundHurt != "") && (m_Health > 0)) + { m_World->BroadcastSoundEffect(m_SoundHurt, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f); + } if (a_TDI.Attacker != NULL) { diff --git a/src/Statistics.cpp b/src/Statistics.cpp index 65addb0dd..5950eb96c 100644 --- a/src/Statistics.cpp +++ b/src/Statistics.cpp @@ -64,7 +64,7 @@ cStatInfo cStatInfo::ms_Info[statCount] = { cStatInfo(statDistHorse, "stat.horseOneCm"), cStatInfo(statJumps, "stat.jump"), cStatInfo(statItemsDropped, "stat.drop"), - cStatInfo(statDamageDealt, "stat.damageDealth"), + cStatInfo(statDamageDealt, "stat.damageDealt"), cStatInfo(statDamageTaken, "stat.damageTaken"), cStatInfo(statDeaths, "stat.deaths"), cStatInfo(statMobKills, "stat.mobKills"), From 9c8e8ef7aece2f881ef97c387600c8a751579b20 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 12 May 2014 22:43:59 +0200 Subject: [PATCH 076/214] VillageGen: Added well placement and the general algorithm description. --- src/Generating/Prefab.h | 3 + src/Generating/VillageGen.cpp | 147 ++++++++++++++++++++++++++++++++-- src/Generating/VillageGen.h | 8 +- 3 files changed, 152 insertions(+), 6 deletions(-) diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h index 37db2ff16..472584c3a 100644 --- a/src/Generating/Prefab.h +++ b/src/Generating/Prefab.h @@ -95,6 +95,9 @@ public: /** Returns the weight (chance) of this prefab generating as the next piece after the specified placed piece. PiecePool implementations can use this for their GetPieceWeight() implementations. */ int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector) const; + + /** Returns the unmodified DefaultWeight property for the piece. */ + int GetDefaultWeight(void) const { return m_DefaultWeight; } protected: /** Packs complete definition of a single block, for per-letter assignment. */ diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index fb6191df2..3d89d7aa2 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -12,30 +12,167 @@ +/* +How village generating works: +By descending from a cGridStructGen, a semi-random grid is generated. A village may be generated for each of +the grid's cells. Each cell checks the biomes in an entire chunk around it, only generating a village if all +biomes are village-friendly. If yes, the entire village structure is built for that cell. If not, the cell +is left village-less. + +A village is generated starting by its well. The well is placed in the grid's origin point. Then a set of +random lengths roads is generated - 4 roads going from the well, then at the end of each road another set of +roads, crossing them perpendicular, then at the end of those another set, up to a set maximum branching +depth. The roads are placed in a T or L shape, with the old road being the center stem of the T. Roads avoid +crossing each other and going further away from the well than the maximum block size of the village. +Finally, houses are places along the roads, avoiding collisions with already-existing items. + +When the village is about to be drawn into a chunk, it queries the heights for each item intersecting the +chunk. The prefabs are shifted so that their pivot points lie on the surface, and the roads are drawn +directly by turning the surface blocks into gravel / sandstone. +*/ + class cVillageGen::cVillage : public cGridStructGen::cStructure { typedef cGridStructGen::cStructure super; public: - cVillage(int a_Seed, int a_OriginX, int a_OriginZ, cPrefabPiecePool & a_Prefabs) : + cVillage( + int a_Seed, + int a_OriginX, int a_OriginZ, + int a_MaxRoadDepth, + int a_MaxSize, + cPrefabPiecePool & a_Prefabs, + cTerrainHeightGen & a_HeightGen + ) : super(a_OriginX, a_OriginZ), m_Seed(a_Seed), - m_Prefabs(a_Prefabs) + m_Noise(a_Seed), + m_MaxSize(a_MaxSize), + m_Borders(a_OriginX - a_MaxSize, 0, a_OriginZ - a_MaxSize, a_OriginX + a_MaxSize, 255, a_OriginZ + a_MaxSize), + m_Prefabs(a_Prefabs), + m_HeightGen(a_HeightGen) { + PlaceWell(); + BuildRoads(a_MaxRoadDepth); + PlaceHouses(); } protected: + class cItem + { + public: + /* The position of the item, X/Z-wise: */ + int m_MinX, m_MaxX, m_MinZ, m_MaxZ; + + /** The prefab to use. If NULL, this is a road. */ + cPrefab * m_Prefab; + + /** Number of rotations that should be applied to the prefab. */ + int m_NumRotations; + + /* The bottom of the prefab. Only valid if the item is a prefab, not valid for roads. */ + int m_BaseY; + + /** Creates a new item with the specified parameters. + m_BaseY is set to -1 and will be adjusted later on when drawing. */ + cItem(int a_MinX, int a_MaxX, int a_MinZ, int a_MaxZ, cPrefab * a_Prefab, int a_NumRotations) : + m_MinX(a_MinX), + m_MaxX(a_MaxX), + m_MinZ(a_MinZ), + m_MaxZ(a_MaxZ), + m_Prefab(a_Prefab), + m_NumRotations(a_NumRotations), + m_BaseY(-1) + { + } + } ; + typedef SharedPtr cItemPtr; + typedef std::vector cItemPtrs; + + /** Seed for the random functions */ int m_Seed; + /** The noise used as a pseudo-random generator */ + cNoise m_Noise; + + /** Maximum size, in X/Z blocks, of the village (radius from the origin) */ + int m_MaxSize; + + /** Borders of the vilalge - no item may reach out of this cuboid. */ + cCuboid m_Borders; + /** Prefabs to use for buildings */ cPrefabPiecePool & m_Prefabs; + /** The underlying height generator, used for placing the structures on top of the terrain. */ + cTerrainHeightGen & m_HeightGen; + + /** The items that are generated in the village (houses, roads). */ + cItemPtrs m_Items; + + + /** Places the well at the center of the village */ + void PlaceWell(void) + { + // Pick a prefab from the starting pieces: + cPieces StartingPieces = ((cPiecePool &)m_Prefabs).GetStartingPieces(); + ASSERT(!StartingPieces.empty()); + int TotalWeight = 0; + for (cPieces::const_iterator itr = StartingPieces.begin(), end = StartingPieces.end(); itr != end; ++itr) + { + TotalWeight += ((const cPrefab *)(*itr))->GetDefaultWeight(); + } + ASSERT(TotalWeight > 0); + int rnd = (m_Noise.IntNoise2DInt(m_OriginX, m_OriginZ) / 7) % TotalWeight; + cPiece * WellPiece = StartingPieces[0]; + for (cPieces::const_iterator itr = StartingPieces.begin(), end = StartingPieces.end(); itr != end; ++itr) + { + rnd -= ((const cPrefab *)(*itr))->GetDefaultWeight(); + if (rnd <= 0) + { + WellPiece = *itr; + break; + } + } + ASSERT(WellPiece != NULL); + + // Pick a rotation: + // TODO + int NumRotations = 0; + Vector3i Size = WellPiece->GetSize(); + + // Put the well in the placed items array: + m_Items.push_back(cItemPtr(new cItem(m_OriginX, m_OriginX + Size.x, m_OriginZ, m_OriginZ + Size.z, (cPrefab *)WellPiece, NumRotations))); + } + + + /** Places the roads going from the well outwards. */ + void BuildRoads(int a_MaxRoadDepth) + { + /* + ASSERT(m_Items.size() == 1); + const cItem & Well = *m_Items[0]; + */ + // TODO + } + + + /** Places houses along the roads. */ + void PlaceHouses(void) + { + // TODO + } + + // cGrdStructGen::cStructure overrides: virtual void DrawIntoChunk(cChunkDesc & a_Chunk) override { // TODO + // Iterate over all items + // Each intersecting prefab is placed on ground (if not already placed), then drawn + // Each intersecting road is drawn by replacing top soil blocks with gravel / sandstone blocks } } ; @@ -53,8 +190,8 @@ cPrefabPiecePool cVillageGen::m_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVi -cVillageGen::cVillageGen(int a_Seed, int a_GridSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen) : - super(a_Seed, a_GridSize, a_GridSize, 128, 128, 100), +cVillageGen::cVillageGen(int a_Seed, int a_GridSize, int a_MaxRoadDepth, int a_MaxSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen) : + super(a_Seed, a_GridSize, a_GridSize, a_MaxSize, a_MaxSize, 100), m_BiomeGen(a_BiomeGen), m_HeightGen(a_HeightGen) { @@ -108,7 +245,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ { return cStructurePtr(); } - return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, *VillagePrefabs)); + return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, m_MaxRoadDepth, m_MaxSize, *VillagePrefabs, m_HeightGen)); } diff --git a/src/Generating/VillageGen.h b/src/Generating/VillageGen.h index d3cc8ef9c..acbd76881 100644 --- a/src/Generating/VillageGen.h +++ b/src/Generating/VillageGen.h @@ -21,7 +21,7 @@ class cVillageGen : { typedef cGridStructGen super; public: - cVillageGen(int a_Seed, int a_GridSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen); + cVillageGen(int a_Seed, int a_GridSize, int a_MaxRoadDepth, int a_MaxSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen); protected: class cVillage; // fwd: VillageGen.cpp @@ -31,6 +31,12 @@ protected: /** The prefabs for the plains village. We're not exactly using the cPiecePool functionality, only the containment. */ static cPrefabPiecePool m_PlainsVillage; + + /** Maximum number of roads generated one from another (tree depth). */ + int m_MaxRoadDepth; + + /** Maximum size, in X/Z blocks, of the village (radius from the origin) */ + int m_MaxSize; /** The underlying biome generator that defines whether the village is created or not */ cBiomeGen & m_BiomeGen; From 0685fb5258c6e4bdca310a3d22f8f997a2a556bb Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 13 May 2014 08:48:33 +0200 Subject: [PATCH 077/214] Added doxy-comment requirement --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c36be8b7..03481ec48 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ Code Stuff - The only exception: a `switch` statement with all `case` statements being a single short statement is allowed to use the short brace-less form. - These two rules really mean that indent is governed by braces * Add an empty last line in all source files (GCC and GIT can complain otherwise) - * Use doxy-comments for functions in the header file, format as `/** Description */` + * All new public functions in all classes need documenting comments on what they do and what behavior they follow, use doxy-comments formatted as `/** Description */`. Do not use asterisks on additional lines in multi-line comments. * Use spaces after the comment markers: `// Comment` instead of `//Comment` From 466ff2204f18fda5f4f0f0b3e19f671d57747c24 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 13 May 2014 14:53:15 +0300 Subject: [PATCH 078/214] Fixes --- src/Entities/Player.cpp | 21 +++++++++++---------- src/Entities/Player.h | 9 +++------ src/Mobs/Monster.cpp | 2 +- src/WorldStorage/StatSerializer.cpp | 7 +++++-- src/WorldStorage/StatSerializer.h | 4 +++- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 3df7c4c34..632c41936 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -820,7 +820,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI) if ((a_TDI.Attacker != NULL) && (a_TDI.Attacker->IsPlayer())) { - cPlayer* Attacker = (cPlayer*) a_TDI.Attacker; + cPlayer * Attacker = (cPlayer *)a_TDI.Attacker; if ((m_Team != NULL) && (m_Team == Attacker->m_Team)) { @@ -880,7 +880,7 @@ void cPlayer::KilledBy(cEntity * a_Killer) } else if (a_Killer->IsPlayer()) { - cPlayer* Killer = (cPlayer*)a_Killer; + cPlayer * Killer = (cPlayer *)a_Killer; GetWorld()->BroadcastChatDeath(Printf("%s was killed by %s", GetName().c_str(), Killer->GetName().c_str())); } @@ -1150,6 +1150,7 @@ unsigned int cPlayer::AwardAchievement(const eStatistic a_Ach) { eStatistic Prerequisite = cStatInfo::GetPrerequisite(a_Ach); + // Check if the prerequisites are met if (Prerequisite != statInvalid) { if (m_Stats.GetValue(Prerequisite) == 0) @@ -1166,14 +1167,16 @@ unsigned int cPlayer::AwardAchievement(const eStatistic a_Ach) } else { + // First time, announce it cCompositeChat Msg; Msg.AddTextPart(m_PlayerName + " has just earned the achievement "); - Msg.AddTextPart(cStatInfo::GetName(a_Ach)); // TODO 2014-05-12 xdot: Use the proper cCompositeChat submessage type and send the actual title + Msg.AddTextPart(cStatInfo::GetName(a_Ach)); // TODO 2014-05-12 xdot: Use the proper cCompositeChat part (cAchievement) m_World->BroadcastChat(Msg); + // Increment the statistic StatValue New = m_Stats.AddValue(a_Ach); - /* Achievement Get! */ + // Achievement Get! m_ClientHandle->SendStatistics(m_Stats); return New; @@ -1707,9 +1710,8 @@ bool cPlayer::LoadFromDisk() m_LoadedWorldName = root.get("world", "world").asString(); - /* Load the player stats. - * We use the default world name (like bukkit) because stats are shared between dimensions/worlds. - */ + // Load the player stats. + // We use the default world name (like bukkit) because stats are shared between dimensions/worlds. cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats); StatSerializer.Load(); @@ -1784,9 +1786,8 @@ bool cPlayer::SaveToDisk() return false; } - /* Save the player stats. - * We use the default world name (like bukkit) because stats are shared between dimensions/worlds. - */ + // Save the player stats. + // We use the default world name (like bukkit) because stats are shared between dimensions/worlds. cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), m_PlayerName, &m_Stats); if (!StatSerializer.Save()) { diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 3de5e9c68..78b534d83 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -181,12 +181,9 @@ public: cStatManager & GetStatManager() { return m_Stats; } /** Awards the player an achievement. - * - * If all prerequisites are met, this method will award the achievement and will broadcast a chat message. - * If the achievement has been already awarded to the player, this method will just increment the stat counter. - * - * Returns the _new_ stat value. (0 = Could not award achievement) - */ + If all prerequisites are met, this method will award the achievement and will broadcast a chat message. + If the achievement has been already awarded to the player, this method will just increment the stat counter. + Returns the _new_ stat value. (0 = Could not award achievement) */ unsigned int AwardAchievement(const eStatistic a_Ach); void SetIP(const AString & a_IP); diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index f3b408e68..b2e42445b 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -464,7 +464,7 @@ bool cMonster::DoTakeDamage(TakeDamageInfo & a_TDI) return false; } - if ((m_SoundHurt != "") && (m_Health > 0)) + if (!m_SoundHurt.empty() && (m_Health > 0)) { m_World->BroadcastSoundEffect(m_SoundHurt, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f); } diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp index 66e5e1e9e..74113941c 100644 --- a/src/WorldStorage/StatSerializer.cpp +++ b/src/WorldStorage/StatSerializer.cpp @@ -11,15 +11,18 @@ -cStatSerializer::cStatSerializer(const AString& a_WorldName, const AString& a_PlayerName, cStatManager* a_Manager) +cStatSerializer::cStatSerializer(const AString & a_WorldName, const AString & a_PlayerName, cStatManager * a_Manager) : m_Manager(a_Manager) { + // Even though stats are shared between worlds, they are (usually) saved + // inside the folder of the default world. + AString StatsPath; Printf(StatsPath, "%s/stats", a_WorldName.c_str()); m_Path = StatsPath + "/" + a_PlayerName + ".json"; - /* Ensure that the directory exists. */ + // Ensure that the directory exists. cFile::CreateFolder(FILE_IO_PREFIX + StatsPath); } diff --git a/src/WorldStorage/StatSerializer.h b/src/WorldStorage/StatSerializer.h index 43514465b..72f8d74f1 100644 --- a/src/WorldStorage/StatSerializer.h +++ b/src/WorldStorage/StatSerializer.h @@ -25,10 +25,12 @@ class cStatSerializer { public: - cStatSerializer(const AString& a_WorldName, const AString& a_PlayerName, cStatManager* a_Manager); + cStatSerializer(const AString & a_WorldName, const AString & a_PlayerName, cStatManager * a_Manager); + /* Try to load the player statistics. Returns whether the operation was successful or not. */ bool Load(void); + /* Try to save the player statistics. Returns whether the operation was successful or not. */ bool Save(void); From 3660ce68343ad2e867e49d1650f61fc0eb85ac23 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 15 May 2014 00:12:01 +0200 Subject: [PATCH 079/214] cPrefab can be constructed in code. --- src/Generating/Prefab.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/Generating/Prefab.h | 15 +++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index 0f20603be..9aef7a94b 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -136,6 +136,33 @@ cPrefab::cPrefab(const cPrefab::sDef & a_Def) : ParseConnectors(a_Def.m_Connectors); ParseDepthWeight(a_Def.m_DepthWeight); + AddRotatedBlockAreas(); +} + + + + + +cPrefab::cPrefab(const cBlockArea & a_Image, int a_AllowedRotations) : + m_Size(a_Image.GetSize()), + m_AllowedRotations(a_AllowedRotations), + m_MergeStrategy(cBlockArea::msOverwrite), + m_ShouldExtendFloor(false), + m_DefaultWeight(1), + m_AddWeightIfSame(0) +{ + m_HitBox.p1.Set(0, 0, 0); + m_HitBox.p2.Set(m_Size.x - 1, m_Size.y - 1, m_Size.z - 1); + m_BlockArea[0].CopyFrom(a_Image); + AddRotatedBlockAreas(); +} + + + + + +void cPrefab::AddRotatedBlockAreas(void) +{ // 1 CCW rotation: if ((m_AllowedRotations & 0x01) != 0) { @@ -257,6 +284,15 @@ int cPrefab::GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cC +void cPrefab::AddConnector(int a_RelX, int a_RelY, int a_RelZ, eBlockFace a_Direction, int a_Type) +{ + m_Connectors.push_back(cConnector(a_RelX, a_RelY, a_RelZ, a_Type, a_Direction)); +} + + + + + void cPrefab::ParseCharMap(CharMap & a_CharMapOut, const char * a_CharMapDef) { ASSERT(a_CharMapDef != NULL); diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h index 472584c3a..c08413e87 100644 --- a/src/Generating/Prefab.h +++ b/src/Generating/Prefab.h @@ -84,8 +84,13 @@ public: int m_AddWeightIfSame; }; + + /** Creates a prefab from the provided definition. */ cPrefab(const sDef & a_Def); + /** Creates a prefab based on the given BlockArea and allowed rotations. */ + cPrefab(const cBlockArea & a_Image, int a_AllowedRotations); + /** Draws the prefab into the specified chunk, according to the placement stored in the PlacedPiece. */ void Draw(cChunkDesc & a_Dest, const cPlacedPiece * a_Placement) const; @@ -98,6 +103,12 @@ public: /** Returns the unmodified DefaultWeight property for the piece. */ int GetDefaultWeight(void) const { return m_DefaultWeight; } + + /** Sets the AddWeightIfSame member, that is used to modify the weight when the previous piece is the same prefab */ + void SetAddWeightIfSame(int a_AddWeightIfSame) { m_AddWeightIfSame = a_AddWeightIfSame; } + + /** Adds the specified connector to the list of connectors this piece supports. */ + void AddConnector(int a_RelX, int a_RelY, int a_RelZ, eBlockFace a_Direction, int a_Type); protected: /** Packs complete definition of a single block, for per-letter assignment. */ @@ -160,6 +171,10 @@ protected: virtual cCuboid GetHitBox(void) const override; virtual bool CanRotateCCW(int a_NumRotations) const override; + /** Based on the m_AllowedRotations, adds rotated cBlockAreas to the m_BlockArea array. + To be called only from this class's constructor! */ + void AddRotatedBlockAreas(void); + /** Parses the CharMap in the definition into a CharMap binary data used for translating the definition into BlockArea. */ void ParseCharMap(CharMap & a_CharMapOut, const char * a_CharMapDef); From f5fdbdaf29738f51fdb8a4a0e5aa78631c6540cf Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 15 May 2014 00:14:06 +0200 Subject: [PATCH 080/214] VillageGen rewritten using BFSPieceGenerator. Piece composition is not good yet, the buildings aren't height-adjusted and the road pieces will need special processing. This is mainly for adjusting the per-piece params. --- src/Generating/ComposableGenerator.cpp | 9 + .../Prefabs/PlainsVillagePrefabs.cpp | 416 +++++++++--------- src/Generating/Prefabs/SandVillagePrefabs.cpp | 185 ++++---- src/Generating/VillageGen.cpp | 196 ++++----- src/Generating/VillageGen.h | 12 +- 5 files changed, 406 insertions(+), 412 deletions(-) diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp index 2e886336f..1bb836684 100644 --- a/src/Generating/ComposableGenerator.cpp +++ b/src/Generating/ComposableGenerator.cpp @@ -25,6 +25,7 @@ #include "Noise3DGenerator.h" #include "POCPieceGenerator.h" #include "Ravines.h" +#include "VillageGen.h" @@ -32,6 +33,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cTerrainCompositionGen: + cTerrainCompositionGen * cTerrainCompositionGen::CreateCompositionGen(cIniFile & a_IniFile, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen, int a_Seed) { AString CompoGenName = a_IniFile.GetValueSet("Generator", "CompositionGen", ""); @@ -404,6 +406,13 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile) { m_FinishGens.push_back(new cStructGenTrees(Seed, m_BiomeGen, m_HeightGen, m_CompositionGen)); } + else if (NoCaseCompare(*itr, "Villages") == 0) + { + int GridSize = a_IniFile.GetValueSetI("Generator", "VillageGridSize", 256); + int MaxDepth = a_IniFile.GetValueSetI("Generator", "VillageMaxDepth", 7); + int MaxSize = a_IniFile.GetValueSetI("Generator", "VillageMaxSize", 128); + m_FinishGens.push_back(new cVillageGen(Seed, GridSize, MaxDepth, MaxSize, *m_BiomeGen, *m_HeightGen)); + } else if (NoCaseCompare(*itr, "WaterLakes") == 0) { int Probability = a_IniFile.GetValueSetI("Generator", "WaterLakesProbability", 25); diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index f59e22fb3..508f0d3b6 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -174,7 +174,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 10 */ ".......mmmmm", // Connectors: - "", + "-1: 7, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -216,7 +216,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "d: 4: 0\n" /* cobblestone */ "e: 17: 0\n" /* tree */ "f: 5: 0\n" /* wood */ - "g: 64: 5\n" /* wooddoorblock */ + "g: 64: 7\n" /* wooddoorblock */ "h: 64:12\n" /* wooddoorblock */ "i:102: 0\n" /* glasspane */ "j: 53: 2\n" /* woodstairs */ @@ -288,7 +288,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ ".......", // Connectors: - "", + "-1: 3, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -330,7 +330,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "d: 4: 0\n" /* cobblestone */ "e: 17: 0\n" /* tree */ "f: 5: 0\n" /* wood */ - "g: 64: 5\n" /* wooddoorblock */ + "g: 64: 7\n" /* wooddoorblock */ "h:102: 0\n" /* glasspane */ "i: 64:12\n" /* wooddoorblock */ "j: 53: 2\n" /* woodstairs */ @@ -434,7 +434,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "...........", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -561,7 +561,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "..lgp..", // Connectors: - "", + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -725,7 +725,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "...............", // Connectors: - "", + "-1: 7, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1016,7 +1016,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 12 */ ".......", // Connectors: - "", + "-1: 3, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1087,7 +1087,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "dmmmmmdmdmmmmmd", // Connectors: - "", + "-1: 7, 0, 8: 3\n" /* Type -1, direction Z+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1134,7 +1134,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "i: 53: 1\n" /* woodstairs */ "j: 85: 0\n" /* fence */ "k: 53: 0\n" /* woodstairs */ - "l: 64: 4\n" /* wooddoorblock */ + "l: 64: 6\n" /* wooddoorblock */ "m: 19: 0\n" /* sponge */ "n: 64: 0\n" /* wooddoorblock */ "o:102: 0\n" /* glasspane */ @@ -1238,7 +1238,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 10 */ "mmkbimmmmm", // Connectors: - "", + "-1: 1, 0, 5: 4\n" /* Type -1, direction X- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1281,22 +1281,23 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "e: 5: 0\n" /* wood */ "f: 67: 3\n" /* stairs */ "g: 17: 0\n" /* tree */ - "h: 64: 5\n" /* wooddoorblock */ - "i:102: 0\n" /* glasspane */ - "j: 64:12\n" /* wooddoorblock */ - "k: 53: 2\n" /* woodstairs */ - "l: 53: 1\n" /* woodstairs */ + "h: 64: 7\n" /* wooddoorblock */ + "i: 64: 5\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 64:12\n" /* wooddoorblock */ + "l: 53: 2\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 53: 7\n" /* woodstairs */ - "o: 53: 6\n" /* woodstairs */ - "p: 53: 3\n" /* woodstairs */ - "q: 53: 0\n" /* woodstairs */ - "r: 53: 5\n" /* woodstairs */ - "s: 53: 4\n" /* woodstairs */ - "t: 50: 3\n" /* torch */ - "u: 50: 2\n" /* torch */ - "v: 50: 4\n" /* torch */ - "w: 50: 1\n" /* torch */, + "n: 53: 1\n" /* woodstairs */ + "o: 53: 7\n" /* woodstairs */ + "p: 53: 6\n" /* woodstairs */ + "q: 53: 3\n" /* woodstairs */ + "r: 53: 0\n" /* woodstairs */ + "s: 53: 5\n" /* woodstairs */ + "t: 53: 4\n" /* woodstairs */ + "u: 50: 3\n" /* torch */ + "v: 50: 2\n" /* torch */ + "w: 50: 4\n" /* torch */ + "x: 50: 1\n" /* torch */, // Block data: // Level 0 @@ -1329,7 +1330,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 4 */ ".e............e." /* 5 */ ".e............e." /* 6 */ ".e............e." - /* 7 */ ".geeeeheg.....e." + /* 7 */ ".geeeeieg.....e." /* 8 */ "mmmmmm.me.....e." /* 9 */ "mmmmmmmme.....e." /* 10 */ "mmmmmmmme.....e." @@ -1343,81 +1344,81 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* z\x* 111111 */ /* * 0123456789012345 */ /* 0 */ "................" - /* 1 */ ".geiieiigjgiieg." - /* 2 */ ".i............e." - /* 3 */ ".i............i." - /* 4 */ ".i............i." - /* 5 */ ".i............e." - /* 6 */ ".i............i." - /* 7 */ ".geiiejeg.....i." + /* 1 */ ".gejjejjgkgjjeg." + /* 2 */ ".j............e." + /* 3 */ ".j............j." + /* 4 */ ".j............j." + /* 5 */ ".j............e." + /* 6 */ ".j............j." + /* 7 */ ".gejjekeg.....j." /* 8 */ "mmmmmm.me.....e." - /* 9 */ "mmmmmmmmi.....i." - /* 10 */ "mmmmmmmmi.....i." + /* 9 */ "mmmmmmmmj.....j." + /* 10 */ "mmmmmmmmj.....j." /* 11 */ "mmmmmmmme.....e." - /* 12 */ "mmmmmmmmi.....i." - /* 13 */ "mmmmmmmmi.....i." - /* 14 */ "mmmmmmmmgiiiiig." + /* 12 */ "mmmmmmmmj.....j." + /* 13 */ "mmmmmmmmj.....j." + /* 14 */ "mmmmmmmmgjjjjjg." /* 15 */ "mmmmmmmm........" // Level 3 /* z\x* 111111 */ /* * 0123456789012345 */ - /* 0 */ "kkkkkkkkkkkkkkkl" - /* 1 */ "ngeeeeeegegeeegl" - /* 2 */ ".e............el" - /* 3 */ ".e............el" - /* 4 */ ".e............el" - /* 5 */ ".e............el" - /* 6 */ ".e............el" - /* 7 */ "ogeeeeeeg.....el" - /* 8 */ "pppppppqe.....el" - /* 9 */ "mmmmmmmqe.....el" - /* 10 */ "mmmmmmmqe.....el" - /* 11 */ "mmmmmmmqe.....el" - /* 12 */ "mmmmmmmqe.....el" - /* 13 */ "mmmmmmmqe.....el" - /* 14 */ "mmmmmmmqgeeeeegl" - /* 15 */ "mmmmmmmqr.....sl" + /* 0 */ "llllllllllllllln" + /* 1 */ "ogeeeeeegegeeegn" + /* 2 */ ".e............en" + /* 3 */ ".e............en" + /* 4 */ ".e............en" + /* 5 */ ".e............en" + /* 6 */ ".e............en" + /* 7 */ "pgeeeeeeg.....en" + /* 8 */ "qqqqqqqre.....en" + /* 9 */ "mmmmmmmre.....en" + /* 10 */ "mmmmmmmre.....en" + /* 11 */ "mmmmmmmre.....en" + /* 12 */ "mmmmmmmre.....en" + /* 13 */ "mmmmmmmre.....en" + /* 14 */ "mmmmmmmrgeeeeegn" + /* 15 */ "mmmmmmmrs.....tn" // Level 4 /* z\x* 111111 */ /* * 0123456789012345 */ /* 0 */ "................" - /* 1 */ "kkkkkkkkkkkkkkk." - /* 2 */ "neeeeeeeeeeeeel." - /* 3 */ ".e.........t.el." - /* 4 */ ".e..........uel." - /* 5 */ ".e......v....el." - /* 6 */ "oeeeeeeeee...el." - /* 7 */ "ppppppppqew..el." - /* 8 */ "mmmmmmmmqe...el." - /* 9 */ "mmmmmmmmqe...el." - /* 10 */ "mmmmmmmmqe...el." - /* 11 */ "mmmmmmmmqe...el." - /* 12 */ "mmmmmmmmqe...el." - /* 13 */ "mmmmmmmmqe...el." - /* 14 */ "mmmmmmmmqeeeeel." - /* 15 */ "mmmmmmmmqr...sl." + /* 1 */ "lllllllllllllll." + /* 2 */ "oeeeeeeeeeeeeen." + /* 3 */ ".e.........u.en." + /* 4 */ ".e..........ven." + /* 5 */ ".e......w....en." + /* 6 */ "peeeeeeeee...en." + /* 7 */ "qqqqqqqqrex..en." + /* 8 */ "mmmmmmmmre...en." + /* 9 */ "mmmmmmmmre...en." + /* 10 */ "mmmmmmmmre...en." + /* 11 */ "mmmmmmmmre...en." + /* 12 */ "mmmmmmmmre...en." + /* 13 */ "mmmmmmmmre...en." + /* 14 */ "mmmmmmmmreeeeen." + /* 15 */ "mmmmmmmmrs...tn." // Level 5 /* z\x* 111111 */ /* * 0123456789012345 */ /* 0 */ "................" /* 1 */ "................" - /* 2 */ "kkkkkkkkkkkkkl.." - /* 3 */ "neeeeeeeeeeeel.." - /* 4 */ ".ew.........el.." - /* 5 */ "oeeeeeeeeee.el.." - /* 6 */ "pppppppppqe.el.." - /* 7 */ ".........qe.el.." - /* 8 */ "mmmmmmmm.qe.el.." - /* 9 */ "mmmmmmmm.qe.el.." - /* 10 */ "mmmmmmmm.qe.el.." - /* 11 */ "mmmmmmmm.qe.el.." - /* 12 */ "mmmmmmmm.qe.el.." - /* 13 */ "mmmmmmmm.qevel.." - /* 14 */ "mmmmmmmm.qeeel.." - /* 15 */ "mmmmmmmm.qr.sl.." + /* 2 */ "llllllllllllln.." + /* 3 */ "oeeeeeeeeeeeen.." + /* 4 */ ".ex.........en.." + /* 5 */ "peeeeeeeeee.en.." + /* 6 */ "qqqqqqqqqre.en.." + /* 7 */ ".........re.en.." + /* 8 */ "mmmmmmmm.re.en.." + /* 9 */ "mmmmmmmm.re.en.." + /* 10 */ "mmmmmmmm.re.en.." + /* 11 */ "mmmmmmmm.re.en.." + /* 12 */ "mmmmmmmm.re.en.." + /* 13 */ "mmmmmmmm.rewen.." + /* 14 */ "mmmmmmmm.reeen.." + /* 15 */ "mmmmmmmm.rs.tn.." // Level 6 /* z\x* 111111 */ @@ -1425,22 +1426,22 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 0 */ "................" /* 1 */ "................" /* 2 */ "................" - /* 3 */ "kkkkkkkkkkkkk..." - /* 4 */ "eeeeeeeeeeeel..." - /* 5 */ "ppppppppppqel..." - /* 6 */ "mmmmmmmmmmqel..." - /* 7 */ "mmmmmmmmmmqel..." - /* 8 */ "mmmmmmmmmmqel..." - /* 9 */ "mmmmmmmmmmqel..." - /* 10 */ "mmmmmmmmmmqel..." - /* 11 */ "mmmmmmmmmmqel..." - /* 12 */ "mmmmmmmmmmqel..." - /* 13 */ "mmmmmmmmmmqel..." - /* 14 */ "mmmmmmmmmmqel..." - /* 15 */ "mmmmmmmmmmqel...", + /* 3 */ "lllllllllllll..." + /* 4 */ "eeeeeeeeeeeen..." + /* 5 */ "qqqqqqqqqqren..." + /* 6 */ "mmmmmmmmmmren..." + /* 7 */ "mmmmmmmmmmren..." + /* 8 */ "mmmmmmmmmmren..." + /* 9 */ "mmmmmmmmmmren..." + /* 10 */ "mmmmmmmmmmren..." + /* 11 */ "mmmmmmmmmmren..." + /* 12 */ "mmmmmmmmmmren..." + /* 13 */ "mmmmmmmmmmren..." + /* 14 */ "mmmmmmmmmmren..." + /* 15 */ "mmmmmmmmmmren...", // Connectors: - "", + "-1: 9, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1506,7 +1507,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ "..........", // Connectors: - "", + "-1: 9, 0, 3: 5\n" /* Type -1, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1548,7 +1549,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "d: 67: 2\n" /* stairs */ "e: 67: 1\n" /* stairs */ "f: 4: 0\n" /* cobblestone */ - "g: 64: 1\n" /* wooddoorblock */ + "g: 64: 7\n" /* wooddoorblock */ "h: 53: 3\n" /* woodstairs */ "i: 53: 1\n" /* woodstairs */ "j: 85: 0\n" /* fence */ @@ -1556,7 +1557,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "l: 53: 2\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ "n:102: 0\n" /* glasspane */ - "o: 64: 8\n" /* wooddoorblock */ + "o: 64:12\n" /* wooddoorblock */ "p: 50: 3\n" /* torch */ "q: 72: 0\n" /* woodplate */ "r: 50: 4\n" /* torch */ @@ -1646,7 +1647,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ "............", // Connectors: - "", + "-1: 8, 1, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1689,19 +1690,18 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "e: 67: 3\n" /* stairs */ "f: 17: 0\n" /* tree */ "g: 5: 0\n" /* wood */ - "h: 64: 5\n" /* wooddoorblock */ - "i: 64: 7\n" /* wooddoorblock */ - "j:102: 0\n" /* glasspane */ - "k: 64:12\n" /* wooddoorblock */ - "l: 53: 2\n" /* woodstairs */ + "h: 64: 7\n" /* wooddoorblock */ + "i:102: 0\n" /* glasspane */ + "j: 64:12\n" /* wooddoorblock */ + "k: 53: 2\n" /* woodstairs */ + "l: 53: 7\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 53: 7\n" /* woodstairs */ - "o: 17: 4\n" /* tree */ - "p: 17: 8\n" /* tree */ - "q: 50: 3\n" /* torch */ - "r: 50: 4\n" /* torch */ - "s: 53: 6\n" /* woodstairs */ - "t: 53: 3\n" /* woodstairs */, + "n: 17: 4\n" /* tree */ + "o: 17: 8\n" /* tree */ + "p: 50: 3\n" /* torch */ + "q: 50: 4\n" /* torch */ + "r: 53: 6\n" /* woodstairs */ + "s: 53: 3\n" /* woodstairs */, // Block data: // Level 0 @@ -1727,46 +1727,46 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 4 */ ".f.......f." /* 5 */ ".g.......g." /* 6 */ ".g.......g." - /* 7 */ ".fggfifggf." + /* 7 */ ".fggfhfggf." /* 8 */ "..........." // Level 2 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ ".fjjfkfjjf." - /* 2 */ ".j.......j." - /* 3 */ ".j.......j." + /* 1 */ ".fiifjfiif." + /* 2 */ ".i.......i." + /* 3 */ ".i.......i." /* 4 */ ".f.......f." - /* 5 */ ".j.......j." - /* 6 */ ".j.......j." - /* 7 */ ".fjjfkfjjf." + /* 5 */ ".i.......i." + /* 6 */ ".i.......i." + /* 7 */ ".fiifjfiif." /* 8 */ "..........." // Level 3 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "lllllllllll" - /* 1 */ "nfooooooofn" - /* 2 */ ".p..q.q..p." - /* 3 */ ".p.......p." - /* 4 */ ".p.......p." - /* 5 */ ".p.......p." - /* 6 */ ".p..r.r..p." - /* 7 */ "sfooooooofs" - /* 8 */ "ttttttttttt" + /* 0 */ "kkkkkkkkkkk" + /* 1 */ "lfnnnnnnnfl" + /* 2 */ ".o..p.p..o." + /* 3 */ ".o.......o." + /* 4 */ ".o.......o." + /* 5 */ ".o.......o." + /* 6 */ ".o..q.q..o." + /* 7 */ "rfnnnnnnnfr" + /* 8 */ "sssssssssss" // Level 4 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ "lllllllllll" - /* 2 */ "ngggggggggn" + /* 1 */ "kkkkkkkkkkk" + /* 2 */ "lgggggggggl" /* 3 */ ".g.......g." /* 4 */ ".g.......g." /* 5 */ ".g.......g." - /* 6 */ "sgggggggggs" - /* 7 */ "ttttttttttt" + /* 6 */ "rgggggggggr" + /* 7 */ "sssssssssss" /* 8 */ "..........." // Level 5 @@ -1774,11 +1774,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* * 01234567890 */ /* 0 */ "..........." /* 1 */ "..........." - /* 2 */ "lllllllllll" - /* 3 */ "ngggggggggn" + /* 2 */ "kkkkkkkkkkk" + /* 3 */ "lgggggggggl" /* 4 */ ".g.......g." - /* 5 */ "sgggggggggs" - /* 6 */ "ttttttttttt" + /* 5 */ "rgggggggggr" + /* 6 */ "sssssssssss" /* 7 */ "..........." /* 8 */ "..........." @@ -1788,15 +1788,15 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 0 */ "..........." /* 1 */ "..........." /* 2 */ "..........." - /* 3 */ "lllllllllll" + /* 3 */ "kkkkkkkkkkk" /* 4 */ "ggggggggggg" - /* 5 */ "ttttttttttt" + /* 5 */ "sssssssssss" /* 6 */ "..........." /* 7 */ "..........." /* 8 */ "...........", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2025,7 +2025,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 15 */ "mmmmmmmmmmmmmmm", // Connectors: - "", + "-1: 7, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2069,7 +2069,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "f: 4: 0\n" /* cobblestone */ "g: 17: 0\n" /* tree */ "h: 5: 0\n" /* wood */ - "i: 64: 5\n" /* wooddoorblock */ + "i: 64: 7\n" /* wooddoorblock */ "j:102: 0\n" /* glasspane */ "k: 64:12\n" /* wooddoorblock */ "l: 53: 2\n" /* woodstairs */ @@ -2151,7 +2151,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ ".........", // Connectors: - "", + "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2193,7 +2193,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "d: 4: 0\n" /* cobblestone */ "e: 17: 0\n" /* tree */ "f: 5: 0\n" /* wood */ - "g: 64: 5\n" /* wooddoorblock */ + "g: 64: 7\n" /* wooddoorblock */ "h:102: 0\n" /* glasspane */ "i: 64:12\n" /* wooddoorblock */ "j: 53: 2\n" /* woodstairs */ @@ -2271,7 +2271,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ "...........", // Connectors: - "", + "-1: 5, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2313,7 +2313,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "d: 4: 0\n" /* cobblestone */ "e: 17: 0\n" /* tree */ "f: 5: 0\n" /* wood */ - "g: 64: 5\n" /* wooddoorblock */ + "g: 64: 7\n" /* wooddoorblock */ "h:102: 0\n" /* glasspane */ "i: 64:12\n" /* wooddoorblock */ "j: 53: 2\n" /* woodstairs */ @@ -2422,7 +2422,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 10 */ "mmmm..tfl..", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2464,7 +2464,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "d: 4: 0\n" /* cobblestone */ "e: 17: 0\n" /* tree */ "f: 5: 0\n" /* wood */ - "g: 64: 5\n" /* wooddoorblock */ + "g: 64: 7\n" /* wooddoorblock */ "h:102: 0\n" /* glasspane */ "i: 64:12\n" /* wooddoorblock */ "j: 53: 2\n" /* woodstairs */ @@ -2571,7 +2571,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 10 */ "..kfl.....kfl..", // Connectors: - "", + "-1: 7, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2613,7 +2613,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "d: 4: 0\n" /* cobblestone */ "e: 17: 0\n" /* tree */ "f: 5: 0\n" /* wood */ - "g: 64: 5\n" /* wooddoorblock */ + "g: 64: 7\n" /* wooddoorblock */ "h: 53: 3\n" /* woodstairs */ "i: 85: 0\n" /* fence */ "j: 53: 2\n" /* woodstairs */ @@ -2698,7 +2698,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ "...........", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2740,15 +2740,15 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "d: 4: 0\n" /* cobblestone */ "e: 17: 0\n" /* tree */ "f: 5: 0\n" /* wood */ - "g: 64: 5\n" /* wooddoorblock */ - "h: 53: 3\n" /* woodstairs */ - "i: 85: 0\n" /* fence */ - "j: 53: 2\n" /* woodstairs */ - "k: 53: 1\n" /* woodstairs */ - "l: 53: 0\n" /* woodstairs */ + "g: 64: 7\n" /* wooddoorblock */ + "h: 64: 5\n" /* wooddoorblock */ + "i: 53: 3\n" /* woodstairs */ + "j: 85: 0\n" /* fence */ + "k: 53: 2\n" /* woodstairs */ + "l: 53: 1\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n:102: 0\n" /* glasspane */ - "o: 64:13\n" /* wooddoorblock */ + "n: 53: 0\n" /* woodstairs */ + "o:102: 0\n" /* glasspane */ "p: 64:12\n" /* wooddoorblock */ "q: 50: 3\n" /* torch */ "r: 72: 0\n" /* woodplate */ @@ -2776,12 +2776,12 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ ".efffggfffe." + /* 1 */ ".efffghfffe." /* 2 */ ".f........f." - /* 3 */ ".fh......hf." - /* 4 */ ".fi......if." - /* 5 */ ".fj......jf." - /* 6 */ ".f.kilkil.f." + /* 3 */ ".fi......if." + /* 4 */ ".fj......jf." + /* 5 */ ".fk......kf." + /* 6 */ ".f.ljnljn.f." /* 7 */ ".effffffffe." /* 8 */ "............" @@ -2789,19 +2789,19 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ ".ennfopfnne." - /* 2 */ ".n..q..q..n." - /* 3 */ ".n........n." + /* 1 */ ".eoofppfooe." + /* 2 */ ".o..q..q..o." + /* 3 */ ".o........o." /* 4 */ ".fr......rf." - /* 5 */ ".n........n." - /* 6 */ ".n..r..r..n." - /* 7 */ ".ennfnnfnne." + /* 5 */ ".o........o." + /* 6 */ ".o..r..r..o." + /* 7 */ ".eoofoofooe." /* 8 */ "............" // Level 3 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "jjjjjjjjjjjj" + /* 0 */ "kkkkkkkkkkkk" /* 1 */ "sffffffffffs" /* 2 */ ".fttttttttf." /* 3 */ ".f........f." @@ -2809,19 +2809,19 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 5 */ ".f........f." /* 6 */ ".fttttttttf." /* 7 */ "wffffffffffw" - /* 8 */ "hhhhhhhhhhhh" + /* 8 */ "iiiiiiiiiiii" // Level 4 /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ "jjjjjjjjjjjj" + /* 1 */ "kkkkkkkkkkkk" /* 2 */ "sffffffffffs" /* 3 */ ".fttttttttf." /* 4 */ ".f........f." /* 5 */ ".fttttttttf." /* 6 */ "wffffffffffw" - /* 7 */ "hhhhhhhhhhhh" + /* 7 */ "iiiiiiiiiiii" /* 8 */ "............" // Level 5 @@ -2829,11 +2829,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* * 012345678901 */ /* 0 */ "............" /* 1 */ "............" - /* 2 */ "jjjjjjjjjjjj" + /* 2 */ "kkkkkkkkkkkk" /* 3 */ "sffffffffffs" /* 4 */ ".f........f." /* 5 */ "wffffffffffw" - /* 6 */ "hhhhhhhhhhhh" + /* 6 */ "iiiiiiiiiiii" /* 7 */ "............" /* 8 */ "............" @@ -2843,15 +2843,15 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 0 */ "............" /* 1 */ "............" /* 2 */ "............" - /* 3 */ "jjjjjjjjjjjj" + /* 3 */ "kkkkkkkkkkkk" /* 4 */ "ffffffffffff" - /* 5 */ "hhhhhhhhhhhh" + /* 5 */ "iiiiiiiiiiii" /* 6 */ "............" /* 7 */ "............" /* 8 */ "............", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2895,19 +2895,18 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "f: 2: 0\n" /* grass */ "g: 17: 0\n" /* tree */ "h: 5: 0\n" /* wood */ - "i: 64: 5\n" /* wooddoorblock */ + "i: 64: 7\n" /* wooddoorblock */ "j: 53: 3\n" /* woodstairs */ "k: 85: 0\n" /* fence */ "l: 53: 2\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 64: 7\n" /* wooddoorblock */ - "o:102: 0\n" /* glasspane */ - "p: 64:12\n" /* wooddoorblock */ - "q: 72: 0\n" /* woodplate */ - "r: 53: 7\n" /* woodstairs */ - "s: 50: 1\n" /* torch */ - "t: 50: 2\n" /* torch */ - "u: 53: 6\n" /* woodstairs */, + "n:102: 0\n" /* glasspane */ + "o: 64:12\n" /* wooddoorblock */ + "p: 72: 0\n" /* woodplate */ + "q: 53: 7\n" /* woodstairs */ + "r: 50: 1\n" /* torch */ + "s: 50: 2\n" /* torch */ + "t: 53: 6\n" /* woodstairs */, // Block data: // Level 0 @@ -2937,7 +2936,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 4 */ ".h.e....lh." /* 5 */ ".h.......h." /* 6 */ ".h.......h." - /* 7 */ ".ghhhnhhhg." + /* 7 */ ".ghhhihhhg." /* 8 */ "..k.....k.." /* 9 */ "mmk.....kmm" /* 10 */ "mmk.....kmm" @@ -2948,13 +2947,13 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ ".goohphoog." - /* 2 */ ".o.......o." - /* 3 */ ".o......qo." + /* 1 */ ".gnnhohnng." + /* 2 */ ".n.......n." + /* 3 */ ".n......pn." /* 4 */ ".h.......h." - /* 5 */ ".o.......o." - /* 6 */ ".o.......o." - /* 7 */ ".goohphoog." + /* 5 */ ".n.......n." + /* 6 */ ".n.......n." + /* 7 */ ".gnnhohnng." /* 8 */ "..........." /* 9 */ "mm.......mm" /* 10 */ "mm.......mm" @@ -2965,13 +2964,13 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "lllllllllll" - /* 1 */ "rhhhhhhhhhr" + /* 1 */ "qhhhhhhhhhq" /* 2 */ ".h.......h." /* 3 */ ".h.......h." - /* 4 */ ".hs.....th." + /* 4 */ ".hr.....sh." /* 5 */ ".h.......h." /* 6 */ ".h.......h." - /* 7 */ "uhhhhhhhhhu" + /* 7 */ "thhhhhhhhht" /* 8 */ "jjjjjjjjjjj" /* 9 */ "mm.......mm" /* 10 */ "mm.......mm" @@ -2983,11 +2982,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* * 01234567890 */ /* 0 */ "..........." /* 1 */ "lllllllllll" - /* 2 */ "rhhhhhhhhhr" + /* 2 */ "qhhhhhhhhhq" /* 3 */ ".h.......h." /* 4 */ ".h.......h." /* 5 */ ".h.......h." - /* 6 */ "uhhhhhhhhhu" + /* 6 */ "thhhhhhhhht" /* 7 */ "jjjjjjjjjjj" /* 8 */ "..........." /* 9 */ "mm.......mm" @@ -3001,9 +3000,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 0 */ "..........." /* 1 */ "..........." /* 2 */ "lllllllllll" - /* 3 */ "rhhhhhhhhhr" + /* 3 */ "qhhhhhhhhhq" /* 4 */ ".h.......h." - /* 5 */ "uhhhhhhhhhu" + /* 5 */ "thhhhhhhhht" /* 6 */ "jjjjjjjjjjj" /* 7 */ "..........." /* 8 */ "..........." @@ -3030,7 +3029,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 12 */ "mm.......mm", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3279,7 +3278,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "f: 5: 0\n" /* wood */ "g: 54: 4\n" /* chest */ "h:154: 4\n" /* hopper */ - "i: 64: 6\n" /* wooddoorblock */ + "i: 64: 4\n" /* wooddoorblock */ "j:102: 0\n" /* glasspane */ "k: 85: 0\n" /* fence */ "l: 64:12\n" /* wooddoorblock */ @@ -3551,7 +3550,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 12 */ ".........", // Connectors: - "", + "-1: 5, 0, 6: 5\n" /* Type -1, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3692,7 +3691,10 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = /* 3 */ "bbbb", // Connectors: - "", + "1: 1, 9, 3: 3\n" /* Type 1, direction Z+ */ + "1: 2, 9, 0: 2\n" /* Type 1, direction Z- */ + "1: 0, 9, 1: 4\n" /* Type 1, direction X- */ + "1: 3, 9, 2: 5\n" /* Type 1, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ diff --git a/src/Generating/Prefabs/SandVillagePrefabs.cpp b/src/Generating/Prefabs/SandVillagePrefabs.cpp index 23af0f0a6..51411dea2 100644 --- a/src/Generating/Prefabs/SandVillagePrefabs.cpp +++ b/src/Generating/Prefabs/SandVillagePrefabs.cpp @@ -63,7 +63,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ "d.....d.....d", // Connectors: - "", + "-1: 6, 0, 8: 3\n" /* Type -1, direction Z+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -103,7 +103,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 5\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ @@ -183,7 +183,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ "...........", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -223,7 +223,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 5\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ @@ -326,7 +326,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ "...........", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -366,7 +366,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 5\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ @@ -444,7 +444,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ ".............", // Connectors: - "", + "-1: 6, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -484,7 +484,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 5\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ @@ -587,7 +587,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ ".............", // Connectors: - "", + "-1: 6, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -627,7 +627,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 5\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ @@ -730,7 +730,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ "...............", // Connectors: - "", + "-1: 6, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -770,7 +770,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 5\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ @@ -873,7 +873,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ "................", // Connectors: - "", + "-1: 9, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -913,7 +913,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 5\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ @@ -984,7 +984,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ ".......", // Connectors: - "", + "-1: 4, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1024,7 +1024,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 5\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ @@ -1096,7 +1096,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ ".........", // Connectors: - "", + "-1: 4, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1136,9 +1136,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "b:128: 2\n" /* sandstonestairs */ "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ - "e: 64: 1\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f:102: 0\n" /* glasspane */ - "g: 64: 8\n" /* wooddoorblock */ + "g: 64:12\n" /* wooddoorblock */ "h:128: 7\n" /* sandstonestairs */ "i: 50: 3\n" /* torch */ "j: 50: 4\n" /* torch */ @@ -1232,7 +1232,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ ".........", // Connectors: - "", + "-1: 4, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1273,17 +1273,18 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ "e:128: 3\n" /* sandstonestairs */ - "f: 64: 5\n" /* wooddoorblock */ - "g:102: 0\n" /* glasspane */ - "h: 64:12\n" /* wooddoorblock */ - "i:128: 7\n" /* sandstonestairs */ - "j: 50: 3\n" /* torch */ - "k: 50: 4\n" /* torch */ - "l:128: 6\n" /* sandstonestairs */ + "f: 64: 7\n" /* wooddoorblock */ + "g: 64: 5\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j:128: 7\n" /* sandstonestairs */ + "k: 50: 3\n" /* torch */ + "l: 50: 4\n" /* torch */ "m: 19: 0\n" /* sponge */ - "n:128: 5\n" /* sandstonestairs */ - "o:128: 4\n" /* sandstonestairs */ - "p: 50: 1\n" /* torch */, + "n:128: 6\n" /* sandstonestairs */ + "o:128: 5\n" /* sandstonestairs */ + "p:128: 4\n" /* sandstonestairs */ + "q: 50: 1\n" /* torch */, // Block data: // Level 0 @@ -1310,7 +1311,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 2 */ ".d..........d." /* 3 */ ".d..........d." /* 4 */ ".d..........d." - /* 5 */ ".ddddfddd...d." + /* 5 */ ".ddddgddd...d." /* 6 */ "........d...d." /* 7 */ "mmmmmmm.d...d." /* 8 */ "mmmmmmm.d...d." @@ -1322,49 +1323,49 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* z\x* 1111 */ /* * 01234567890123 */ /* 0 */ ".............." - /* 1 */ ".dggdggdhdggd." - /* 2 */ ".g..........g." - /* 3 */ ".g..........g." - /* 4 */ ".g..........d." - /* 5 */ ".dggdhdgg...g." - /* 6 */ "........g...g." + /* 1 */ ".dhhdhhdidhhd." + /* 2 */ ".h..........h." + /* 3 */ ".h..........h." + /* 4 */ ".h..........d." + /* 5 */ ".dhhdidhh...h." + /* 6 */ "........h...h." /* 7 */ "mmmmmmm.d...d." - /* 8 */ "mmmmmmm.g...g." - /* 9 */ "mmmmmmm.g...g." - /* 10 */ "mmmmmmm.dgggd." + /* 8 */ "mmmmmmm.h...h." + /* 9 */ "mmmmmmm.h...h." + /* 10 */ "mmmmmmm.dhhhd." /* 11 */ "mmmmmmm......." // Level 3 /* z\x* 1111 */ /* * 01234567890123 */ /* 0 */ "bbbbbbbbbbbbbb" - /* 1 */ "iddddddddddddc" - /* 2 */ ".d.....j.j..dc" + /* 1 */ "jddddddddddddc" + /* 2 */ ".d.....k.k..dc" /* 3 */ ".d..........dc" - /* 4 */ ".d..k.k.....dc" - /* 5 */ "ldddddddd...dc" + /* 4 */ ".d..l.l.....dc" + /* 5 */ "ndddddddd...dc" /* 6 */ "eeeeeeead...dc" /* 7 */ "mmmmmmmad...dc" /* 8 */ "mmmmmmmad...dc" /* 9 */ "mmmmmmmad...dc" /* 10 */ "mmmmmmmadddddc" - /* 11 */ "mmmmmmman...oc" + /* 11 */ "mmmmmmmao...pc" // Level 4 /* z\x* 1111 */ /* * 01234567890123 */ /* 0 */ ".............." /* 1 */ "bbbbbbbbbbbbb." - /* 2 */ "idddddddddddc." - /* 3 */ ".dp........dc." - /* 4 */ "lddddddddd.dc." + /* 2 */ "jdddddddddddc." + /* 3 */ ".dq........dc." + /* 4 */ "nddddddddd.dc." /* 5 */ "eeeeeeeead.dc." /* 6 */ "........ad.dc." /* 7 */ "mmmmmmm.ad.dc." /* 8 */ "mmmmmmm.ad.dc." - /* 9 */ "mmmmmmm.adkdc." + /* 9 */ "mmmmmmm.adldc." /* 10 */ "mmmmmmm.adddc." - /* 11 */ "mmmmmmm.an.oc." + /* 11 */ "mmmmmmm.ao.pc." // Level 5 /* z\x* 1111 */ @@ -1383,7 +1384,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 11 */ "mmmmmmm..adc..", // Connectors: - "", + "-1: 8, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1424,19 +1425,18 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "c:128: 1\n" /* sandstonestairs */ "d: 24: 0\n" /* sandstone */ "e:128: 3\n" /* sandstonestairs */ - "f: 64: 5\n" /* wooddoorblock */ - "g: 64: 7\n" /* wooddoorblock */ - "h:102: 0\n" /* glasspane */ - "i: 64:12\n" /* wooddoorblock */ - "j:128: 7\n" /* sandstonestairs */ - "k: 50: 3\n" /* torch */ - "l: 50: 2\n" /* torch */ + "f: 64: 7\n" /* wooddoorblock */ + "g:102: 0\n" /* glasspane */ + "h: 64:12\n" /* wooddoorblock */ + "i:128: 7\n" /* sandstonestairs */ + "j: 50: 3\n" /* torch */ + "k: 50: 2\n" /* torch */ + "l: 50: 4\n" /* torch */ "m: 19: 0\n" /* sponge */ - "n: 50: 4\n" /* torch */ - "o:128: 6\n" /* sandstonestairs */ - "p: 50: 1\n" /* torch */ - "q:128: 5\n" /* sandstonestairs */ - "r:128: 4\n" /* sandstonestairs */, + "n:128: 6\n" /* sandstonestairs */ + "o: 50: 1\n" /* torch */ + "p:128: 5\n" /* sandstonestairs */ + "q:128: 4\n" /* sandstonestairs */, // Block data: // Level 0 @@ -1465,7 +1465,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 4 */ ".d..........d." /* 5 */ ".d..........d." /* 6 */ ".d..........d." - /* 7 */ ".ddddgd.....d." + /* 7 */ ".ddddfd.....d." /* 8 */ "......d.....d." /* 9 */ "mmmmm.d.....d." /* 10 */ "mmmmm.ddddddd." @@ -1475,49 +1475,49 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* z\x* 1111 */ /* * 01234567890123 */ /* 0 */ ".............." - /* 1 */ ".dhhdidhhdhhd." - /* 2 */ ".h..........h." - /* 3 */ ".h..........h." + /* 1 */ ".dggdhdggdggd." + /* 2 */ ".g..........g." + /* 3 */ ".g..........g." /* 4 */ ".d..........d." - /* 5 */ ".h..........h." - /* 6 */ ".h..........h." - /* 7 */ ".dhhdid.....d." - /* 8 */ "......h.....h." - /* 9 */ "mmmmm.h.....h." - /* 10 */ "mmmmm.dhhdhhd." + /* 5 */ ".g..........g." + /* 6 */ ".g..........g." + /* 7 */ ".dggdhd.....d." + /* 8 */ "......g.....g." + /* 9 */ "mmmmm.g.....g." + /* 10 */ "mmmmm.dggdggd." /* 11 */ "mmmmm........." // Level 3 /* z\x* 1111 */ /* * 01234567890123 */ /* 0 */ "bbbbbbbbbbbbbb" - /* 1 */ "jddddddddddddc" - /* 2 */ ".d..k.k.....dc" + /* 1 */ "iddddddddddddc" + /* 2 */ ".d..j.j.....dc" /* 3 */ ".d..........dc" - /* 4 */ ".d.........ldc" + /* 4 */ ".d.........kdc" /* 5 */ ".d..........dc" - /* 6 */ ".d..n.n.....dc" - /* 7 */ "oddddddp...ldc" + /* 6 */ ".d..l.l.....dc" + /* 7 */ "nddddddo...kdc" /* 8 */ "eeeeead.....dc" /* 9 */ "mmmmmad.....dc" /* 10 */ "mmmmmadddddddc" - /* 11 */ "mmmmmaq.....rc" + /* 11 */ "mmmmmap.....qc" // Level 4 /* z\x* 1111 */ /* * 01234567890123 */ /* 0 */ ".............." /* 1 */ "bbbbbbbbbbbbc." - /* 2 */ "jdddddddddddc." + /* 2 */ "idddddddddddc." /* 3 */ ".d.........dc." /* 4 */ ".d.........dc." /* 5 */ ".d.........dc." - /* 6 */ "oddddddd...dc." + /* 6 */ "nddddddd...dc." /* 7 */ "eeeeeead...dc." /* 8 */ "......ad...dc." /* 9 */ "mmmmm.ad...dc." /* 10 */ "mmmmm.adddddc." - /* 11 */ "mmmmm.aq...rc." + /* 11 */ "mmmmm.ap...qc." // Level 5 /* z\x* 1111 */ @@ -1525,15 +1525,15 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 0 */ ".............." /* 1 */ ".............." /* 2 */ "bbbbbbbbbbbb.." - /* 3 */ "jddddddddddc.." + /* 3 */ "iddddddddddc.." /* 4 */ ".d........dc.." - /* 5 */ "odddddddd.dc.." + /* 5 */ "ndddddddd.dc.." /* 6 */ "eeeeeeeed.dc.." /* 7 */ ".......ad.dc.." /* 8 */ ".......ad.dc.." /* 9 */ "mmmmm..ad.dc.." /* 10 */ "mmmmm..adddc.." - /* 11 */ "mmmmm..aq.rc.." + /* 11 */ "mmmmm..ap.qc.." // Level 6 /* z\x* 1111 */ @@ -1552,7 +1552,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 11 */ "mmmmm...adc...", // Connectors: - "", + "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1619,7 +1619,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ "d........d", // Connectors: - "", + "-1: 0, 0, 3: 4\n" /* Type -1, direction X- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1661,8 +1661,8 @@ const cPrefab::sDef g_SandVillagePrefabs[] = "d: 50: 5\n" /* torch */ "e: 26:10\n" /* bedblock */ "f: 26: 2\n" /* bedblock */ - "g: 64: 3\n" /* wooddoorblock */ - "h: 64: 8\n" /* wooddoorblock */ + "g: 64: 5\n" /* wooddoorblock */ + "h: 64:12\n" /* wooddoorblock */ "m: 19: 0\n" /* sponge */, // Block data: @@ -1712,7 +1712,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 5 */ ".....", // Connectors: - "", + "-1: 2, 0, 4: 3\n" /* Type -1, direction Z+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1853,7 +1853,10 @@ const cPrefab::sDef g_SandVillageStartingPrefabs[] = /* 3 */ "bbbb", // Connectors: - "", + "1: 2, 8, 0: 2\n" /* Type 1, direction Z- */ + "1: 0, 8, 1: 4\n" /* Type 1, direction X- */ + "1: 1, 8, 3: 3\n" /* Type 1, direction Z+ */ + "1: 3, 8, 2: 5\n" /* Type 1, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index 3d89d7aa2..3358bc531 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -7,6 +7,7 @@ #include "VillageGen.h" #include "Prefabs/PlainsVillagePrefabs.h" #include "Prefabs/SandVillagePrefabs.h" +#include "PieceGenerator.h" @@ -19,18 +20,79 @@ the grid's cells. Each cell checks the biomes in an entire chunk around it, only biomes are village-friendly. If yes, the entire village structure is built for that cell. If not, the cell is left village-less. -A village is generated starting by its well. The well is placed in the grid's origin point. Then a set of -random lengths roads is generated - 4 roads going from the well, then at the end of each road another set of -roads, crossing them perpendicular, then at the end of those another set, up to a set maximum branching -depth. The roads are placed in a T or L shape, with the old road being the center stem of the T. Roads avoid -crossing each other and going further away from the well than the maximum block size of the village. -Finally, houses are places along the roads, avoiding collisions with already-existing items. +A village is generated using the regular BFS piece generator. The well piece is used as the starting piece, +the roads and houses are then used as the following pieces. Only the houses are read from the prefabs, +though, the roads are generated by code and their content is ignored. A special subclass of the cPiecePool +class is used, so that the roads connect to each other and to the well only in predefined manners. -When the village is about to be drawn into a chunk, it queries the heights for each item intersecting the -chunk. The prefabs are shifted so that their pivot points lie on the surface, and the roads are drawn +The well has connectors of type "1". The houses have connectors of type "-1". The roads have connectors of +both types, type "-1" at the far ends and type "1" on the long edges. + +When the village is about to be drawn into a chunk, it queries the heights for each piece intersecting the +chunk. The pieces are shifted so that their pivot points lie on the surface, and the roads are drawn directly by turning the surface blocks into gravel / sandstone. */ +class cVillagePiecePool : + public cPrefabPiecePool +{ + typedef cPrefabPiecePool super; +public: + cVillagePiecePool( + const cPrefab::sDef * a_PieceDefs, size_t a_NumPieceDefs, + const cPrefab::sDef * a_StartingPieceDefs, size_t a_NumStartingPieceDefs + ) : + super(a_PieceDefs, a_NumPieceDefs, a_StartingPieceDefs, a_NumStartingPieceDefs) + { + // Add the road piece: + cBlockArea BA; + BA.Create(5, 1, 3, cBlockArea::baTypes | cBlockArea::baMetas); + BA.Fill(cBlockArea::baTypes | cBlockArea::baMetas, E_BLOCK_GRAVEL, 0); + cPrefab * RoadPiece = new cPrefab(BA, 7); + RoadPiece->AddConnector(0, 0, 1, BLOCK_FACE_XM, -1); + RoadPiece->AddConnector(4, 0, 1, BLOCK_FACE_XP, -1); + RoadPiece->AddConnector(4, 0, 1, BLOCK_FACE_XP, 1); + RoadPiece->AddConnector(1, 0, 0, BLOCK_FACE_ZM, 1); + RoadPiece->AddConnector(3, 0, 0, BLOCK_FACE_ZM, 1); + RoadPiece->AddConnector(1, 0, 2, BLOCK_FACE_ZP, 1); + RoadPiece->AddConnector(3, 0, 2, BLOCK_FACE_ZP, 1); + RoadPiece->SetAddWeightIfSame(10000); + m_AllPieces.push_back(RoadPiece); + m_PiecesByConnector[-1].push_back(RoadPiece); + m_PiecesByConnector[1].push_back(RoadPiece); + } + + + // cPrefabPiecePool overrides: + virtual int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, const cPiece & a_NewPiece) override + { + // Only roads are allowed to connect to the well: + if ((a_PlacedPiece.GetDepth() == 0) && (a_NewPiece.GetSize().y != 1)) + { + return 0; + } + + // Roads cannot branch T-wise: + if ( + (a_PlacedPiece.GetPiece().GetSize().y == 1) && // Connecting to a road + ( + (a_ExistingConnector.m_Direction == BLOCK_FACE_ZP) || + (a_ExistingConnector.m_Direction == BLOCK_FACE_ZM) + ) && // Through the long-edge connector + (a_NewPiece.GetSize().y == 1) // And the new piece is a road + ) + { + return 0; + } + + return ((const cPrefab &)a_NewPiece).GetPieceWeight(a_PlacedPiece, a_ExistingConnector); + } +} ; + + + + + class cVillageGen::cVillage : public cGridStructGen::cStructure { @@ -53,44 +115,11 @@ public: m_Prefabs(a_Prefabs), m_HeightGen(a_HeightGen) { - PlaceWell(); - BuildRoads(a_MaxRoadDepth); - PlaceHouses(); + cBFSPieceGenerator pg(m_Prefabs, a_Seed); + pg.PlacePieces(a_OriginX, 10, a_OriginZ, a_MaxRoadDepth + 1, m_Pieces); } protected: - class cItem - { - public: - /* The position of the item, X/Z-wise: */ - int m_MinX, m_MaxX, m_MinZ, m_MaxZ; - - /** The prefab to use. If NULL, this is a road. */ - cPrefab * m_Prefab; - - /** Number of rotations that should be applied to the prefab. */ - int m_NumRotations; - - /* The bottom of the prefab. Only valid if the item is a prefab, not valid for roads. */ - int m_BaseY; - - /** Creates a new item with the specified parameters. - m_BaseY is set to -1 and will be adjusted later on when drawing. */ - cItem(int a_MinX, int a_MaxX, int a_MinZ, int a_MaxZ, cPrefab * a_Prefab, int a_NumRotations) : - m_MinX(a_MinX), - m_MaxX(a_MaxX), - m_MinZ(a_MinZ), - m_MaxZ(a_MaxZ), - m_Prefab(a_Prefab), - m_NumRotations(a_NumRotations), - m_BaseY(-1) - { - } - } ; - typedef SharedPtr cItemPtr; - typedef std::vector cItemPtrs; - - /** Seed for the random functions */ int m_Seed; @@ -109,61 +138,8 @@ protected: /** The underlying height generator, used for placing the structures on top of the terrain. */ cTerrainHeightGen & m_HeightGen; - /** The items that are generated in the village (houses, roads). */ - cItemPtrs m_Items; - - - /** Places the well at the center of the village */ - void PlaceWell(void) - { - // Pick a prefab from the starting pieces: - cPieces StartingPieces = ((cPiecePool &)m_Prefabs).GetStartingPieces(); - ASSERT(!StartingPieces.empty()); - int TotalWeight = 0; - for (cPieces::const_iterator itr = StartingPieces.begin(), end = StartingPieces.end(); itr != end; ++itr) - { - TotalWeight += ((const cPrefab *)(*itr))->GetDefaultWeight(); - } - ASSERT(TotalWeight > 0); - int rnd = (m_Noise.IntNoise2DInt(m_OriginX, m_OriginZ) / 7) % TotalWeight; - cPiece * WellPiece = StartingPieces[0]; - for (cPieces::const_iterator itr = StartingPieces.begin(), end = StartingPieces.end(); itr != end; ++itr) - { - rnd -= ((const cPrefab *)(*itr))->GetDefaultWeight(); - if (rnd <= 0) - { - WellPiece = *itr; - break; - } - } - ASSERT(WellPiece != NULL); - - // Pick a rotation: - // TODO - int NumRotations = 0; - Vector3i Size = WellPiece->GetSize(); - - // Put the well in the placed items array: - m_Items.push_back(cItemPtr(new cItem(m_OriginX, m_OriginX + Size.x, m_OriginZ, m_OriginZ + Size.z, (cPrefab *)WellPiece, NumRotations))); - } - - - /** Places the roads going from the well outwards. */ - void BuildRoads(int a_MaxRoadDepth) - { - /* - ASSERT(m_Items.size() == 1); - const cItem & Well = *m_Items[0]; - */ - // TODO - } - - - /** Places houses along the roads. */ - void PlaceHouses(void) - { - // TODO - } + /** The village pieces, placed by the generator. */ + cPlacedPieces m_Pieces; // cGrdStructGen::cStructure overrides: @@ -173,6 +149,11 @@ protected: // Iterate over all items // Each intersecting prefab is placed on ground (if not already placed), then drawn // Each intersecting road is drawn by replacing top soil blocks with gravel / sandstone blocks + for (cPlacedPieces::const_iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr) + { + const cPrefab & Prefab = (const cPrefab &)((*itr)->GetPiece()); + Prefab.Draw(a_Chunk, *itr); + } // for itr - m_PlacedPieces[] } } ; @@ -183,15 +164,20 @@ protected: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cVillageGen: -cPrefabPiecePool cVillageGen::m_SandVillage (g_SandVillagePrefabs, g_SandVillagePrefabsCount, g_SandVillageStartingPrefabs, g_SandVillageStartingPrefabsCount); -cPrefabPiecePool cVillageGen::m_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVillagePrefabsCount, g_PlainsVillageStartingPrefabs, g_PlainsVillageStartingPrefabsCount); +/** The prefabs for the sand village. */ +static cVillagePiecePool g_SandVillage (g_SandVillagePrefabs, g_SandVillagePrefabsCount, g_SandVillageStartingPrefabs, g_SandVillageStartingPrefabsCount); + +/** The prefabs for the plains village. */ +static cVillagePiecePool g_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVillagePrefabsCount, g_PlainsVillageStartingPrefabs, g_PlainsVillageStartingPrefabsCount); -cVillageGen::cVillageGen(int a_Seed, int a_GridSize, int a_MaxRoadDepth, int a_MaxSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen) : +cVillageGen::cVillageGen(int a_Seed, int a_GridSize, int a_MaxDepth, int a_MaxSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen) : super(a_Seed, a_GridSize, a_GridSize, a_MaxSize, a_MaxSize, 100), + m_MaxDepth(a_MaxDepth), + m_MaxSize(a_MaxSize), m_BiomeGen(a_BiomeGen), m_HeightGen(a_HeightGen) { @@ -211,7 +197,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ // Check if all the biomes are village-friendly: // If just one is not, no village is created, because it's likely that an unfriendly biome is too close - cPrefabPiecePool * VillagePrefabs = NULL; + cVillagePiecePool * VillagePrefabs = NULL; for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) { switch (Biomes[i]) @@ -220,7 +206,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ case biDesertM: { // These biomes allow sand villages - VillagePrefabs = &m_SandVillage; + VillagePrefabs = &g_SandVillage; break; } case biPlains: @@ -229,7 +215,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ case biSunflowerPlains: { // These biomes allow plains-style villages - VillagePrefabs = &m_PlainsVillage; + VillagePrefabs = &g_PlainsVillage; break; } default: @@ -245,7 +231,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ { return cStructurePtr(); } - return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, m_MaxRoadDepth, m_MaxSize, *VillagePrefabs, m_HeightGen)); + return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, m_MaxDepth, m_MaxSize, *VillagePrefabs, m_HeightGen)); } diff --git a/src/Generating/VillageGen.h b/src/Generating/VillageGen.h index acbd76881..c6f8f024a 100644 --- a/src/Generating/VillageGen.h +++ b/src/Generating/VillageGen.h @@ -21,19 +21,13 @@ class cVillageGen : { typedef cGridStructGen super; public: - cVillageGen(int a_Seed, int a_GridSize, int a_MaxRoadDepth, int a_MaxSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen); + cVillageGen(int a_Seed, int a_GridSize, int a_MaxDepth, int a_MaxSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen); protected: class cVillage; // fwd: VillageGen.cpp - /** The prefabs for the sand village. We're not exactly using the cPiecePool functionality, only the containment. */ - static cPrefabPiecePool m_SandVillage; - - /** The prefabs for the plains village. We're not exactly using the cPiecePool functionality, only the containment. */ - static cPrefabPiecePool m_PlainsVillage; - - /** Maximum number of roads generated one from another (tree depth). */ - int m_MaxRoadDepth; + /** Maximum depth of the generator tree*/ + int m_MaxDepth; /** Maximum size, in X/Z blocks, of the village (radius from the origin) */ int m_MaxSize; From 34e5f0c16422f93d3f8f0f802522fa113fa9aa20 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 15 May 2014 10:43:54 +0200 Subject: [PATCH 081/214] Changed village road generation to use multiple prefabs. --- .../Prefabs/PlainsVillagePrefabs.cpp | 8 +-- src/Generating/Prefabs/SandVillagePrefabs.cpp | 8 +-- src/Generating/VillageGen.cpp | 61 +++++++++---------- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index 508f0d3b6..06b1395c5 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -3691,10 +3691,10 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = /* 3 */ "bbbb", // Connectors: - "1: 1, 9, 3: 3\n" /* Type 1, direction Z+ */ - "1: 2, 9, 0: 2\n" /* Type 1, direction Z- */ - "1: 0, 9, 1: 4\n" /* Type 1, direction X- */ - "1: 3, 9, 2: 5\n" /* Type 1, direction X+ */, + "2: 1, 9, 3: 3\n" /* Type 2, direction Z+ */ + "2: 2, 9, 0: 2\n" /* Type 2, direction Z- */ + "2: 0, 9, 1: 4\n" /* Type 2, direction X- */ + "2: 3, 9, 2: 5\n" /* Type 2, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ diff --git a/src/Generating/Prefabs/SandVillagePrefabs.cpp b/src/Generating/Prefabs/SandVillagePrefabs.cpp index 51411dea2..8460ee5f7 100644 --- a/src/Generating/Prefabs/SandVillagePrefabs.cpp +++ b/src/Generating/Prefabs/SandVillagePrefabs.cpp @@ -1853,10 +1853,10 @@ const cPrefab::sDef g_SandVillageStartingPrefabs[] = /* 3 */ "bbbb", // Connectors: - "1: 2, 8, 0: 2\n" /* Type 1, direction Z- */ - "1: 0, 8, 1: 4\n" /* Type 1, direction X- */ - "1: 1, 8, 3: 3\n" /* Type 1, direction Z+ */ - "1: 3, 8, 2: 5\n" /* Type 1, direction X+ */, + "2: 2, 8, 0: 2\n" /* Type 2, direction Z- */ + "2: 0, 8, 1: 4\n" /* Type 2, direction X- */ + "2: 1, 8, 3: 3\n" /* Type 2, direction Z+ */ + "2: 3, 8, 2: 5\n" /* Type 2, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index 3358bc531..b514a90cd 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -44,43 +44,42 @@ public: ) : super(a_PieceDefs, a_NumPieceDefs, a_StartingPieceDefs, a_NumStartingPieceDefs) { - // Add the road piece: - cBlockArea BA; - BA.Create(5, 1, 3, cBlockArea::baTypes | cBlockArea::baMetas); - BA.Fill(cBlockArea::baTypes | cBlockArea::baMetas, E_BLOCK_GRAVEL, 0); - cPrefab * RoadPiece = new cPrefab(BA, 7); - RoadPiece->AddConnector(0, 0, 1, BLOCK_FACE_XM, -1); - RoadPiece->AddConnector(4, 0, 1, BLOCK_FACE_XP, -1); - RoadPiece->AddConnector(4, 0, 1, BLOCK_FACE_XP, 1); - RoadPiece->AddConnector(1, 0, 0, BLOCK_FACE_ZM, 1); - RoadPiece->AddConnector(3, 0, 0, BLOCK_FACE_ZM, 1); - RoadPiece->AddConnector(1, 0, 2, BLOCK_FACE_ZP, 1); - RoadPiece->AddConnector(3, 0, 2, BLOCK_FACE_ZP, 1); - RoadPiece->SetAddWeightIfSame(10000); - m_AllPieces.push_back(RoadPiece); - m_PiecesByConnector[-1].push_back(RoadPiece); - m_PiecesByConnector[1].push_back(RoadPiece); + // Add the road pieces: + for (int len = 19; len < 60; len += 8) + { + cBlockArea BA; + BA.Create(len, 1, 3, cBlockArea::baTypes | cBlockArea::baMetas); + BA.Fill(cBlockArea::baTypes | cBlockArea::baMetas, E_BLOCK_GRAVEL, 0); + cPrefab * RoadPiece = new cPrefab(BA, 1); + RoadPiece->AddConnector(0, 0, 1, BLOCK_FACE_XM, -2); + RoadPiece->AddConnector(len - 1, 0, 1, BLOCK_FACE_XP, -2); + + // Add the road connectors: + for (int x = 1; x < len; x += 8) + { + RoadPiece->AddConnector(x, 0, 0, BLOCK_FACE_ZM, 2); + RoadPiece->AddConnector(x, 0, 2, BLOCK_FACE_ZP, 2); + } + + // Add the buildings connectors: + for (int x = 5; x < len; x += 8) + { + RoadPiece->AddConnector(x, 0, 0, BLOCK_FACE_ZM, 1); + RoadPiece->AddConnector(x, 0, 2, BLOCK_FACE_ZP, 1); + } + m_AllPieces.push_back(RoadPiece); + m_PiecesByConnector[-2].push_back(RoadPiece); + m_PiecesByConnector[1].push_back(RoadPiece); + m_PiecesByConnector[2].push_back(RoadPiece); + } // for len - roads of varying length } // cPrefabPiecePool overrides: virtual int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, const cPiece & a_NewPiece) override { - // Only roads are allowed to connect to the well: - if ((a_PlacedPiece.GetDepth() == 0) && (a_NewPiece.GetSize().y != 1)) - { - return 0; - } - - // Roads cannot branch T-wise: - if ( - (a_PlacedPiece.GetPiece().GetSize().y == 1) && // Connecting to a road - ( - (a_ExistingConnector.m_Direction == BLOCK_FACE_ZP) || - (a_ExistingConnector.m_Direction == BLOCK_FACE_ZM) - ) && // Through the long-edge connector - (a_NewPiece.GetSize().y == 1) // And the new piece is a road - ) + // Roads cannot branch T-wise (appending -2 connector to a +2 connector): + if ((a_ExistingConnector.m_Type == 2) && (a_PlacedPiece.GetDepth() > 0)) { return 0; } From 56f7ad2cd9f1bfd69502918ebe760748e453959d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 15 May 2014 10:44:08 +0200 Subject: [PATCH 082/214] Changed village generator defaults to more reasonable values. --- src/Generating/ComposableGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp index 1bb836684..f264599c9 100644 --- a/src/Generating/ComposableGenerator.cpp +++ b/src/Generating/ComposableGenerator.cpp @@ -408,8 +408,8 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile) } else if (NoCaseCompare(*itr, "Villages") == 0) { - int GridSize = a_IniFile.GetValueSetI("Generator", "VillageGridSize", 256); - int MaxDepth = a_IniFile.GetValueSetI("Generator", "VillageMaxDepth", 7); + int GridSize = a_IniFile.GetValueSetI("Generator", "VillageGridSize", 384); + int MaxDepth = a_IniFile.GetValueSetI("Generator", "VillageMaxDepth", 3); int MaxSize = a_IniFile.GetValueSetI("Generator", "VillageMaxSize", 128); m_FinishGens.push_back(new cVillageGen(Seed, GridSize, MaxDepth, MaxSize, *m_BiomeGen, *m_HeightGen)); } From 70b0547499c4343e3071a54e3c093712669a3a8f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 15 May 2014 16:03:45 +0200 Subject: [PATCH 083/214] Fixed a NULL ptr failure in GridStructGen. When the descendant generator returned a NULL structure, the generator would crash. Now it uses a special cEmptyStructure class instead. --- src/Generating/GridStructGen.cpp | 35 +++++++++++++++++++++++++++++++- src/Generating/GridStructGen.h | 16 +++++++-------- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/Generating/GridStructGen.cpp b/src/Generating/GridStructGen.cpp index 3bbc89054..23946e2e9 100644 --- a/src/Generating/GridStructGen.cpp +++ b/src/Generating/GridStructGen.cpp @@ -9,6 +9,34 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// cEmptyStructure: + +/** A cStructure descendant representing an empty structure. +Used when the generator descended from cGridStructGen doesn't return any structure, to keep at least the +Origin coords so that the structure isn't queried over and over again. */ +class cEmptyStructure : + public cGridStructGen::cStructure +{ + typedef cGridStructGen::cStructure super; + +public: + cEmptyStructure(int a_OriginX, int a_OriginZ) : + super(a_OriginX, a_OriginZ) + { + } + +protected: + virtual void DrawIntoChunk(cChunkDesc & a_ChunkDesc) override + { + // Do nothing + } +} ; + + + + + cGridStructGen::cGridStructGen( int a_Seed, int a_GridSizeX, int a_GridSizeZ, @@ -81,7 +109,12 @@ void cGridStructGen::GetStructuresForChunk(int a_ChunkX, int a_ChunkZ, cStructur } // for itr - a_Structures[] if (!Found) { - a_Structures.push_back(CreateStructure(OriginX, OriginZ)); + cStructurePtr Structure = CreateStructure(OriginX, OriginZ); + if (Structure.get() == NULL) + { + Structure.reset(new cEmptyStructure(OriginX, OriginZ)); + } + a_Structures.push_back(Structure); } } // for z } // for x diff --git a/src/Generating/GridStructGen.h b/src/Generating/GridStructGen.h index 234cc75c5..630a5e44e 100644 --- a/src/Generating/GridStructGen.h +++ b/src/Generating/GridStructGen.h @@ -39,14 +39,6 @@ class cGridStructGen : public cFinishGen { public: - cGridStructGen( - int a_Seed, - int a_GridSizeX, int a_GridSizeZ, - int a_MaxStructureSizeX, int a_MaxStructureSizeZ, - size_t a_MaxCacheSize - ); - -protected: /** Represents a single structure that occupies the grid point. Knows how to draw itself into a chunk. */ class cStructure { @@ -75,6 +67,14 @@ protected: typedef std::list cStructurePtrs; + cGridStructGen( + int a_Seed, + int a_GridSizeX, int a_GridSizeZ, + int a_MaxStructureSizeX, int a_MaxStructureSizeZ, + size_t a_MaxCacheSize + ); + +protected: /** Seed for generating the semi-random grid. */ int m_Seed; From 6c5ff597bbbb3abd2985eda6bf35ea2d98cf69a4 Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 15 May 2014 19:58:48 +0200 Subject: [PATCH 084/214] Move radius check. --- src/ClientHandle.cpp | 65 +++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 9238418a4..cf9d0bfeb 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -815,6 +815,16 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB return; } + if ( + (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || + (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || + (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) + ) + { + m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); + return; + } + cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager(); if (PlgMgr->CallHookPlayerLeftClick(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_Status)) { @@ -927,6 +937,16 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc return; } + if ( + (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || + (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || + (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) + ) + { + m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, this); + return; + } + // Set the last digging coords to the block being dug, so that they can be checked in DIG_FINISHED to avoid dig/aim bug in the client: m_HasStartedDigging = true; m_LastDigBlockX = a_BlockX; @@ -1000,6 +1020,7 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo FinishDigAnimation(); + cWorld * World = m_Player->GetWorld(); cItemHandler * ItemHandler = cItemHandler::GetItemHandler(m_Player->GetEquippedItem()); if (cRoot::Get()->GetPluginManager()->CallHookPlayerBreakingBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_OldBlock, a_OldMeta)) @@ -1008,24 +1029,12 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); return; } - + if (a_OldBlock == E_BLOCK_AIR) { LOGD("Dug air - what the function?"); return; } - - cWorld * World = m_Player->GetWorld(); - - if ( - (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || - (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || - (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) - ) - { - m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); - return; - } ItemHandler->OnBlockDestroyed(World, m_Player, m_Player->GetEquippedItem(), a_BlockX, a_BlockY, a_BlockZ); // The ItemHandler is also responsible for spawning the pickups @@ -1078,7 +1087,23 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e ); cWorld * World = m_Player->GetWorld(); - + + if ( + (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || + (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || + (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) + ) + { + if (a_BlockFace != BLOCK_FACE_NONE) + { + AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); + World->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); + World->SendBlockTo(a_BlockX, a_BlockY + 1, a_BlockZ, m_Player); // 2 block high things + m_Player->GetInventory().SendEquippedSlot(); + } + return; + } + cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager(); if (PlgMgr->CallHookPlayerRightClick(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ)) { @@ -1092,7 +1117,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e { AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); World->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); - World->SendBlockTo(a_BlockX, a_BlockY + 1, a_BlockZ, m_Player); //2 block high things + World->SendBlockTo(a_BlockX, a_BlockY + 1, a_BlockZ, m_Player); // 2 block high things m_Player->GetInventory().SendEquippedSlot(); } return; @@ -1202,16 +1227,6 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, e // The block is being placed outside the world, ignore this packet altogether (#128) return; } - - if ( - (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || - (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || - (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) - ) - { - m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); - return; - } World->GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, ClickedBlock, ClickedBlockMeta); From 28a9c16db2212d57cca823a2b122530fdb70f210 Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 15 May 2014 19:59:52 +0200 Subject: [PATCH 085/214] Fix compile error. --- src/ClientHandle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index cf9d0bfeb..0c897374b 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -943,7 +943,7 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) ) { - m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, this); + m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); return; } From 5724dcc2c199a5d7aec1bf60a160106770a2a63a Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Fri, 16 May 2014 19:33:57 +0200 Subject: [PATCH 086/214] Fixed anvil exp removing --- src/UI/SlotArea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 788974f9c..8833a767a 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -760,7 +760,7 @@ void cSlotAreaAnvil::OnTakeResult(cPlayer & a_Player) { if (!a_Player.IsGameModeCreative()) { - a_Player.DeltaExperience(cPlayer::XpForLevel(m_MaximumCost)); + a_Player.DeltaExperience(-cPlayer::XpForLevel(m_MaximumCost)); } SetSlot(0, a_Player, cItem()); From 989312c4e7f517ae324e857cb255211e3fd8bb06 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 16 May 2014 22:04:19 +0200 Subject: [PATCH 087/214] Add more move checks - Invalid X/Y/Z/Stance check (std::isnan) - Illegal stance - Illegal position (32.000.000 is the world size) --- src/ClientHandle.cpp | 74 ++++++++++++++++++++++++++++++++++---------- src/ClientHandle.h | 2 +- 2 files changed, 59 insertions(+), 17 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 0c897374b..41b5d1626 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -582,16 +582,37 @@ void cClientHandle::HandlePlayerPos(double a_PosX, double a_PosY, double a_PosZ, return; } - /* - // TODO: Invalid stance check - if ((a_PosY >= a_Stance) || (a_Stance > a_PosY + 1.65)) + if (m_Player->GetHealth() <= 0) { - LOGD("Invalid stance"); - SendPlayerMoveLook(); + // The player is dead. He can't move :D return; } - */ - + + if (std::isnan(a_PosX) || std::isnan(a_PosY) || std::isnan(a_PosZ) || std::isnan(a_Stance)) + { + LOGWARN("%s was caught trying to crash the server with an invalid position.", m_Player->GetName().c_str()); + Kick("Nope!"); + return; + } + + // Invalid stance check + if (!m_Player->IsInBed()) + { + double Difference = a_Stance - a_PosY; + if ((Difference > 1.65) || (Difference < 1.0)) + { + Kick("Illegal stance!"); + LOGWARN("%s had an illegal stance: %f", m_Player->GetName().c_str(), a_Stance); + return; + } + } + + if ((std::abs(a_PosX) > 32000000.0) || (std::abs(a_PosZ) > 32000000.0)) + { + Kick("Illegal position!"); + return; + } + // If the player has moved too far, "repair" them: Vector3d Pos(a_PosX, a_PosY, a_PosZ); if ((m_Player->GetPosition() - Pos).SqrLength() > 100 * 100) @@ -1388,7 +1409,7 @@ void cClientHandle::HandlePlayerLook(float a_Rotation, float a_Pitch, bool a_IsO -void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Rotation, float a_Pitch, bool a_IsOnGround) +void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Yaw, float a_Pitch, bool a_IsOnGround) { if ((m_Player == NULL) || (m_State != csPlaying)) { @@ -1396,21 +1417,42 @@ void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_ return; } - /* - // TODO: Invalid stance check - if ((a_PosY >= a_Stance) || (a_Stance > a_PosY + 1.65)) + if (m_Player->GetHealth() <= 0) { - LOGD("Invalid stance"); - SendPlayerMoveLook(); + // The player is dead. He can't move :D + return; + } + + if (std::isnan(a_PosX) || std::isnan(a_PosY) || std::isnan(a_PosZ) || std::isnan(a_Stance)) + { + LOGWARN("%s was caught trying to crash the server with an invalid position.", m_Player->GetName().c_str()); + Kick("Nope!"); + return; + } + + // Invalid stance check + if (!m_Player->IsInBed()) + { + double Difference = a_Stance - a_PosY; + if ((Difference > 1.65) || (Difference < 1.0)) + { + Kick("Illegal stance!"); + LOGWARN("%s had an illegal stance: %f", m_Player->GetName().c_str(), a_Stance); + return; + } + } + + if ((std::abs(a_PosX) > 32000000.0) || (std::abs(a_PosZ) > 32000000.0)) + { + Kick("Illegal position!"); return; } - */ m_Player->MoveTo(Vector3d(a_PosX, a_PosY, a_PosZ)); m_Player->SetStance (a_Stance); m_Player->SetTouchGround(a_IsOnGround); - m_Player->SetHeadYaw (a_Rotation); - m_Player->SetYaw (a_Rotation); + m_Player->SetHeadYaw (a_Yaw); + m_Player->SetYaw (a_Yaw); m_Player->SetPitch (a_Pitch); } diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 85d348eee..940fb786a 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -223,7 +223,7 @@ public: void HandlePing (void); void HandlePlayerAbilities (bool a_CanFly, bool a_IsFlying, float FlyingSpeed, float WalkingSpeed); void HandlePlayerLook (float a_Rotation, float a_Pitch, bool a_IsOnGround); - void HandlePlayerMoveLook (double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Rotation, float a_Pitch, bool a_IsOnGround); // While m_bPositionConfirmed (normal gameplay) + void HandlePlayerMoveLook (double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Yaw, float a_Pitch, bool a_IsOnGround); // While m_bPositionConfirmed (normal gameplay) void HandlePlayerPos (double a_PosX, double a_PosY, double a_PosZ, double a_Stance, bool a_IsOnGround); void HandlePluginMessage (const AString & a_Channel, const AString & a_Message); void HandleRespawn (void); From fc5c3abcba9153196727a77e726bb0b37d5c7450 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 17 May 2014 02:26:44 +0200 Subject: [PATCH 088/214] Updated PlainsVillage prefabs to the latest Gallery contents. --- .../Prefabs/PlainsVillagePrefabs.cpp | 6429 +++++++++-------- 1 file changed, 3528 insertions(+), 2901 deletions(-) diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index 06b1395c5..863720ab4 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -16,165 +16,95 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Forge: - // The data has been exported from the gallery Plains, area index 51, ID 102, created by Aloe_vera + // BigPlantBed: + // The data has been exported from the gallery Plains, area index 26, ID 70, created by Taugrammaton { // Size: - 12, 8, 11, // SizeX = 12, SizeY = 8, SizeZ = 11 + 13, 4, 12, // SizeX = 13, SizeY = 4, SizeZ = 12 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 11, 7, 10, // MaxX, MaxY, MaxZ + 12, 3, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 64: 6\n" /* wooddoorblock */ - "h: 10: 0\n" /* lava */ - "i: 54: 2\n" /* chest */ - "j: 61: 2\n" /* furnace */ - "k:102: 0\n" /* glasspane */ - "l: 64:12\n" /* wooddoorblock */ - "m: 19: 0\n" /* sponge */ - "n:139: 0\n" /* cobblestonewall */ - "o:101: 0\n" /* ironbars */ - "p: 53: 2\n" /* woodstairs */ - "q: 53: 7\n" /* woodstairs */ - "r: 50: 2\n" /* torch */ - "s: 50: 1\n" /* torch */ - "t: 53: 6\n" /* woodstairs */ - "u: 53: 3\n" /* woodstairs */ - "v: 43: 0\n" /* doubleslab */ - "w: 44: 0\n" /* step */, + "a: 3: 0\n" /* dirt */ + "b: 5: 0\n" /* wood */ + "c: 13: 0\n" /* gravel */ + "d: 17: 0\n" /* tree */ + "e: 60: 7\n" /* tilleddirt */ + "f: 8: 0\n" /* water */ + "g: 85: 0\n" /* fence */ + "h: 59: 7\n" /* crops */ + "m: 19: 0\n" /* sponge */, // Block data: // Level 0 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ ".....abbbc.." - /* 1 */ ".ddddddddc.." - /* 2 */ ".ddddddddc.." - /* 3 */ ".ddddddddddd" - /* 4 */ ".ddddddddddd" - /* 5 */ ".ddddddddddd" - /* 6 */ ".ddddddddddd" - /* 7 */ ".ddddddddddd" - /* 8 */ ".ddddd.mmmmm" - /* 9 */ ".ddddd.mmmmm" - /* 10 */ ".......mmmmm" + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "aaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaaaa" + /* 11 */ "aaaaaaaaaaaaa" // Level 1 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".efffe......" - /* 2 */ ".f...g......" - /* 3 */ ".f...ed..ddd" - /* 4 */ ".f...f...dhd" - /* 5 */ ".f...f...dhd" - /* 6 */ ".f...fijjdhd" - /* 7 */ ".f...edddddd" - /* 8 */ ".f...f.mmmmm" - /* 9 */ ".efffe.mmmmm" - /* 10 */ ".......mmmmm" + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "bbbbbbbbbbbbb" + /* 1 */ "bcccccccccccb" + /* 2 */ "bcccccccccccb" + /* 3 */ "bcccccccccccb" + /* 4 */ "bcccccccccccb" + /* 5 */ "bcccccccccccb" + /* 6 */ "bcccccccccccb" + /* 7 */ "bcccccccccccb" + /* 8 */ "bcccccccccccb" + /* 9 */ "bcccccccccccb" + /* 10 */ "bcccccccccccb" + /* 11 */ "bbbbbbbbbbbbb" // Level 2 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".ekkke......" - /* 2 */ ".k...l......" - /* 3 */ ".k...en..n.d" - /* 4 */ ".k...k.....o" - /* 5 */ ".f...k.....o" - /* 6 */ ".k...k.....o" - /* 7 */ ".k...edooood" - /* 8 */ ".k...f.mmmmm" - /* 9 */ ".ekkke.mmmmm" - /* 10 */ ".......mmmmm" + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "ddddddddddddd" + /* 1 */ "deefeefeefeed" + /* 2 */ "deefeefeefeed" + /* 3 */ "deefeefeefeed" + /* 4 */ "deefeefeefeed" + /* 5 */ "deefeefeefeed" + /* 6 */ "deefeefeefeed" + /* 7 */ "deefeefeefeed" + /* 8 */ "deefeefeefeed" + /* 9 */ "deefeefeefeed" + /* 10 */ "deefeefeefeed" + /* 11 */ "ddddddddddddd" // Level 3 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "ppppppp....." - /* 1 */ "qfffffq....." - /* 2 */ ".f...f......" - /* 3 */ ".f..rfd..dod" - /* 4 */ ".f...f...o.d" - /* 5 */ ".f...f...o.d" - /* 6 */ ".fs..f...o.d" - /* 7 */ ".f...fdddddd" - /* 8 */ ".f...f.mmmmm" - /* 9 */ "tffffftmmmmm" - /* 10 */ "uuuuuuummmmm" - - // Level 4 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "ppppppp....." - /* 2 */ "qfffffq....." - /* 3 */ ".f...fvvvvvv" - /* 4 */ ".f...fvwwwwv" - /* 5 */ ".f...fvwwwwv" - /* 6 */ ".f...fvwwwwv" - /* 7 */ ".f...fvvvvvv" - /* 8 */ "tffffftmmmmm" - /* 9 */ "uuuuuuummmmm" - /* 10 */ ".......mmmmm" - - // Level 5 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "............" - /* 2 */ "ppppppp....." - /* 3 */ "qfffffq....." - /* 4 */ ".f...f......" - /* 5 */ ".f...f......" - /* 6 */ ".f...f......" - /* 7 */ "tffffft....." - /* 8 */ "uuuuuuummmmm" - /* 9 */ ".......mmmmm" - /* 10 */ ".......mmmmm" - - // Level 6 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "............" - /* 2 */ "............" - /* 3 */ "ppppppp....." - /* 4 */ "qfffffq....." - /* 5 */ ".f...f......" - /* 6 */ "tffffft....." - /* 7 */ "uuuuuuu....." - /* 8 */ ".......mmmmm" - /* 9 */ ".......mmmmm" - /* 10 */ ".......mmmmm" - - // Level 7 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "............" - /* 2 */ "............" - /* 3 */ "............" - /* 4 */ "ppppppp....." - /* 5 */ "fffffff....." - /* 6 */ "uuuuuuu....." - /* 7 */ "............" - /* 8 */ ".......mmmmm" - /* 9 */ ".......mmmmm" - /* 10 */ ".......mmmmm", + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "g..g..g..g..g" + /* 1 */ "ghh.h..hh.hhg" + /* 2 */ "ghh..h.hh.hhg" + /* 3 */ "ghh.h..h..hhg" + /* 4 */ "ghh.hh.h..hhg" + /* 5 */ "ghh.h..hh.hhg" + /* 6 */ "ghh.hh.hh.hhg" + /* 7 */ "ghh....h..hhg" + /* 8 */ "ghh..h....hhg" + /* 9 */ "ghh.....h.hhg" + /* 10 */ "ghh.hh.h..hhg" + /* 11 */ "g..g..g..g..g", // Connectors: - "-1: 7, 0, 0: 2\n" /* Type -1, direction Z- */, + "-1: 7, 1, 11: 3\n" /* Type -1, direction Z+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -193,539 +123,139 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, - }, // Forge + }, // BigPlantBed /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_100: - // The data has been exported from the gallery Plains, area index 49, ID 100, created by Aloe_vera + // CobbleHouse10x5Library: + // The data has been exported from the gallery Plains, area index 23, ID 66, created by xoft { // Size: - 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7 + 12, 8, 7, // SizeX = 12, SizeY = 8, SizeZ = 7 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 6, 5, 6, // MaxX, MaxY, MaxZ + 11, 7, 6, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ "g: 64: 7\n" /* wooddoorblock */ - "h: 64:12\n" /* wooddoorblock */ - "i:102: 0\n" /* glasspane */ - "j: 53: 2\n" /* woodstairs */ - "k: 53: 7\n" /* woodstairs */ - "l: 50: 3\n" /* torch */ + "h: 53: 3\n" /* woodstairs */ + "i: 53: 1\n" /* woodstairs */ + "j: 85: 0\n" /* fence */ + "k: 53: 0\n" /* woodstairs */ + "l: 53: 2\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 53: 6\n" /* woodstairs */ - "o: 53: 3\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 0123456 */ - /* 0 */ "..abc.." - /* 1 */ ".ddddd." - /* 2 */ ".ddddd." - /* 3 */ ".ddddd." - /* 4 */ ".ddddd." - /* 5 */ ".ddddd." - /* 6 */ "......." - - // Level 1 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".efgfe." - /* 2 */ ".f...f." - /* 3 */ ".f...f." - /* 4 */ ".f...f." - /* 5 */ ".efffe." - /* 6 */ "......." - - // Level 2 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".efhfe." - /* 2 */ ".i...i." - /* 3 */ ".i...i." - /* 4 */ ".i...i." - /* 5 */ ".eiiie." - /* 6 */ "......." - - // Level 3 - /* z\x* 0123456 */ - /* 0 */ "jjjjjjj" - /* 1 */ "kfffffk" - /* 2 */ ".fl.lf." - /* 3 */ ".f...f." - /* 4 */ ".f...f." - /* 5 */ "nfffffn" - /* 6 */ "ooooooo" - - // Level 4 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ "jjjjjjj" - /* 2 */ "kfffffk" - /* 3 */ ".f...f." - /* 4 */ "nfffffn" - /* 5 */ "ooooooo" - /* 6 */ "......." - - // Level 5 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ "......." - /* 2 */ "jjjjjjj" - /* 3 */ "fffffff" - /* 4 */ "ooooooo" - /* 5 */ "......." - /* 6 */ ".......", - - // Connectors: - "-1: 3, 0, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_100 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_103: - // The data has been exported from the gallery Plains, area index 52, ID 103, created by Aloe_vera - { - // Size: - 11, 7, 9, // SizeX = 11, SizeY = 7, SizeZ = 9 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 6, 8, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 64: 7\n" /* wooddoorblock */ - "h:102: 0\n" /* glasspane */ - "i: 64:12\n" /* wooddoorblock */ - "j: 53: 2\n" /* woodstairs */ - "k: 53: 7\n" /* woodstairs */ - "l: 50: 3\n" /* torch */ - "m: 19: 0\n" /* sponge */ - "n: 50: 4\n" /* torch */ - "o: 53: 6\n" /* woodstairs */ - "p: 53: 3\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "....abc...." - /* 1 */ ".ddddddddd." - /* 2 */ ".ddddddddd." - /* 3 */ ".ddddddddd." - /* 4 */ ".ddddddddd." - /* 5 */ ".ddddddddd." - /* 6 */ ".ddddddddd." - /* 7 */ ".ddddddddd." - /* 8 */ "..........." - - // Level 1 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".efffgfffe." - /* 2 */ ".f.......f." - /* 3 */ ".f.......f." - /* 4 */ ".f.......f." - /* 5 */ ".f.......f." - /* 6 */ ".f.......f." - /* 7 */ ".efffffffe." - /* 8 */ "..........." - - // Level 2 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".ehhfifhhe." - /* 2 */ ".h.......h." - /* 3 */ ".h.......h." - /* 4 */ ".f.......f." - /* 5 */ ".h.......h." - /* 6 */ ".h.......h." - /* 7 */ ".ehhhfhhhe." - /* 8 */ "..........." - - // Level 3 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "jjjjjjjjjjj" - /* 1 */ "kfffffffffk" - /* 2 */ ".f..l.l..f." - /* 3 */ ".f.......f." - /* 4 */ ".f.......f." - /* 5 */ ".f.......f." - /* 6 */ ".f...n...f." - /* 7 */ "offfffffffo" - /* 8 */ "ppppppppppp" - - // Level 4 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "jjjjjjjjjjj" - /* 2 */ "kfffffffffk" - /* 3 */ ".f.......f." - /* 4 */ ".f.......f." - /* 5 */ ".f.......f." - /* 6 */ "offfffffffo" - /* 7 */ "ppppppppppp" - /* 8 */ "..........." - - // Level 5 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "jjjjjjjjjjj" - /* 3 */ "kfffffffffk" - /* 4 */ ".f.......f." - /* 5 */ "offfffffffo" - /* 6 */ "ppppppppppp" - /* 7 */ "..........." - /* 8 */ "..........." - - // Level 6 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "..........." - /* 3 */ "jjjjjjjjjjj" - /* 4 */ "fffffffffff" - /* 5 */ "ppppppppppp" - /* 6 */ "..........." - /* 7 */ "..........." - /* 8 */ "...........", - - // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_103 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_105: - // The data has been exported from the gallery Plains, area index 54, ID 105, created by Aloe_vera - { - // Size: - 7, 6, 9, // SizeX = 7, SizeY = 6, SizeZ = 9 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 6, 5, 8, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a:170: 0\n" /* haybale */ - "b: 67: 0\n" /* stairs */ - "c: 67: 2\n" /* stairs */ - "d: 67: 1\n" /* stairs */ - "e: 4: 0\n" /* cobblestone */ - "f: 17: 0\n" /* tree */ - "g: 5: 0\n" /* wood */ - "h:170: 4\n" /* haybale */ - "i:170: 8\n" /* haybale */ - "j: 54: 2\n" /* chest */ - "k: 50: 4\n" /* torch */ - "l: 53: 0\n" /* woodstairs */ - "m: 19: 0\n" /* sponge */ - "n: 53: 5\n" /* woodstairs */ - "o: 53: 4\n" /* woodstairs */ - "p: 53: 1\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 0123456 */ - /* 0 */ "abcccd." - /* 1 */ ".eeeee." - /* 2 */ ".eeeee." - /* 3 */ ".eeeee." - /* 4 */ ".eeeee." - /* 5 */ ".eeeee." - /* 6 */ ".eeeee." - /* 7 */ ".eeeee." - /* 8 */ "......." - - // Level 1 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".f..af." - /* 2 */ ".g...g." - /* 3 */ ".ga.hg." - /* 4 */ ".fihif." - /* 5 */ ".gaaag." - /* 6 */ ".gijag." - /* 7 */ ".fgfgf." - /* 8 */ "......." - - // Level 2 - /* z\x* 0123456 */ - /* 0 */ ".k...k." - /* 1 */ ".f...f." - /* 2 */ ".g...g." - /* 3 */ ".g...g." - /* 4 */ ".fh..f." - /* 5 */ ".ghiag." - /* 6 */ ".ghiig." - /* 7 */ ".fgfgf." - /* 8 */ "......." - - // Level 3 - /* z\x* 0123456 */ - /* 0 */ "ln...op" - /* 1 */ "lgggggp" - /* 2 */ "lg...gp" - /* 3 */ "lg...gp" - /* 4 */ "lg...gp" - /* 5 */ "lgaa.gp" - /* 6 */ "lgiaigp" - /* 7 */ "lgggggp" - /* 8 */ "ln...op" - - // Level 4 - /* z\x* 0123456 */ - /* 0 */ ".ln.op." - /* 1 */ ".lgggp." - /* 2 */ ".lg.gp." - /* 3 */ ".lg.gp." - /* 4 */ ".lg.gp." - /* 5 */ ".lg.gp." - /* 6 */ ".lg.gp." - /* 7 */ ".lgggp." - /* 8 */ ".ln.op." - - // Level 5 - /* z\x* 0123456 */ - /* 0 */ "..lgp.." - /* 1 */ "..lgp.." - /* 2 */ "..lgp.." - /* 3 */ "..lgp.." - /* 4 */ "..lgp.." - /* 5 */ "..lgp.." - /* 6 */ "..lgp.." - /* 7 */ "..lgp.." - /* 8 */ "..lgp..", - - // Connectors: - "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_105 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_106: - // The data has been exported from the gallery Plains, area index 55, ID 106, created by Aloe_vera - { - // Size: - 15, 8, 9, // SizeX = 15, SizeY = 8, SizeZ = 9 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 14, 7, 8, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 3: 0\n" /* dirt */ - "f: 17: 0\n" /* tree */ - "g:107: 0\n" /* fencegate */ - "h:107: 4\n" /* fencegate */ - "i: 5: 0\n" /* wood */ - "j:107: 6\n" /* fencegate */ - "k: 85: 0\n" /* fence */ - "l:170: 0\n" /* haybale */ - "m: 19: 0\n" /* sponge */ - "n:170: 4\n" /* haybale */ - "o:170: 8\n" /* haybale */ - "p: 50: 1\n" /* torch */ - "q: 50: 2\n" /* torch */ - "r: 53: 2\n" /* woodstairs */ + "n:102: 0\n" /* glasspane */ + "o: 64:12\n" /* wooddoorblock */ + "p: 50: 3\n" /* torch */ + "q: 72: 0\n" /* woodplate */ + "r: 50: 4\n" /* torch */ "s: 53: 7\n" /* woodstairs */ - "t: 53: 6\n" /* woodstairs */ - "u: 53: 3\n" /* woodstairs */, + "t: 47: 0\n" /* bookshelf */ + "u: 50: 1\n" /* torch */ + "v: 50: 2\n" /* torch */ + "w: 53: 6\n" /* woodstairs */ + "x: 5: 0\n" /* wood */, // Block data: // Level 0 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ ".abbbbbbbbbbbc." - /* 1 */ ".ddddddddddddd." - /* 2 */ ".deeeeeeeeeeed." - /* 3 */ ".deeeeeeeeeeed." - /* 4 */ ".deeeeeeeeeeed." - /* 5 */ ".deeeeeeeeeeed." - /* 6 */ ".deeeeeeeeeeed." - /* 7 */ ".ddddddddddddd." - /* 8 */ "..............." + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "aaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaa" // Level 1 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".fghgighgigjgf." - /* 2 */ ".k...k...k...k." - /* 3 */ ".k...k...k...k." - /* 4 */ ".k...k...k...k." - /* 5 */ ".k...k...k...k." - /* 6 */ ".kl..k..nko..k." - /* 7 */ ".fkkkikkkikkkf." - /* 8 */ "..............." + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "bbbbbbbaaabb" + /* 1 */ "baaaaaaaaaab" + /* 2 */ "baaaaaaaaaab" + /* 3 */ "baaaaaaaaaab" + /* 4 */ "baaaaaaaaaab" + /* 5 */ "baaaaaaaaaab" + /* 6 */ "bbbbbbbbbbbb" // Level 2 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".f...i...i...f." - /* 2 */ "..............." - /* 3 */ "..............." - /* 4 */ "..............." - /* 5 */ "..............." - /* 6 */ "..............." - /* 7 */ ".f...i...i...f." - /* 8 */ "..............." + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ ".......cde.." + /* 1 */ ".ffffffffff." + /* 2 */ ".ffffffffff." + /* 3 */ ".ffffffffff." + /* 4 */ ".ffffffffff." + /* 5 */ ".ffffffffff." + /* 6 */ "............" // Level 3 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".fp.qip.qip.qf." - /* 2 */ "..............." - /* 3 */ "..............." - /* 4 */ "..............." - /* 5 */ "..............." - /* 6 */ "..............." - /* 7 */ ".f...i...i...f." - /* 8 */ "..............." + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".fffffffgff." + /* 2 */ ".fh.ijk...f." + /* 3 */ ".fj.......f." + /* 4 */ ".fl.ijkijkf." + /* 5 */ ".ffffffffff." + /* 6 */ "............" // Level 4 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "rrrrrrrrrrrrrrr" - /* 1 */ "siiiiiiiiiiiiis" - /* 2 */ ".i...........i." - /* 3 */ ".i...........i." - /* 4 */ ".i...........i." - /* 5 */ ".i...........i." - /* 6 */ ".i...........i." - /* 7 */ "tiiiiiiiiiiiiit" - /* 8 */ "uuuuuuuuuuuuuuu" + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".fnnfnnfoff." + /* 2 */ ".n..pq.p.pn." + /* 3 */ ".nq.......n." + /* 4 */ ".n..rq.rq.n." + /* 5 */ ".fnnfnnfnnf." + /* 6 */ "............" // Level 5 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ "rrrrrrrrrrrrrrr" - /* 2 */ "siiiiiiiiiiiiis" - /* 3 */ ".i...........i." - /* 4 */ ".i...........i." - /* 5 */ ".i...........i." - /* 6 */ "tiiiiiiiiiiiiit" - /* 7 */ "uuuuuuuuuuuuuuu" - /* 8 */ "..............." + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "llllllllllll" + /* 1 */ "sffffffffffs" + /* 2 */ ".fttttttttf." + /* 3 */ ".fu......vf." + /* 4 */ ".fttttttttf." + /* 5 */ "wffffffffffw" + /* 6 */ "hhhhhhhhhhhh" // Level 6 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ "..............." - /* 2 */ "rrrrrrrrrrrrrrr" - /* 3 */ "siiiiiiiiiiiiis" - /* 4 */ ".i...........i." - /* 5 */ "tiiiiiiiiiiiiit" - /* 6 */ "uuuuuuuuuuuuuuu" - /* 7 */ "..............." - /* 8 */ "..............." + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "llllllllllll" + /* 2 */ "sxxxxxxxxxxs" + /* 3 */ ".xxxxxxxxxx." + /* 4 */ "wxxxxxxxxxxw" + /* 5 */ "hhhhhhhhhhhh" + /* 6 */ "............" // Level 7 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ "..............." - /* 2 */ "..............." - /* 3 */ "rrrrrrrrrrrrrrr" - /* 4 */ "iiiiiiiiiiiiiii" - /* 5 */ "uuuuuuuuuuuuuuu" - /* 6 */ "..............." - /* 7 */ "..............." - /* 8 */ "...............", + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "llllllllllll" + /* 3 */ "xxxxxxxxxxxx" + /* 4 */ "hhhhhhhhhhhh" + /* 5 */ "............" + /* 6 */ "............", // Connectors: - "-1: 7, 0, 0: 2\n" /* Type -1, direction Z- */, + "-1: 8, 2, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -744,303 +274,12 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, - }, // PlainsVillage_106 + }, // CobbleHouse10x5Library /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_109: - // The data has been exported from the gallery Plains, area index 58, ID 109, created by Aloe_vera - { - // Size: - 7, 14, 13, // SizeX = 7, SizeY = 14, SizeZ = 13 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 6, 13, 12, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "A: 85: 0\n" /* fence */ - "B:126: 8\n" /* woodenslab */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 64: 7\n" /* wooddoorblock */ - "h: 65: 3\n" /* ladder */ - "i: 53: 3\n" /* woodstairs */ - "j: 53: 7\n" /* woodstairs */ - "k: 64:12\n" /* wooddoorblock */ - "l:102: 0\n" /* glasspane */ - "m: 19: 0\n" /* sponge */ - "n: 50: 1\n" /* torch */ - "o: 50: 2\n" /* torch */ - "p:171:14\n" /* carpet */ - "q: 50: 3\n" /* torch */ - "r: 53: 2\n" /* woodstairs */ - "s: 53: 0\n" /* woodstairs */ - "t: 53: 1\n" /* woodstairs */ - "u: 53: 5\n" /* woodstairs */ - "v: 53: 4\n" /* woodstairs */ - "w: 17: 4\n" /* tree */ - "x: 17: 8\n" /* tree */ - "y: 54: 2\n" /* chest */ - "z: 50: 4\n" /* torch */, - - // Block data: - // Level 0 - /* z\x* 0123456 */ - /* 0 */ "..abc.." - /* 1 */ ".ddddd." - /* 2 */ ".ddddd." - /* 3 */ ".ddddd." - /* 4 */ ".ddddd." - /* 5 */ ".ddddd." - /* 6 */ ".ddddd." - /* 7 */ ".ddddd." - /* 8 */ ".ddddd." - /* 9 */ ".ddddd." - /* 10 */ ".ddddd." - /* 11 */ ".ddddd." - /* 12 */ "......." - - // Level 1 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".efgfe." - /* 2 */ ".f..hf." - /* 3 */ ".f...f." - /* 4 */ ".f...f." - /* 5 */ ".ei.ie." - /* 6 */ ".f...f." - /* 7 */ ".fi.if." - /* 8 */ ".f...f." - /* 9 */ ".f.j.f." - /* 10 */ ".f...f." - /* 11 */ ".efffe." - /* 12 */ "......." - - // Level 2 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".efkfe." - /* 2 */ ".l..hl." - /* 3 */ ".l...l." - /* 4 */ ".l...l." - /* 5 */ ".e...e." - /* 6 */ ".l...l." - /* 7 */ ".l...l." - /* 8 */ ".fn.of." - /* 9 */ ".l.p.l." - /* 10 */ ".l...l." - /* 11 */ ".ellle." - /* 12 */ "......." - - // Level 3 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".efffe." - /* 2 */ ".f.qhf." - /* 3 */ ".f...f." - /* 4 */ ".f...f." - /* 5 */ "re...er" - /* 6 */ "sf...ft" - /* 7 */ "sf...ft" - /* 8 */ "sf...ft" - /* 9 */ "sf...ft" - /* 10 */ "sf...ft" - /* 11 */ "sefffft" - /* 12 */ "su...vt" - - // Level 4 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".ewwwe." - /* 2 */ ".xffhx." - /* 3 */ ".xfffx." - /* 4 */ ".xfffx." - /* 5 */ ".ewwwe." - /* 6 */ ".sf.ft." - /* 7 */ ".sf.ft." - /* 8 */ ".sf.ft." - /* 9 */ ".sf.ft." - /* 10 */ ".sf.ft." - /* 11 */ ".sffft." - /* 12 */ ".su.vt." - - // Level 5 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".eflfe." - /* 2 */ ".f..hf." - /* 3 */ ".f...f." - /* 4 */ ".f.y.f." - /* 5 */ ".efffe." - /* 6 */ "..sft.." - /* 7 */ "..sft.." - /* 8 */ "..sft.." - /* 9 */ "..sft.." - /* 10 */ "..sft.." - /* 11 */ "..sft.." - /* 12 */ "..sft.." - - // Level 6 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".eflfe." - /* 2 */ ".f..hf." - /* 3 */ ".l...l." - /* 4 */ ".f...f." - /* 5 */ ".efffe." - /* 6 */ "......." - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ "......." - - // Level 7 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".eflfe." - /* 2 */ ".f..hf." - /* 3 */ ".f...f." - /* 4 */ ".f.z.f." - /* 5 */ ".efffe." - /* 6 */ "......." - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ "......." - - // Level 8 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".ewwwe." - /* 2 */ ".xffhx." - /* 3 */ ".xfffx." - /* 4 */ ".xfffx." - /* 5 */ ".ewwwe." - /* 6 */ "......." - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ "......." - - // Level 9 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".eAAAe." - /* 2 */ ".A...A." - /* 3 */ ".A...A." - /* 4 */ ".A...A." - /* 5 */ ".eAAAe." - /* 6 */ "......." - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ "......." - - // Level 10 - /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".e...e." - /* 2 */ "......." - /* 3 */ "......." - /* 4 */ "......." - /* 5 */ ".e...e." - /* 6 */ "......." - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ "......." - - // Level 11 - /* z\x* 0123456 */ - /* 0 */ "su...vt" - /* 1 */ "sefffet" - /* 2 */ "sfBBBft" - /* 3 */ "sfBBBft" - /* 4 */ "sfBBBft" - /* 5 */ "sffffft" - /* 6 */ "su...vt" - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ "......." - - // Level 12 - /* z\x* 0123456 */ - /* 0 */ ".su.vt." - /* 1 */ ".sffft." - /* 2 */ ".sffft." - /* 3 */ ".sffft." - /* 4 */ ".sffft." - /* 5 */ ".sffft." - /* 6 */ ".su.vt." - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ "......." - - // Level 13 - /* z\x* 0123456 */ - /* 0 */ "..sft.." - /* 1 */ "..sft.." - /* 2 */ "..sft.." - /* 3 */ "..sft.." - /* 4 */ "..sft.." - /* 5 */ "..sft.." - /* 6 */ "..sft.." - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ ".......", - - // Connectors: - "-1: 3, 0, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_109 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_20: + // DoublePlantBed: // The data has been exported from the gallery Plains, area index 5, ID 20, created by tonibm1999 { // Size: @@ -1106,139 +345,202 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, - }, // PlainsVillage_20 + }, // DoublePlantBed /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_26: - // The data has been exported from the gallery Plains, area index 9, ID 26, created by Aloe_vera + // Forge: + // The data has been exported from the gallery Plains, area index 51, ID 102, created by Aloe_vera { // Size: - 10, 6, 11, // SizeX = 10, SizeY = 6, SizeZ = 11 + 12, 10, 11, // SizeX = 12, SizeY = 10, SizeZ = 11 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 9, 5, 10, // MaxX, MaxY, MaxZ + 11, 9, 10, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 4: 0\n" /* cobblestone */ - "b: 5: 0\n" /* wood */ - "c: 2: 0\n" /* grass */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ "d: 67: 2\n" /* stairs */ - "e: 43: 0\n" /* doubleslab */ - "f: 67: 0\n" /* stairs */ - "g: 67: 3\n" /* stairs */ - "h: 17: 0\n" /* tree */ - "i: 53: 1\n" /* woodstairs */ - "j: 85: 0\n" /* fence */ - "k: 53: 0\n" /* woodstairs */ - "l: 64: 6\n" /* wooddoorblock */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 6\n" /* wooddoorblock */ + "j: 10: 0\n" /* lava */ + "k: 54: 2\n" /* chest */ + "l: 61: 2\n" /* furnace */ "m: 19: 0\n" /* sponge */ - "n: 64: 0\n" /* wooddoorblock */ - "o:102: 0\n" /* glasspane */ - "p: 72: 0\n" /* woodplate */ - "q: 64:12\n" /* wooddoorblock */ - "r: 64: 8\n" /* wooddoorblock */ - "s: 53: 5\n" /* woodstairs */ - "t: 53: 4\n" /* woodstairs */ + "n:102: 0\n" /* glasspane */ + "o: 64:12\n" /* wooddoorblock */ + "p:139: 0\n" /* cobblestonewall */ + "q:101: 0\n" /* ironbars */ + "r: 53: 2\n" /* woodstairs */ + "s: 53: 7\n" /* woodstairs */ + "t: 50: 2\n" /* torch */ "u: 50: 1\n" /* torch */ - "v: 50: 2\n" /* torch */, + "v: 53: 6\n" /* woodstairs */ + "w: 53: 3\n" /* woodstairs */ + "x: 43: 0\n" /* doubleslab */ + "y: 44: 0\n" /* step */, // Block data: // Level 0 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "......mmmm" - /* 1 */ ".aaaaammmm" - /* 2 */ ".abbbammmm" - /* 3 */ ".abbbacccc" - /* 4 */ "daeeeacccc" - /* 5 */ "faeeeecccc" - /* 6 */ "gaeeeacccc" - /* 7 */ ".aeeeacccc" - /* 8 */ ".aeeeacccc" - /* 9 */ ".aaaaammmm" - /* 10 */ "......mmmm" + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "aaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaaa" // Level 1 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "......mmmm" - /* 1 */ ".hbbbhmmmm" - /* 2 */ ".bijkbmmmm" - /* 3 */ ".b...bjjjj" - /* 4 */ ".b...b...j" - /* 5 */ ".l...n...j" - /* 6 */ ".b...b...j" - /* 7 */ ".bee.b...j" - /* 8 */ ".b...bjjjj" - /* 9 */ ".hbbbhmmmm" - /* 10 */ "......mmmm" + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "bbbbbaaaaabb" + /* 1 */ "baaaaaaaaabb" + /* 2 */ "baaaaaaaaabb" + /* 3 */ "baaaaaaaaaaa" + /* 4 */ "baaaaaaaaaaa" + /* 5 */ "baaaaaaaaaaa" + /* 6 */ "baaaaaaaaaaa" + /* 7 */ "baaaaaaaaaaa" + /* 8 */ "baaaaabbbbbb" + /* 9 */ "baaaaabbbbbb" + /* 10 */ "bbbbbbbbbbbb" // Level 2 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "......mmmm" - /* 1 */ ".hooohmmmm" - /* 2 */ ".o.p.ommmm" - /* 3 */ ".o...o...." - /* 4 */ ".b...b...." - /* 5 */ ".q...r...." - /* 6 */ ".b...b...." - /* 7 */ ".o...o...." - /* 8 */ ".o...o...." - /* 9 */ ".hooohmmmm" - /* 10 */ "......mmmm" + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ ".....cddde.." + /* 1 */ ".ffffffffe.." + /* 2 */ ".ffffffffe.." + /* 3 */ ".fffffffffff" + /* 4 */ ".fffffffffff" + /* 5 */ ".fffffffffff" + /* 6 */ ".fffffffffff" + /* 7 */ ".fffffffffff" + /* 8 */ ".fffff.mmmmm" + /* 9 */ ".fffff.mmmmm" + /* 10 */ ".......mmmmm" // Level 3 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "ks...timmm" - /* 1 */ "khbbbhimmm" - /* 2 */ "kb...bimmm" - /* 3 */ "kb...bi..." - /* 4 */ "kbu.vbi..." - /* 5 */ "kb...bi..." - /* 6 */ "kbu.vbi..." - /* 7 */ "kb...bi..." - /* 8 */ "kb...bi..." - /* 9 */ "khbbbhimmm" - /* 10 */ "ks...timmm" + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".ghhhg......" + /* 2 */ ".h...i......" + /* 3 */ ".h...gf..fff" + /* 4 */ ".h...h...fjf" + /* 5 */ ".h...h...fjf" + /* 6 */ ".h...hkllfjf" + /* 7 */ ".h...gffffff" + /* 8 */ ".h...h.mmmmm" + /* 9 */ ".ghhhg.mmmmm" + /* 10 */ ".......mmmmm" // Level 4 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "mks.timmmm" - /* 1 */ "mkbbbimmmm" - /* 2 */ "mkb.bimmmm" - /* 3 */ "mkb.bim..." - /* 4 */ "mkb.bim..." - /* 5 */ "mkb.bim..." - /* 6 */ "mkb.bim..." - /* 7 */ "mkb.bim..." - /* 8 */ "mkb.bim..." - /* 9 */ "mkbbbimmmm" - /* 10 */ "mks.timmmm" + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".gnnng......" + /* 2 */ ".n...o......" + /* 3 */ ".n...gp..p.f" + /* 4 */ ".n...n.....q" + /* 5 */ ".h...n.....q" + /* 6 */ ".n...n.....q" + /* 7 */ ".n...gfqqqqf" + /* 8 */ ".n...h.mmmmm" + /* 9 */ ".gnnng.mmmmm" + /* 10 */ ".......mmmmm" // Level 5 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "mmkbimmmmm" - /* 1 */ "mmkbimmmmm" - /* 2 */ "mmkbimmmmm" - /* 3 */ "mmkbimm..." - /* 4 */ "mmkbimm..." - /* 5 */ "mmkbimm..." - /* 6 */ "mmkbimm..." - /* 7 */ "mmkbimm..." - /* 8 */ "mmkbimm..." - /* 9 */ "mmkbimmmmm" - /* 10 */ "mmkbimmmmm", + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "rrrrrrr....." + /* 1 */ "shhhhhs....." + /* 2 */ ".h...h......" + /* 3 */ ".h..thf..fqf" + /* 4 */ ".h...h...q.f" + /* 5 */ ".h...h...q.f" + /* 6 */ ".hu..h...q.f" + /* 7 */ ".h...hffffff" + /* 8 */ ".h...h.mmmmm" + /* 9 */ "vhhhhhvmmmmm" + /* 10 */ "wwwwwwwmmmmm" + + // Level 6 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "rrrrrrr....." + /* 2 */ "shhhhhs....." + /* 3 */ ".h...hxxxxxx" + /* 4 */ ".h...hxyyyyx" + /* 5 */ ".h...hxyyyyx" + /* 6 */ ".h...hxyyyyx" + /* 7 */ ".h...hxxxxxx" + /* 8 */ "vhhhhhvmmmmm" + /* 9 */ "wwwwwwwmmmmm" + /* 10 */ ".......mmmmm" + + // Level 7 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "rrrrrrr....." + /* 3 */ "shhhhhs....." + /* 4 */ ".h...h......" + /* 5 */ ".h...h......" + /* 6 */ ".h...h......" + /* 7 */ "vhhhhhv....." + /* 8 */ "wwwwwwwmmmmm" + /* 9 */ ".......mmmmm" + /* 10 */ ".......mmmmm" + + // Level 8 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "rrrrrrr....." + /* 4 */ "shhhhhs....." + /* 5 */ ".h...h......" + /* 6 */ "vhhhhhv....." + /* 7 */ "wwwwwww....." + /* 8 */ ".......mmmmm" + /* 9 */ ".......mmmmm" + /* 10 */ ".......mmmmm" + + // Level 9 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "............" + /* 4 */ "rrrrrrr....." + /* 5 */ "hhhhhhh....." + /* 6 */ "wwwwwww....." + /* 7 */ "............" + /* 8 */ ".......mmmmm" + /* 9 */ ".......mmmmm" + /* 10 */ ".......mmmmm", // Connectors: - "-1: 1, 0, 5: 4\n" /* Type -1, direction X- */, + "-1: 7, 2, -1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1257,12 +559,2333 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, - }, // PlainsVillage_26 + }, // Forge /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_4: + // SinglePlantBed: + // The data has been exported from the gallery Plains, area index 17, ID 60, created by Aloe_vera + { + // Size: + 10, 3, 7, // SizeX = 10, SizeY = 3, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 2, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 17: 0\n" /* tree */ + "c: 60: 7\n" /* tilleddirt */ + "d: 8: 0\n" /* water */ + "e: 59: 7\n" /* crops */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "aaaaaaaaaa" + /* 1 */ "aaaaaaaaaa" + /* 2 */ "aaaaaaaaaa" + /* 3 */ "aaaaaaaaaa" + /* 4 */ "aaaaaaaaaa" + /* 5 */ "aaaaaaaaaa" + /* 6 */ "aaaaaaaaaa" + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "bbbbbbbbbb" + /* 1 */ "bccccccccb" + /* 2 */ "bccccccccb" + /* 3 */ "bddddddddb" + /* 4 */ "bccccccccb" + /* 5 */ "bccccccccb" + /* 6 */ "bbbbbbbbbb" + + // Level 2 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".eeeeeeee." + /* 2 */ ".eeeeeeee." + /* 3 */ ".........." + /* 4 */ ".eeeeeeee." + /* 5 */ ".eeeeeeee." + /* 6 */ "..........", + + // Connectors: + "-1: 9, 1, 3: 5\n" /* Type -1, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // SinglePlantBed + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenChurchMid: + // The data has been exported from the gallery Plains, area index 58, ID 109, created by Aloe_vera + { + // Size: + 7, 16, 13, // SizeX = 7, SizeY = 16, SizeZ = 13 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 15, 12, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A: 54: 2\n" /* chest */ + "B: 50: 4\n" /* torch */ + "C: 85: 0\n" /* fence */ + "D:126: 8\n" /* woodenslab */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 7\n" /* wooddoorblock */ + "j: 65: 3\n" /* ladder */ + "k: 53: 3\n" /* woodstairs */ + "l: 53: 7\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 64:12\n" /* wooddoorblock */ + "o:102: 0\n" /* glasspane */ + "p: 50: 1\n" /* torch */ + "q: 50: 2\n" /* torch */ + "r:171:14\n" /* carpet */ + "s: 50: 3\n" /* torch */ + "t: 53: 2\n" /* woodstairs */ + "u: 53: 0\n" /* woodstairs */ + "v: 53: 1\n" /* woodstairs */ + "w: 53: 5\n" /* woodstairs */ + "x: 53: 4\n" /* woodstairs */ + "y: 17: 4\n" /* tree */ + "z: 17: 8\n" /* tree */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaaaaa" + /* 3 */ "aaaaaaa" + /* 4 */ "aaaaaaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" + /* 7 */ "aaaaaaa" + /* 8 */ "aaaaaaa" + /* 9 */ "aaaaaaa" + /* 10 */ "aaaaaaa" + /* 11 */ "aaaaaaa" + /* 12 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "bbaaabb" + /* 1 */ "baaaaab" + /* 2 */ "baaaaab" + /* 3 */ "baaaaab" + /* 4 */ "baaaaab" + /* 5 */ "baaaaab" + /* 6 */ "baaaaab" + /* 7 */ "baaaaab" + /* 8 */ "baaaaab" + /* 9 */ "baaaaab" + /* 10 */ "baaaaab" + /* 11 */ "baaaaab" + /* 12 */ "bbbbbbb" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "..cde.." + /* 1 */ ".fffff." + /* 2 */ ".fffff." + /* 3 */ ".fffff." + /* 4 */ ".fffff." + /* 5 */ ".fffff." + /* 6 */ ".fffff." + /* 7 */ ".fffff." + /* 8 */ ".fffff." + /* 9 */ ".fffff." + /* 10 */ ".fffff." + /* 11 */ ".fffff." + /* 12 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ghihg." + /* 2 */ ".h..jh." + /* 3 */ ".h...h." + /* 4 */ ".h...h." + /* 5 */ ".gk.kg." + /* 6 */ ".h...h." + /* 7 */ ".hk.kh." + /* 8 */ ".h...h." + /* 9 */ ".h.l.h." + /* 10 */ ".h...h." + /* 11 */ ".ghhhg." + /* 12 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ghnhg." + /* 2 */ ".o..jo." + /* 3 */ ".o...o." + /* 4 */ ".o...o." + /* 5 */ ".g...g." + /* 6 */ ".o...o." + /* 7 */ ".o...o." + /* 8 */ ".hp.qh." + /* 9 */ ".o.r.o." + /* 10 */ ".o...o." + /* 11 */ ".gooog." + /* 12 */ "......." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ghhhg." + /* 2 */ ".h.sjh." + /* 3 */ ".h...h." + /* 4 */ ".h...h." + /* 5 */ "tg...gt" + /* 6 */ "uh...hv" + /* 7 */ "uh...hv" + /* 8 */ "uh...hv" + /* 9 */ "uh...hv" + /* 10 */ "uh...hv" + /* 11 */ "ughhhhv" + /* 12 */ "uw...xv" + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".gyyyg." + /* 2 */ ".zhhjz." + /* 3 */ ".zhhhz." + /* 4 */ ".zhhhz." + /* 5 */ ".gyyyg." + /* 6 */ ".uh.hv." + /* 7 */ ".uh.hv." + /* 8 */ ".uh.hv." + /* 9 */ ".uh.hv." + /* 10 */ ".uh.hv." + /* 11 */ ".uhhhv." + /* 12 */ ".uw.xv." + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ghohg." + /* 2 */ ".h..jh." + /* 3 */ ".h...h." + /* 4 */ ".h.A.h." + /* 5 */ ".ghhhg." + /* 6 */ "..uhv.." + /* 7 */ "..uhv.." + /* 8 */ "..uhv.." + /* 9 */ "..uhv.." + /* 10 */ "..uhv.." + /* 11 */ "..uhv.." + /* 12 */ "..uhv.." + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ghohg." + /* 2 */ ".h..jh." + /* 3 */ ".o...o." + /* 4 */ ".h...h." + /* 5 */ ".ghhhg." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ghohg." + /* 2 */ ".h..jh." + /* 3 */ ".h...h." + /* 4 */ ".h.B.h." + /* 5 */ ".ghhhg." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 10 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".gyyyg." + /* 2 */ ".zhhjz." + /* 3 */ ".zhhhz." + /* 4 */ ".zhhhz." + /* 5 */ ".gyyyg." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 11 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".gCCCg." + /* 2 */ ".C...C." + /* 3 */ ".C...C." + /* 4 */ ".C...C." + /* 5 */ ".gCCCg." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 12 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".g...g." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ ".g...g." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 13 + /* z\x* 0123456 */ + /* 0 */ "uw...xv" + /* 1 */ "ughhhgv" + /* 2 */ "uhDDDhv" + /* 3 */ "uhDDDhv" + /* 4 */ "uhDDDhv" + /* 5 */ "uhhhhhv" + /* 6 */ "uw...xv" + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 14 + /* z\x* 0123456 */ + /* 0 */ ".uw.xv." + /* 1 */ ".uhhhv." + /* 2 */ ".uhhhv." + /* 3 */ ".uhhhv." + /* 4 */ ".uhhhv." + /* 5 */ ".uhhhv." + /* 6 */ ".uw.xv." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." + + // Level 15 + /* z\x* 0123456 */ + /* 0 */ "..uhv.." + /* 1 */ "..uhv.." + /* 2 */ "..uhv.." + /* 3 */ "..uhv.." + /* 4 */ "..uhv.." + /* 5 */ "..uhv.." + /* 6 */ "..uhv.." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ ".......", + + // Connectors: + "-1: 3, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 20, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenChurchMid + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenGranary: + // The data has been exported from the gallery Plains, area index 54, ID 105, created by Aloe_vera + { + // Size: + 7, 8, 9, // SizeX = 7, SizeY = 8, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 7, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c:170: 0\n" /* haybale */ + "d: 67: 0\n" /* stairs */ + "e: 67: 2\n" /* stairs */ + "f: 67: 1\n" /* stairs */ + "g: 4: 0\n" /* cobblestone */ + "h: 17: 0\n" /* tree */ + "i: 5: 0\n" /* wood */ + "j:170: 4\n" /* haybale */ + "k:170: 8\n" /* haybale */ + "l: 54: 2\n" /* chest */ + "m: 19: 0\n" /* sponge */ + "n: 50: 4\n" /* torch */ + "o: 53: 0\n" /* woodstairs */ + "p: 53: 5\n" /* woodstairs */ + "q: 53: 4\n" /* woodstairs */ + "r: 53: 1\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaaaaa" + /* 3 */ "aaaaaaa" + /* 4 */ "aaaaaaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" + /* 7 */ "aaaaaaa" + /* 8 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "aaaaaab" + /* 1 */ "baaaaab" + /* 2 */ "baaaaab" + /* 3 */ "baaaaab" + /* 4 */ "baaaaab" + /* 5 */ "baaaaab" + /* 6 */ "baaaaab" + /* 7 */ "baaaaab" + /* 8 */ "bbbbbbb" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "cdeeef." + /* 1 */ ".ggggg." + /* 2 */ ".ggggg." + /* 3 */ ".ggggg." + /* 4 */ ".ggggg." + /* 5 */ ".ggggg." + /* 6 */ ".ggggg." + /* 7 */ ".ggggg." + /* 8 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".h..ch." + /* 2 */ ".i...i." + /* 3 */ ".ic.ji." + /* 4 */ ".hkjkh." + /* 5 */ ".iccci." + /* 6 */ ".iklci." + /* 7 */ ".hihih." + /* 8 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ ".n...n." + /* 1 */ ".h...h." + /* 2 */ ".i...i." + /* 3 */ ".i...i." + /* 4 */ ".hj..h." + /* 5 */ ".ijkci." + /* 6 */ ".ijkki." + /* 7 */ ".hihih." + /* 8 */ "......." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "op...qr" + /* 1 */ "oiiiiir" + /* 2 */ "oi...ir" + /* 3 */ "oi...ir" + /* 4 */ "oi...ir" + /* 5 */ "oicc.ir" + /* 6 */ "oikckir" + /* 7 */ "oiiiiir" + /* 8 */ "op...qr" + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ ".op.qr." + /* 1 */ ".oiiir." + /* 2 */ ".oi.ir." + /* 3 */ ".oi.ir." + /* 4 */ ".oi.ir." + /* 5 */ ".oi.ir." + /* 6 */ ".oi.ir." + /* 7 */ ".oiiir." + /* 8 */ ".op.qr." + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "..oir.." + /* 1 */ "..oir.." + /* 2 */ "..oir.." + /* 3 */ "..oir.." + /* 4 */ "..oir.." + /* 5 */ "..oir.." + /* 6 */ "..oir.." + /* 7 */ "..oir.." + /* 8 */ "..oir..", + + // Connectors: + "-1: 3, 2, -1: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenGranary + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse10x7Library: + // The data has been exported from the gallery Plains, area index 47, ID 98, created by Aloe_vera + { + // Size: + 12, 9, 9, // SizeX = 12, SizeY = 9, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 11, 8, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 7\n" /* wooddoorblock */ + "j: 64: 5\n" /* wooddoorblock */ + "k: 53: 3\n" /* woodstairs */ + "l: 85: 0\n" /* fence */ + "m: 19: 0\n" /* sponge */ + "n: 53: 2\n" /* woodstairs */ + "o: 53: 1\n" /* woodstairs */ + "p: 53: 0\n" /* woodstairs */ + "q:102: 0\n" /* glasspane */ + "r: 64:12\n" /* wooddoorblock */ + "s: 50: 3\n" /* torch */ + "t: 72: 0\n" /* woodplate */ + "u: 53: 7\n" /* woodstairs */ + "v: 47: 0\n" /* bookshelf */ + "w: 50: 1\n" /* torch */ + "x: 50: 2\n" /* torch */ + "y: 53: 6\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "aaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaa" + + // Level 1 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "bbbbaaaabbbb" + /* 1 */ "baaaaaaaaaab" + /* 2 */ "baaaaaaaaaab" + /* 3 */ "baaaaaaaaaab" + /* 4 */ "baaaaaaaaaab" + /* 5 */ "baaaaaaaaaab" + /* 6 */ "baaaaaaaaaab" + /* 7 */ "baaaaaaaaaab" + /* 8 */ "bbbbbbbbbbbb" + + // Level 2 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "....cdde...." + /* 1 */ ".ffffffffff." + /* 2 */ ".ffffffffff." + /* 3 */ ".ffffffffff." + /* 4 */ ".ffffffffff." + /* 5 */ ".ffffffffff." + /* 6 */ ".ffffffffff." + /* 7 */ ".ffffffffff." + /* 8 */ "............" + + // Level 3 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".ghhhijhhhg." + /* 2 */ ".h........h." + /* 3 */ ".hk......kh." + /* 4 */ ".hl......lh." + /* 5 */ ".hn......nh." + /* 6 */ ".h.olpolp.h." + /* 7 */ ".ghhhhhhhhg." + /* 8 */ "............" + + // Level 4 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".gqqhrrhqqg." + /* 2 */ ".q..s..s..q." + /* 3 */ ".q........q." + /* 4 */ ".ht......th." + /* 5 */ ".q........q." + /* 6 */ ".q..t..t..q." + /* 7 */ ".gqqhqqhqqg." + /* 8 */ "............" + + // Level 5 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "nnnnnnnnnnnn" + /* 1 */ "uhhhhhhhhhhu" + /* 2 */ ".hvvvvvvvvh." + /* 3 */ ".h........h." + /* 4 */ ".hw......xh." + /* 5 */ ".h........h." + /* 6 */ ".hvvvvvvvvh." + /* 7 */ "yhhhhhhhhhhy" + /* 8 */ "kkkkkkkkkkkk" + + // Level 6 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "nnnnnnnnnnnn" + /* 2 */ "uhhhhhhhhhhu" + /* 3 */ ".hvvvvvvvvh." + /* 4 */ ".h........h." + /* 5 */ ".hvvvvvvvvh." + /* 6 */ "yhhhhhhhhhhy" + /* 7 */ "kkkkkkkkkkkk" + /* 8 */ "............" + + // Level 7 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "nnnnnnnnnnnn" + /* 3 */ "uhhhhhhhhhhu" + /* 4 */ ".h........h." + /* 5 */ "yhhhhhhhhhhy" + /* 6 */ "kkkkkkkkkkkk" + /* 7 */ "............" + /* 8 */ "............" + + // Level 8 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "nnnnnnnnnnnn" + /* 4 */ "hhhhhhhhhhhh" + /* 5 */ "kkkkkkkkkkkk" + /* 6 */ "............" + /* 7 */ "............" + /* 8 */ "............", + + // Connectors: + "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse10x7Library + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse5x5: + // The data has been exported from the gallery Plains, area index 49, ID 100, created by Aloe_vera + { + // Size: + 7, 8, 7, // SizeX = 7, SizeY = 8, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 7, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 7\n" /* wooddoorblock */ + "j: 64:12\n" /* wooddoorblock */ + "k:102: 0\n" /* glasspane */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 7\n" /* woodstairs */ + "o: 50: 3\n" /* torch */ + "p: 53: 6\n" /* woodstairs */ + "q: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaaaaa" + /* 3 */ "aaaaaaa" + /* 4 */ "aaaaaaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "bbaaabb" + /* 1 */ "baaaaab" + /* 2 */ "baaaaab" + /* 3 */ "baaaaab" + /* 4 */ "baaaaab" + /* 5 */ "baaaaab" + /* 6 */ "bbbbbbb" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "..cde.." + /* 1 */ ".fffff." + /* 2 */ ".fffff." + /* 3 */ ".fffff." + /* 4 */ ".fffff." + /* 5 */ ".fffff." + /* 6 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ghihg." + /* 2 */ ".h...h." + /* 3 */ ".h...h." + /* 4 */ ".h...h." + /* 5 */ ".ghhhg." + /* 6 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ghjhg." + /* 2 */ ".k...k." + /* 3 */ ".k...k." + /* 4 */ ".k...k." + /* 5 */ ".gkkkg." + /* 6 */ "......." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "lllllll" + /* 1 */ "nhhhhhn" + /* 2 */ ".ho.oh." + /* 3 */ ".h...h." + /* 4 */ ".h...h." + /* 5 */ "phhhhhp" + /* 6 */ "qqqqqqq" + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "lllllll" + /* 2 */ "nhhhhhn" + /* 3 */ ".h...h." + /* 4 */ "phhhhhp" + /* 5 */ "qqqqqqq" + /* 6 */ "......." + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "lllllll" + /* 3 */ "hhhhhhh" + /* 4 */ "qqqqqqq" + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "-1: 3, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse5x5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse7x5: + // The data has been exported from the gallery Plains, area index 40, ID 91, created by xoft + { + // Size: + 9, 8, 7, // SizeX = 9, SizeY = 8, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 7, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 7\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 64:12\n" /* wooddoorblock */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 7\n" /* woodstairs */ + "o: 50: 3\n" /* torch */ + "p: 53: 6\n" /* woodstairs */ + "q: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "aaaaaaaaa" + /* 1 */ "aaaaaaaaa" + /* 2 */ "aaaaaaaaa" + /* 3 */ "aaaaaaaaa" + /* 4 */ "aaaaaaaaa" + /* 5 */ "aaaaaaaaa" + /* 6 */ "aaaaaaaaa" + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "bbbaaabbb" + /* 1 */ "baaaaaaab" + /* 2 */ "baaaaaaab" + /* 3 */ "baaaaaaab" + /* 4 */ "baaaaaaab" + /* 5 */ "baaaaaaab" + /* 6 */ "bbbbbbbbb" + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "...cde..." + /* 1 */ ".fffffff." + /* 2 */ ".fffffff." + /* 3 */ ".fffffff." + /* 4 */ ".fffffff." + /* 5 */ ".fffffff." + /* 6 */ "........." + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".ghhihhg." + /* 2 */ ".h.....h." + /* 3 */ ".h.....h." + /* 4 */ ".h.....h." + /* 5 */ ".ghhhhhg." + /* 6 */ "........." + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".gjhkhjg." + /* 2 */ ".j.....j." + /* 3 */ ".j.....j." + /* 4 */ ".j.....j." + /* 5 */ ".gjjhjjg." + /* 6 */ "........." + + // Level 5 + /* z\x* 012345678 */ + /* 0 */ "lllllllll" + /* 1 */ "nghhhhhgn" + /* 2 */ ".h.o.o.h." + /* 3 */ ".h.....h." + /* 4 */ ".h.....h." + /* 5 */ "pghhhhhgp" + /* 6 */ "qqqqqqqqq" + + // Level 6 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "lllllllll" + /* 2 */ "nhhhhhhhn" + /* 3 */ ".h.....h." + /* 4 */ "phhhhhhhp" + /* 5 */ "qqqqqqqqq" + /* 6 */ "........." + + // Level 7 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "lllllllll" + /* 3 */ "hhhhhhhhh" + /* 4 */ "qqqqqqqqq" + /* 5 */ "........." + /* 6 */ ".........", + + // Connectors: + "-1: 4, 2, -1: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse7x5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse9x5: + // The data has been exported from the gallery Plains, area index 41, ID 92, created by xoft + { + // Size: + 11, 8, 7, // SizeX = 11, SizeY = 8, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 7, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 7\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 64:12\n" /* wooddoorblock */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 7\n" /* woodstairs */ + "o: 50: 3\n" /* torch */ + "p: 53: 6\n" /* woodstairs */ + "q: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "bbbbaaabbbb" + /* 1 */ "baaaaaaaaab" + /* 2 */ "baaaaaaaaab" + /* 3 */ "baaaaaaaaab" + /* 4 */ "baaaaaaaaab" + /* 5 */ "baaaaaaaaab" + /* 6 */ "bbbbbbbbbbb" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....cde...." + /* 1 */ ".fffffffff." + /* 2 */ ".fffffffff." + /* 3 */ ".fffffffff." + /* 4 */ ".fffffffff." + /* 5 */ ".fffffffff." + /* 6 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ghhhihhhg." + /* 2 */ ".h.......h." + /* 3 */ ".h.......h." + /* 4 */ ".h.......h." + /* 5 */ ".ghhhhhhhg." + /* 6 */ "..........." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".gjjhkhjjg." + /* 2 */ ".j.......j." + /* 3 */ ".j.......j." + /* 4 */ ".j.......j." + /* 5 */ ".gjjjhjjjg." + /* 6 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "lllllllllll" + /* 1 */ "nhhhhhhhhhn" + /* 2 */ ".h..o.o.hh." + /* 3 */ ".h......hh." + /* 4 */ ".h......hh." + /* 5 */ "phhhhhhhhhp" + /* 6 */ "qqqqqqqqqqq" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "lllllllllll" + /* 2 */ "nhhhhhhhhhn" + /* 3 */ ".hhhhhhhhh." + /* 4 */ "phhhhhhhhhp" + /* 5 */ "qqqqqqqqqqq" + /* 6 */ "..........." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "lllllllllll" + /* 3 */ "hhhhhhhhhhh" + /* 4 */ "qqqqqqqqqqq" + /* 5 */ "..........." + /* 6 */ "...........", + + // Connectors: + "-1: 5, 2, -1: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse9x5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse9x5: + // The data has been exported from the gallery Plains, area index 46, ID 97, created by Aloe_vera + { + // Size: + 11, 8, 7, // SizeX = 11, SizeY = 8, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 7, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 7\n" /* wooddoorblock */ + "j: 53: 3\n" /* woodstairs */ + "k: 85: 0\n" /* fence */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 1\n" /* woodstairs */ + "o: 53: 0\n" /* woodstairs */ + "p:102: 0\n" /* glasspane */ + "q: 64:12\n" /* wooddoorblock */ + "r: 50: 3\n" /* torch */ + "s: 72: 0\n" /* woodplate */ + "t: 53: 7\n" /* woodstairs */ + "u: 47: 0\n" /* bookshelf */ + "v: 50: 1\n" /* torch */ + "w: 50: 2\n" /* torch */ + "x: 53: 6\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "bbbbaaabbbb" + /* 1 */ "baaaaaaaaab" + /* 2 */ "baaaaaaaaab" + /* 3 */ "baaaaaaaaab" + /* 4 */ "baaaaaaaaab" + /* 5 */ "baaaaaaaaab" + /* 6 */ "bbbbbbbbbbb" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....cde...." + /* 1 */ ".fffffffff." + /* 2 */ ".fffffffff." + /* 3 */ ".fffffffff." + /* 4 */ ".fffffffff." + /* 5 */ ".fffffffff." + /* 6 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ghhhihhhg." + /* 2 */ ".hj.....jh." + /* 3 */ ".hk.....kh." + /* 4 */ ".hl.nko.lh." + /* 5 */ ".ghhhhhhhg." + /* 6 */ "..........." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".gpphqhppg." + /* 2 */ ".p..r.r..p." + /* 3 */ ".ps.....sp." + /* 4 */ ".p...s...p." + /* 5 */ ".gppphpppg." + /* 6 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "lllllllllll" + /* 1 */ "thhhhhhhhht" + /* 2 */ ".huuuuuuuh." + /* 3 */ ".hv.....wh." + /* 4 */ ".huuuuuuuh." + /* 5 */ "xhhhhhhhhhx" + /* 6 */ "jjjjjjjjjjj" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "lllllllllll" + /* 2 */ "thhhhhhhhht" + /* 3 */ ".h.......h." + /* 4 */ "xhhhhhhhhhx" + /* 5 */ "jjjjjjjjjjj" + /* 6 */ "..........." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "lllllllllll" + /* 3 */ "hhhhhhhhhhh" + /* 4 */ "jjjjjjjjjjj" + /* 5 */ "..........." + /* 6 */ "...........", + + // Connectors: + "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse9x5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse9x5Fence: + // The data has been exported from the gallery Plains, area index 9, ID 26, created by Aloe_vera + { + // Size: + 10, 8, 11, // SizeX = 10, SizeY = 8, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 7, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 4: 0\n" /* cobblestone */ + "d: 5: 0\n" /* wood */ + "e: 67: 2\n" /* stairs */ + "f: 43: 0\n" /* doubleslab */ + "g: 67: 0\n" /* stairs */ + "h: 67: 3\n" /* stairs */ + "i: 17: 0\n" /* tree */ + "j: 53: 1\n" /* woodstairs */ + "k: 85: 0\n" /* fence */ + "l: 53: 0\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 64: 6\n" /* wooddoorblock */ + "o: 64: 0\n" /* wooddoorblock */ + "p:102: 0\n" /* glasspane */ + "q: 72: 0\n" /* woodplate */ + "r: 64:12\n" /* wooddoorblock */ + "s: 64: 8\n" /* wooddoorblock */ + "t: 53: 5\n" /* woodstairs */ + "u: 53: 4\n" /* woodstairs */ + "v: 50: 1\n" /* torch */ + "w: 50: 2\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "aaaaaaaaaa" + /* 1 */ "aaaaaaaaaa" + /* 2 */ "aaaaaaaaaa" + /* 3 */ "aaaaaaaaaa" + /* 4 */ "aaaaaaaaaa" + /* 5 */ "aaaaaaaaaa" + /* 6 */ "aaaaaaaaaa" + /* 7 */ "aaaaaaaaaa" + /* 8 */ "aaaaaaaaaa" + /* 9 */ "aaaaaaaaaa" + /* 10 */ "aaaaaaaaaa" + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "bbbbbbbbbb" + /* 1 */ "baaaaabbbb" + /* 2 */ "baaaaabbbb" + /* 3 */ "baaaaaaaaa" + /* 4 */ "aaaaaaaaaa" + /* 5 */ "aaaaaaaaaa" + /* 6 */ "aaaaaaaaaa" + /* 7 */ "baaaaaaaaa" + /* 8 */ "baaaaaaaaa" + /* 9 */ "baaaaabbbb" + /* 10 */ "bbbbbbbbbb" + + // Level 2 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "......mmmm" + /* 1 */ ".cccccmmmm" + /* 2 */ ".cdddcmmmm" + /* 3 */ ".cdddcbbbb" + /* 4 */ "ecfffcbbbb" + /* 5 */ "gcffffbbbb" + /* 6 */ "hcfffcbbbb" + /* 7 */ ".cfffcbbbb" + /* 8 */ ".cfffcbbbb" + /* 9 */ ".cccccmmmm" + /* 10 */ "......mmmm" + + // Level 3 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "......mmmm" + /* 1 */ ".idddimmmm" + /* 2 */ ".djkldmmmm" + /* 3 */ ".d...dkkkk" + /* 4 */ ".d...d...k" + /* 5 */ ".n...o...k" + /* 6 */ ".d...d...k" + /* 7 */ ".dff.d...k" + /* 8 */ ".d...dkkkk" + /* 9 */ ".idddimmmm" + /* 10 */ "......mmmm" + + // Level 4 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "......mmmm" + /* 1 */ ".ipppimmmm" + /* 2 */ ".p.q.pmmmm" + /* 3 */ ".p...p...." + /* 4 */ ".d...d...." + /* 5 */ ".r...s...." + /* 6 */ ".d...d...." + /* 7 */ ".p...p...." + /* 8 */ ".p...p...." + /* 9 */ ".ipppimmmm" + /* 10 */ "......mmmm" + + // Level 5 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "lt...ujmmm" + /* 1 */ "lidddijmmm" + /* 2 */ "ld...djmmm" + /* 3 */ "ld...dj..." + /* 4 */ "ldv.wdj..." + /* 5 */ "ld...dj..." + /* 6 */ "ldv.wdj..." + /* 7 */ "ld...dj..." + /* 8 */ "ld...dj..." + /* 9 */ "lidddijmmm" + /* 10 */ "lt...ujmmm" + + // Level 6 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "mlt.ujmmmm" + /* 1 */ "mldddjmmmm" + /* 2 */ "mld.djmmmm" + /* 3 */ "mld.djm..." + /* 4 */ "mld.djm..." + /* 5 */ "mld.djm..." + /* 6 */ "mld.djm..." + /* 7 */ "mld.djm..." + /* 8 */ "mld.djm..." + /* 9 */ "mldddjmmmm" + /* 10 */ "mlt.ujmmmm" + + // Level 7 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "mmldjmmmmm" + /* 1 */ "mmldjmmmmm" + /* 2 */ "mmldjmmmmm" + /* 3 */ "mmldjmm..." + /* 4 */ "mmldjmm..." + /* 5 */ "mmldjmm..." + /* 6 */ "mmldjmm..." + /* 7 */ "mmldjmm..." + /* 8 */ "mmldjmm..." + /* 9 */ "mmldjmmmmm" + /* 10 */ "mmldjmmmmm", + + // Connectors: + "-1: 0, 2, 5: 4\n" /* Type -1, direction X- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse9x5Fence + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse9x7: + // The data has been exported from the gallery Plains, area index 52, ID 103, created by Aloe_vera + { + // Size: + 11, 9, 9, // SizeX = 11, SizeY = 9, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 8, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 7\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 64:12\n" /* wooddoorblock */ + "l: 53: 2\n" /* woodstairs */ + "m: 19: 0\n" /* sponge */ + "n: 53: 7\n" /* woodstairs */ + "o: 50: 3\n" /* torch */ + "p: 50: 4\n" /* torch */ + "q: 53: 6\n" /* woodstairs */ + "r: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "bbbbaaabbbb" + /* 1 */ "baaaaaaaaab" + /* 2 */ "baaaaaaaaab" + /* 3 */ "baaaaaaaaab" + /* 4 */ "baaaaaaaaab" + /* 5 */ "baaaaaaaaab" + /* 6 */ "baaaaaaaaab" + /* 7 */ "baaaaaaaaab" + /* 8 */ "bbbbbbbbbbb" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....cde...." + /* 1 */ ".fffffffff." + /* 2 */ ".fffffffff." + /* 3 */ ".fffffffff." + /* 4 */ ".fffffffff." + /* 5 */ ".fffffffff." + /* 6 */ ".fffffffff." + /* 7 */ ".fffffffff." + /* 8 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ghhhihhhg." + /* 2 */ ".h.......h." + /* 3 */ ".h.......h." + /* 4 */ ".h.......h." + /* 5 */ ".h.......h." + /* 6 */ ".h.......h." + /* 7 */ ".ghhhhhhhg." + /* 8 */ "..........." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".gjjhkhjjg." + /* 2 */ ".j.......j." + /* 3 */ ".j.......j." + /* 4 */ ".h.......h." + /* 5 */ ".j.......j." + /* 6 */ ".j.......j." + /* 7 */ ".gjjjhjjjg." + /* 8 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "lllllllllll" + /* 1 */ "nhhhhhhhhhn" + /* 2 */ ".h..o.o..h." + /* 3 */ ".h.......h." + /* 4 */ ".h.......h." + /* 5 */ ".h.......h." + /* 6 */ ".h...p...h." + /* 7 */ "qhhhhhhhhhq" + /* 8 */ "rrrrrrrrrrr" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "lllllllllll" + /* 2 */ "nhhhhhhhhhn" + /* 3 */ ".h.......h." + /* 4 */ ".h.......h." + /* 5 */ ".h.......h." + /* 6 */ "qhhhhhhhhhq" + /* 7 */ "rrrrrrrrrrr" + /* 8 */ "..........." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "lllllllllll" + /* 3 */ "nhhhhhhhhhn" + /* 4 */ ".h.......h." + /* 5 */ "qhhhhhhhhhq" + /* 6 */ "rrrrrrrrrrr" + /* 7 */ "..........." + /* 8 */ "..........." + + // Level 8 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "lllllllllll" + /* 4 */ "hhhhhhhhhhh" + /* 5 */ "rrrrrrrrrrr" + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "...........", + + // Connectors: + "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse9x7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse9x7Butcher: + // The data has been exported from the gallery Plains, area index 48, ID 99, created by Aloe_vera + { + // Size: + 11, 9, 13, // SizeX = 11, SizeY = 9, SizeZ = 13 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 8, 12, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 43: 0\n" /* doubleslab */ + "h: 17: 0\n" /* tree */ + "i: 5: 0\n" /* wood */ + "j: 64: 7\n" /* wooddoorblock */ + "k: 53: 3\n" /* woodstairs */ + "l: 85: 0\n" /* fence */ + "m: 19: 0\n" /* sponge */ + "n: 53: 2\n" /* woodstairs */ + "o:102: 0\n" /* glasspane */ + "p: 64:12\n" /* wooddoorblock */ + "q: 72: 0\n" /* woodplate */ + "r: 53: 7\n" /* woodstairs */ + "s: 50: 1\n" /* torch */ + "t: 50: 2\n" /* torch */ + "u: 53: 6\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaa" + /* 11 */ "aaaaaaaaaaa" + /* 12 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "bbbbaaabbbb" + /* 1 */ "baaaaaaaaab" + /* 2 */ "baaaaaaaaab" + /* 3 */ "baaaaaaaaab" + /* 4 */ "baaaaaaaaab" + /* 5 */ "baaaaaaaaab" + /* 6 */ "baaaaaaaaab" + /* 7 */ "baaaaaaaaab" + /* 8 */ "bbaaaaaaabb" + /* 9 */ "bbaaaaaaabb" + /* 10 */ "bbaaaaaaabb" + /* 11 */ "bbaaaaaaabb" + /* 12 */ "bbaaaaaaabb" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....cde...." + /* 1 */ ".fffffffff." + /* 2 */ ".fggggffff." + /* 3 */ ".fggggffff." + /* 4 */ ".fggggffff." + /* 5 */ ".fggggffff." + /* 6 */ ".fggggffff." + /* 7 */ ".fffffffff." + /* 8 */ "..bbbbbbb.." + /* 9 */ "mmbbbbbbbmm" + /* 10 */ "mmbbbbbbbmm" + /* 11 */ "mmbbbbbbbmm" + /* 12 */ "mmbbbbbbbmm" + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".hiiijiiih." + /* 2 */ ".i.g....ki." + /* 3 */ ".i.g....li." + /* 4 */ ".i.g....ni." + /* 5 */ ".i.......i." + /* 6 */ ".i.......i." + /* 7 */ ".hiiijiiih." + /* 8 */ "..l.....l.." + /* 9 */ "mml.....lmm" + /* 10 */ "mml.....lmm" + /* 11 */ "mml.....lmm" + /* 12 */ "mmlllllllmm" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".hooipiooh." + /* 2 */ ".o.......o." + /* 3 */ ".o......qo." + /* 4 */ ".i.......i." + /* 5 */ ".o.......o." + /* 6 */ ".o.......o." + /* 7 */ ".hooipiooh." + /* 8 */ "..........." + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "nnnnnnnnnnn" + /* 1 */ "riiiiiiiiir" + /* 2 */ ".i.......i." + /* 3 */ ".i.......i." + /* 4 */ ".is.....ti." + /* 5 */ ".i.......i." + /* 6 */ ".i.......i." + /* 7 */ "uiiiiiiiiiu" + /* 8 */ "kkkkkkkkkkk" + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "nnnnnnnnnnn" + /* 2 */ "riiiiiiiiir" + /* 3 */ ".i.......i." + /* 4 */ ".i.......i." + /* 5 */ ".i.......i." + /* 6 */ "uiiiiiiiiiu" + /* 7 */ "kkkkkkkkkkk" + /* 8 */ "..........." + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm" + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "nnnnnnnnnnn" + /* 3 */ "riiiiiiiiir" + /* 4 */ ".i.......i." + /* 5 */ "uiiiiiiiiiu" + /* 6 */ "kkkkkkkkkkk" + /* 7 */ "..........." + /* 8 */ "..........." + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm" + + // Level 8 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "nnnnnnnnnnn" + /* 4 */ "iiiiiiiiiii" + /* 5 */ "kkkkkkkkkkk" + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "..........." + /* 9 */ "mm.......mm" + /* 10 */ "mm.......mm" + /* 11 */ "mm.......mm" + /* 12 */ "mm.......mm", + + // Connectors: + "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse9x7Butcher + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse9x7DoubleDoor: + // The data has been exported from the gallery Plains, area index 38, ID 87, created by Aloe_vera + { + // Size: + 11, 9, 9, // SizeX = 11, SizeY = 9, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 8, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 67: 3\n" /* stairs */ + "h: 17: 0\n" /* tree */ + "i: 5: 0\n" /* wood */ + "j: 64: 7\n" /* wooddoorblock */ + "k:102: 0\n" /* glasspane */ + "l: 64:12\n" /* wooddoorblock */ + "m: 19: 0\n" /* sponge */ + "n: 53: 2\n" /* woodstairs */ + "o: 53: 7\n" /* woodstairs */ + "p: 17: 4\n" /* tree */ + "q: 17: 8\n" /* tree */ + "r: 50: 3\n" /* torch */ + "s: 50: 4\n" /* torch */ + "t: 53: 6\n" /* woodstairs */ + "u: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "bbbbaaabbbb" + /* 1 */ "baaaaaaaaab" + /* 2 */ "baaaaaaaaab" + /* 3 */ "baaaaaaaaab" + /* 4 */ "baaaaaaaaab" + /* 5 */ "baaaaaaaaab" + /* 6 */ "baaaaaaaaab" + /* 7 */ "baaaaaaaaab" + /* 8 */ "bbbbaaabbbb" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....cde...." + /* 1 */ ".fffffffff." + /* 2 */ ".fffffffff." + /* 3 */ ".fffffffff." + /* 4 */ ".fffffffff." + /* 5 */ ".fffffffff." + /* 6 */ ".fffffffff." + /* 7 */ ".fffffffff." + /* 8 */ "....cge...." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".hiihjhiih." + /* 2 */ ".i.......i." + /* 3 */ ".i.......i." + /* 4 */ ".h.......h." + /* 5 */ ".i.......i." + /* 6 */ ".i.......i." + /* 7 */ ".hiihjhiih." + /* 8 */ "..........." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".hkkhlhkkh." + /* 2 */ ".k.......k." + /* 3 */ ".k.......k." + /* 4 */ ".h.......h." + /* 5 */ ".k.......k." + /* 6 */ ".k.......k." + /* 7 */ ".hkkhlhkkh." + /* 8 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "nnnnnnnnnnn" + /* 1 */ "ohpppppppho" + /* 2 */ ".q..r.r..q." + /* 3 */ ".q.......q." + /* 4 */ ".q.......q." + /* 5 */ ".q.......q." + /* 6 */ ".q..s.s..q." + /* 7 */ "thpppppppht" + /* 8 */ "uuuuuuuuuuu" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "nnnnnnnnnnn" + /* 2 */ "oiiiiiiiiio" + /* 3 */ ".i.......i." + /* 4 */ ".i.......i." + /* 5 */ ".i.......i." + /* 6 */ "tiiiiiiiiit" + /* 7 */ "uuuuuuuuuuu" + /* 8 */ "..........." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "nnnnnnnnnnn" + /* 3 */ "oiiiiiiiiio" + /* 4 */ ".i.......i." + /* 5 */ "tiiiiiiiiit" + /* 6 */ "uuuuuuuuuuu" + /* 7 */ "..........." + /* 8 */ "..........." + + // Level 8 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "nnnnnnnnnnn" + /* 4 */ "iiiiiiiiiii" + /* 5 */ "uuuuuuuuuuu" + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "...........", + + // Connectors: + "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouse9x7DoubleDoor + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouseL13x14: + // The data has been exported from the gallery Plains, area index 39, ID 90, created by STR_Warrior + { + // Size: + 15, 10, 16, // SizeX = 15, SizeY = 10, SizeZ = 16 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 9, 15, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A: 50: 4\n" /* torch */ + "B: 50: 2\n" /* torch */ + "C: 53: 7\n" /* woodstairs */ + "D: 53: 4\n" /* woodstairs */ + "E: 53: 5\n" /* woodstairs */ + "F: 53: 6\n" /* woodstairs */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 43: 0\n" /* doubleslab */ + "h: 17: 0\n" /* tree */ + "i: 5: 0\n" /* wood */ + "j: 64: 7\n" /* wooddoorblock */ + "k: 96: 8\n" /* trapdoor */ + "l: 61: 2\n" /* furnace */ + "m: 19: 0\n" /* sponge */ + "n: 53: 3\n" /* woodstairs */ + "o: 85: 0\n" /* fence */ + "p: 53: 2\n" /* woodstairs */ + "q: 53: 1\n" /* woodstairs */ + "r: 53: 0\n" /* woodstairs */ + "s: 47: 0\n" /* bookshelf */ + "t:102: 0\n" /* glasspane */ + "u: 64:12\n" /* wooddoorblock */ + "v: 72: 0\n" /* woodplate */ + "w: 17: 4\n" /* tree */ + "x: 17: 8\n" /* tree */ + "y: 50: 3\n" /* torch */ + "z: 50: 1\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "aaaaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaaaaa" + /* 8 */ "mmmmmmmmaaaaaaa" + /* 9 */ "mmmmmmmmaaaaaaa" + /* 10 */ "mmmmmmmmaaaaaaa" + /* 11 */ "mmmmmmmmaaaaaaa" + /* 12 */ "mmmmmmmmaaaaaaa" + /* 13 */ "mmmmmmmmaaaaaaa" + /* 14 */ "mmmmmmmmaaaaaaa" + /* 15 */ "mmmmmmmmaaaaaaa" + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "bbbbbbaaabbbbbb" + /* 1 */ "baaaaaaaaaaaaab" + /* 2 */ "baaaaaaaaaaaaab" + /* 3 */ "baaaaaaaaaaaaab" + /* 4 */ "baaaaaaaaaaaaab" + /* 5 */ "baaaaaaaaaaaaab" + /* 6 */ "baaaaaaaaaaaaab" + /* 7 */ "baaaaaaaaaaaaab" + /* 8 */ "mmmmmmmmaaaaaab" + /* 9 */ "mmmmmmmmaaaaaab" + /* 10 */ "mmmmmmmmaaaaaab" + /* 11 */ "mmmmmmmmaaaaaab" + /* 12 */ "mmmmmmmmaaaaaab" + /* 13 */ "mmmmmmmmaaaaaab" + /* 14 */ "mmmmmmmmaaaaaab" + /* 15 */ "mmmmmmmmbbbbbbb" + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "......cde......" + /* 1 */ ".fffffffffffff." + /* 2 */ ".fggggffffffff." + /* 3 */ ".fggggffffffff." + /* 4 */ ".fffffffffffff." + /* 5 */ ".fffffffffffff." + /* 6 */ ".fffffffffffff." + /* 7 */ "mfffffffffffff." + /* 8 */ "mmmmmmmmffffff." + /* 9 */ "mmmmmmmmffffff." + /* 10 */ "mmmmmmmmffffff." + /* 11 */ "mmmmmmmmffffff." + /* 12 */ "mmmmmmmmffffff." + /* 13 */ "mmmmmmmmffffff." + /* 14 */ "mmmmmmmmffffff." + /* 15 */ "mmmmmmmm......." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".hiiiihjhiiiih." + /* 2 */ ".i...k.......i." + /* 3 */ ".ilggg......ni." + /* 4 */ ".h..........oi." + /* 5 */ ".i..........pi." + /* 6 */ ".i.qor..qo...i." + /* 7 */ "mhiiiiiihp...h." + /* 8 */ "mmmmmmmmi....i." + /* 9 */ "mmmmmmmmin...i." + /* 10 */ "mmmmmmmmio..ni." + /* 11 */ "mmmmmmmmip..oi." + /* 12 */ "mmmmmmmmi...pi." + /* 13 */ "mmmmmmmmis..si." + /* 14 */ "mmmmmmmmhiiiih." + /* 15 */ "mmmmmmmm......." + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".hittihuhittih." + /* 2 */ ".i...........i." + /* 3 */ ".i...........t." + /* 4 */ ".h..........vt." + /* 5 */ ".i...........t." + /* 6 */ ".i..v....v...i." + /* 7 */ "mhittttih....h." + /* 8 */ "mmmmmmmmi....i." + /* 9 */ "mmmmmmmmt....t." + /* 10 */ "mmmmmmmmtv...t." + /* 11 */ "mmmmmmmmt...vt." + /* 12 */ "mmmmmmmmt....t." + /* 13 */ "mmmmmmmmis..si." + /* 14 */ "mmmmmmmmhittih." + /* 15 */ "mmmmmmmm......." + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".hwwwwwwwwwwwh." + /* 2 */ ".x....y.y....x." + /* 3 */ ".x...........x." + /* 4 */ ".xz..........x." + /* 5 */ ".x...........x." + /* 6 */ ".x......A....x." + /* 7 */ "mhwwwwwwhz..Bx." + /* 8 */ "mmmmmmmmx....x." + /* 9 */ "mmmmmmmmx....x." + /* 10 */ "mmmmmmmmx....x." + /* 11 */ "mmmmmmmmx....x." + /* 12 */ "mmmmmmmmx....x." + /* 13 */ "mmmmmmmmx.AA.x." + /* 14 */ "mmmmmmmmhwwwwh." + /* 15 */ "mmmmmmmm......." + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "ppppppppppppppq" + /* 1 */ "riiiiiiiiiiiiiq" + /* 2 */ "riCCCCCCCCCCDiq" + /* 3 */ "riE.........Diq" + /* 4 */ "riE.........Diq" + /* 5 */ "riE.........Diq" + /* 6 */ "riEFFFFFFF..Diq" + /* 7 */ "riiiiiiiiE..Diq" + /* 8 */ "rnnnnnnriE..Diq" + /* 9 */ "mmmmmmmriE..Diq" + /* 10 */ "mmmmmmmriE..Diq" + /* 11 */ "mmmmmmmriE..Diq" + /* 12 */ "mmmmmmmriE..Diq" + /* 13 */ "mmmmmmmriEFFDiq" + /* 14 */ "mmmmmmmriiiiiiq" + /* 15 */ "mmmmmmmrnnnnnnn" + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "mmmmmmmmmmmmmmm" + /* 1 */ "mrpppppppppppqm" + /* 2 */ "mriiiiiiiiiiiqm" + /* 3 */ "mriiiiiiiiiiiqm" + /* 4 */ "mriiiiiiiiiiiqm" + /* 5 */ "mriiiiiiiiiiiqm" + /* 6 */ "mriiiiiiiiiiiqm" + /* 7 */ "mrnnnnnnniiiiqm" + /* 8 */ "mmmmmmmmriiiiqm" + /* 9 */ "mmmmmmmmriiiiqm" + /* 10 */ "mmmmmmmmriiiiqm" + /* 11 */ "mmmmmmmmriiiiqm" + /* 12 */ "mmmmmmmmriiiiqm" + /* 13 */ "mmmmmmmmriiiiqm" + /* 14 */ "mmmmmmmmnnnnnqm" + /* 15 */ "mmmmmmmmmmmmmmm" + + // Level 8 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "mmmmmmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmmmmmm" + /* 2 */ "mmpppppppppppmm" + /* 3 */ "mmriiiiiiiiiqmm" + /* 4 */ "mmriiiiiiiiiqmm" + /* 5 */ "mmriiiiiiiiiqmm" + /* 6 */ "mmnnnnnnnniiqmm" + /* 7 */ "mmmmmmmmmriiqmm" + /* 8 */ "mmmmmmmmmriiqmm" + /* 9 */ "mmmmmmmmmriiqmm" + /* 10 */ "mmmmmmmmmriiqmm" + /* 11 */ "mmmmmmmmmriiqmm" + /* 12 */ "mmmmmmmmmriiqmm" + /* 13 */ "mmmmmmmmmnnnqmm" + /* 14 */ "mmmmmmmmmmmmmmm" + /* 15 */ "mmmmmmmmmmmmmmm" + + // Level 9 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "mmmmmmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmmmmmm" + /* 2 */ "mmmmmmmmmmmmmmm" + /* 3 */ "mmmrpppppppqmmm" + /* 4 */ "mmmriiiiiiiqmmm" + /* 5 */ "mmmrnnnnnnrqmmm" + /* 6 */ "mmmmmmmmmmrqmmm" + /* 7 */ "mmmmmmmmmmrqmmm" + /* 8 */ "mmmmmmmmmmrqmmm" + /* 9 */ "mmmmmmmmmmrqmmm" + /* 10 */ "mmmmmmmmmmrqmmm" + /* 11 */ "mmmmmmmmmmrqmmm" + /* 12 */ "mmmmmmmmmmrnmmm" + /* 13 */ "mmmmmmmmmmmmmmm" + /* 14 */ "mmmmmmmmmmmmmmm" + /* 15 */ "mmmmmmmmmmmmmmm", + + // Connectors: + "-1: 7, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenHouseL13x14 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouseL14x14: // The data has been exported from the gallery Plains, area index 0, ID 4, created by Aloe_vera { // Size: @@ -1441,7 +3064,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 15 */ "mmmmmmmmmmren...", // Connectors: - "-1: 9, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 9, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1460,609 +3083,25 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, - }, // PlainsVillage_4 + }, // WoodenHouseL14x14 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_60: - // The data has been exported from the gallery Plains, area index 17, ID 60, created by Aloe_vera + // WoodenHouseL9x9: + // The data has been exported from the gallery Plains, area index 42, ID 93, created by xoft { // Size: - 10, 2, 7, // SizeX = 10, SizeY = 2, SizeZ = 7 + 11, 8, 11, // SizeX = 11, SizeY = 8, SizeZ = 11 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 9, 1, 6, // MaxX, MaxY, MaxZ + 10, 7, 10, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 17: 0\n" /* tree */ - "b: 60: 7\n" /* tilleddirt */ - "c: 8: 0\n" /* water */ - "d: 59: 7\n" /* crops */ - "m: 19: 0\n" /* sponge */, - - // Block data: - // Level 0 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "aaaaaaaaaa" - /* 1 */ "abbbbbbbba" - /* 2 */ "abbbbbbbba" - /* 3 */ "acccccccca" - /* 4 */ "abbbbbbbba" - /* 5 */ "abbbbbbbba" - /* 6 */ "aaaaaaaaaa" - - // Level 1 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ ".........." - /* 1 */ ".dddddddd." - /* 2 */ ".dddddddd." - /* 3 */ ".........." - /* 4 */ ".dddddddd." - /* 5 */ ".dddddddd." - /* 6 */ "..........", - - // Connectors: - "-1: 9, 0, 3: 5\n" /* Type -1, direction X+ */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_60 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_66: - // The data has been exported from the gallery Plains, area index 23, ID 66, created by xoft - { - // Size: - 12, 7, 7, // SizeX = 12, SizeY = 7, SizeZ = 7 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 11, 6, 6, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 2: 0\n" /* grass */ - "b: 3: 0\n" /* dirt */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 64: 7\n" /* wooddoorblock */ - "h: 53: 3\n" /* woodstairs */ - "i: 53: 1\n" /* woodstairs */ - "j: 85: 0\n" /* fence */ - "k: 53: 0\n" /* woodstairs */ - "l: 53: 2\n" /* woodstairs */ - "m: 19: 0\n" /* sponge */ - "n:102: 0\n" /* glasspane */ - "o: 64:12\n" /* wooddoorblock */ - "p: 50: 3\n" /* torch */ - "q: 72: 0\n" /* woodplate */ - "r: 50: 4\n" /* torch */ - "s: 53: 7\n" /* woodstairs */ - "t: 47: 0\n" /* bookshelf */ - "u: 50: 1\n" /* torch */ - "v: 50: 2\n" /* torch */ - "w: 53: 6\n" /* woodstairs */ - "x: 5: 0\n" /* wood */, - - // Block data: - // Level 0 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "aaaaaaabbbaa" - /* 1 */ "abbbbbbbbbba" - /* 2 */ "abbbbbbbbbba" - /* 3 */ "abbbbbbbbbba" - /* 4 */ "abbbbbbbbbba" - /* 5 */ "abbbbbbbbbba" - /* 6 */ "aaaaaaaaaaaa" - - // Level 1 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ ".......cde.." - /* 1 */ ".ffffffffff." - /* 2 */ ".ffffffffff." - /* 3 */ ".ffffffffff." - /* 4 */ ".ffffffffff." - /* 5 */ ".ffffffffff." - /* 6 */ "............" - - // Level 2 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".fffffffgff." - /* 2 */ ".fh.ijk...f." - /* 3 */ ".fj.......f." - /* 4 */ ".fl.ijkijkf." - /* 5 */ ".ffffffffff." - /* 6 */ "............" - - // Level 3 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".fnnfnnfoff." - /* 2 */ ".n..pq.p.pn." - /* 3 */ ".nq.......n." - /* 4 */ ".n..rq.rq.n." - /* 5 */ ".fnnfnnfnnf." - /* 6 */ "............" - - // Level 4 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "llllllllllll" - /* 1 */ "sffffffffffs" - /* 2 */ ".fttttttttf." - /* 3 */ ".fu......vf." - /* 4 */ ".fttttttttf." - /* 5 */ "wffffffffffw" - /* 6 */ "hhhhhhhhhhhh" - - // Level 5 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "llllllllllll" - /* 2 */ "sxxxxxxxxxxs" - /* 3 */ ".xxxxxxxxxx." - /* 4 */ "wxxxxxxxxxxw" - /* 5 */ "hhhhhhhhhhhh" - /* 6 */ "............" - - // Level 6 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "............" - /* 2 */ "llllllllllll" - /* 3 */ "xxxxxxxxxxxx" - /* 4 */ "hhhhhhhhhhhh" - /* 5 */ "............" - /* 6 */ "............", - - // Connectors: - "-1: 8, 1, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_66 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_87: - // The data has been exported from the gallery Plains, area index 38, ID 87, created by Aloe_vera - { - // Size: - 11, 7, 9, // SizeX = 11, SizeY = 7, SizeZ = 9 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 6, 8, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 67: 3\n" /* stairs */ - "f: 17: 0\n" /* tree */ - "g: 5: 0\n" /* wood */ - "h: 64: 7\n" /* wooddoorblock */ - "i:102: 0\n" /* glasspane */ - "j: 64:12\n" /* wooddoorblock */ - "k: 53: 2\n" /* woodstairs */ - "l: 53: 7\n" /* woodstairs */ - "m: 19: 0\n" /* sponge */ - "n: 17: 4\n" /* tree */ - "o: 17: 8\n" /* tree */ - "p: 50: 3\n" /* torch */ - "q: 50: 4\n" /* torch */ - "r: 53: 6\n" /* woodstairs */ - "s: 53: 3\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "....abc...." - /* 1 */ ".ddddddddd." - /* 2 */ ".ddddddddd." - /* 3 */ ".ddddddddd." - /* 4 */ ".ddddddddd." - /* 5 */ ".ddddddddd." - /* 6 */ ".ddddddddd." - /* 7 */ ".ddddddddd." - /* 8 */ "....aec...." - - // Level 1 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".fggfhfggf." - /* 2 */ ".g.......g." - /* 3 */ ".g.......g." - /* 4 */ ".f.......f." - /* 5 */ ".g.......g." - /* 6 */ ".g.......g." - /* 7 */ ".fggfhfggf." - /* 8 */ "..........." - - // Level 2 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".fiifjfiif." - /* 2 */ ".i.......i." - /* 3 */ ".i.......i." - /* 4 */ ".f.......f." - /* 5 */ ".i.......i." - /* 6 */ ".i.......i." - /* 7 */ ".fiifjfiif." - /* 8 */ "..........." - - // Level 3 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "kkkkkkkkkkk" - /* 1 */ "lfnnnnnnnfl" - /* 2 */ ".o..p.p..o." - /* 3 */ ".o.......o." - /* 4 */ ".o.......o." - /* 5 */ ".o.......o." - /* 6 */ ".o..q.q..o." - /* 7 */ "rfnnnnnnnfr" - /* 8 */ "sssssssssss" - - // Level 4 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "kkkkkkkkkkk" - /* 2 */ "lgggggggggl" - /* 3 */ ".g.......g." - /* 4 */ ".g.......g." - /* 5 */ ".g.......g." - /* 6 */ "rgggggggggr" - /* 7 */ "sssssssssss" - /* 8 */ "..........." - - // Level 5 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "kkkkkkkkkkk" - /* 3 */ "lgggggggggl" - /* 4 */ ".g.......g." - /* 5 */ "rgggggggggr" - /* 6 */ "sssssssssss" - /* 7 */ "..........." - /* 8 */ "..........." - - // Level 6 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "..........." - /* 3 */ "kkkkkkkkkkk" - /* 4 */ "ggggggggggg" - /* 5 */ "sssssssssss" - /* 6 */ "..........." - /* 7 */ "..........." - /* 8 */ "...........", - - // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_87 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_90: - // The data has been exported from the gallery Plains, area index 39, ID 90, created by STR_Warrior - { - // Size: - 15, 8, 16, // SizeX = 15, SizeY = 8, SizeZ = 16 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 14, 7, 15, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "A: 53: 7\n" /* woodstairs */ - "B: 53: 4\n" /* woodstairs */ - "C: 53: 5\n" /* woodstairs */ - "D: 53: 6\n" /* woodstairs */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 43: 0\n" /* doubleslab */ - "f: 17: 0\n" /* tree */ - "g: 5: 0\n" /* wood */ - "h: 64: 7\n" /* wooddoorblock */ - "i: 96: 8\n" /* trapdoor */ - "j: 61: 2\n" /* furnace */ - "k: 53: 3\n" /* woodstairs */ - "l: 85: 0\n" /* fence */ - "m: 19: 0\n" /* sponge */ - "n: 53: 2\n" /* woodstairs */ - "o: 53: 1\n" /* woodstairs */ - "p: 53: 0\n" /* woodstairs */ - "q: 47: 0\n" /* bookshelf */ - "r:102: 0\n" /* glasspane */ - "s: 64:12\n" /* wooddoorblock */ - "t: 72: 0\n" /* woodplate */ - "u: 17: 4\n" /* tree */ - "v: 17: 8\n" /* tree */ - "w: 50: 3\n" /* torch */ - "x: 50: 1\n" /* torch */ - "y: 50: 4\n" /* torch */ - "z: 50: 2\n" /* torch */, - - // Block data: - // Level 0 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "......abc......" - /* 1 */ ".ddddddddddddd." - /* 2 */ ".deeeedddddddd." - /* 3 */ ".deeeedddddddd." - /* 4 */ ".ddddddddddddd." - /* 5 */ ".ddddddddddddd." - /* 6 */ ".ddddddddddddd." - /* 7 */ "mddddddddddddd." - /* 8 */ "mmmmmmmmdddddd." - /* 9 */ "mmmmmmmmdddddd." - /* 10 */ "mmmmmmmmdddddd." - /* 11 */ "mmmmmmmmdddddd." - /* 12 */ "mmmmmmmmdddddd." - /* 13 */ "mmmmmmmmdddddd." - /* 14 */ "mmmmmmmmdddddd." - /* 15 */ "mmmmmmmm......." - - // Level 1 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".fggggfhfggggf." - /* 2 */ ".g...i.......g." - /* 3 */ ".gjeee......kg." - /* 4 */ ".f..........lg." - /* 5 */ ".g..........ng." - /* 6 */ ".g.olp..ol...g." - /* 7 */ "mfggggggfn...f." - /* 8 */ "mmmmmmmmg....g." - /* 9 */ "mmmmmmmmgk...g." - /* 10 */ "mmmmmmmmgl..kg." - /* 11 */ "mmmmmmmmgn..lg." - /* 12 */ "mmmmmmmmg...ng." - /* 13 */ "mmmmmmmmgq..qg." - /* 14 */ "mmmmmmmmfggggf." - /* 15 */ "mmmmmmmm......." - - // Level 2 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".fgrrgfsfgrrgf." - /* 2 */ ".g...........g." - /* 3 */ ".g...........r." - /* 4 */ ".f..........tr." - /* 5 */ ".g...........r." - /* 6 */ ".g..t....t...g." - /* 7 */ "mfgrrrrgf....f." - /* 8 */ "mmmmmmmmg....g." - /* 9 */ "mmmmmmmmr....r." - /* 10 */ "mmmmmmmmrt...r." - /* 11 */ "mmmmmmmmr...tr." - /* 12 */ "mmmmmmmmr....r." - /* 13 */ "mmmmmmmmgq..qg." - /* 14 */ "mmmmmmmmfgrrgf." - /* 15 */ "mmmmmmmm......." - - // Level 3 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".fuuuuuuuuuuuf." - /* 2 */ ".v....w.w....v." - /* 3 */ ".v...........v." - /* 4 */ ".vx..........v." - /* 5 */ ".v...........v." - /* 6 */ ".v......y....v." - /* 7 */ "mfuuuuuufx..zv." - /* 8 */ "mmmmmmmmv....v." - /* 9 */ "mmmmmmmmv....v." - /* 10 */ "mmmmmmmmv....v." - /* 11 */ "mmmmmmmmv....v." - /* 12 */ "mmmmmmmmv....v." - /* 13 */ "mmmmmmmmv.yy.v." - /* 14 */ "mmmmmmmmfuuuuf." - /* 15 */ "mmmmmmmm......." - - // Level 4 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "nnnnnnnnnnnnnno" - /* 1 */ "pgggggggggggggo" - /* 2 */ "pgAAAAAAAAAABgo" - /* 3 */ "pgC.........Bgo" - /* 4 */ "pgC.........Bgo" - /* 5 */ "pgC.........Bgo" - /* 6 */ "pgCDDDDDDD..Bgo" - /* 7 */ "pggggggggC..Bgo" - /* 8 */ "pkkkkkkpgC..Bgo" - /* 9 */ "mmmmmmmpgC..Bgo" - /* 10 */ "mmmmmmmpgC..Bgo" - /* 11 */ "mmmmmmmpgC..Bgo" - /* 12 */ "mmmmmmmpgC..Bgo" - /* 13 */ "mmmmmmmpgCDDBgo" - /* 14 */ "mmmmmmmpggggggo" - /* 15 */ "mmmmmmmpkkkkkkk" - - // Level 5 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "mmmmmmmmmmmmmmm" - /* 1 */ "mpnnnnnnnnnnnom" - /* 2 */ "mpgggggggggggom" - /* 3 */ "mpgggggggggggom" - /* 4 */ "mpgggggggggggom" - /* 5 */ "mpgggggggggggom" - /* 6 */ "mpgggggggggggom" - /* 7 */ "mpkkkkkkkggggom" - /* 8 */ "mmmmmmmmpggggom" - /* 9 */ "mmmmmmmmpggggom" - /* 10 */ "mmmmmmmmpggggom" - /* 11 */ "mmmmmmmmpggggom" - /* 12 */ "mmmmmmmmpggggom" - /* 13 */ "mmmmmmmmpggggom" - /* 14 */ "mmmmmmmmkkkkkom" - /* 15 */ "mmmmmmmmmmmmmmm" - - // Level 6 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "mmmmmmmmmmmmmmm" - /* 1 */ "mmmmmmmmmmmmmmm" - /* 2 */ "mmnnnnnnnnnnnmm" - /* 3 */ "mmpgggggggggomm" - /* 4 */ "mmpgggggggggomm" - /* 5 */ "mmpgggggggggomm" - /* 6 */ "mmkkkkkkkkggomm" - /* 7 */ "mmmmmmmmmpggomm" - /* 8 */ "mmmmmmmmmpggomm" - /* 9 */ "mmmmmmmmmpggomm" - /* 10 */ "mmmmmmmmmpggomm" - /* 11 */ "mmmmmmmmmpggomm" - /* 12 */ "mmmmmmmmmpggomm" - /* 13 */ "mmmmmmmmmkkkomm" - /* 14 */ "mmmmmmmmmmmmmmm" - /* 15 */ "mmmmmmmmmmmmmmm" - - // Level 7 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "mmmmmmmmmmmmmmm" - /* 1 */ "mmmmmmmmmmmmmmm" - /* 2 */ "mmmmmmmmmmmmmmm" - /* 3 */ "mmmpnnnnnnnommm" - /* 4 */ "mmmpgggggggommm" - /* 5 */ "mmmpkkkkkkpommm" - /* 6 */ "mmmmmmmmmmpommm" - /* 7 */ "mmmmmmmmmmpommm" - /* 8 */ "mmmmmmmmmmpommm" - /* 9 */ "mmmmmmmmmmpommm" - /* 10 */ "mmmmmmmmmmpommm" - /* 11 */ "mmmmmmmmmmpommm" - /* 12 */ "mmmmmmmmmmpkmmm" - /* 13 */ "mmmmmmmmmmmmmmm" - /* 14 */ "mmmmmmmmmmmmmmm" - /* 15 */ "mmmmmmmmmmmmmmm", - - // Connectors: - "-1: 7, 0, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_90 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_91: - // The data has been exported from the gallery Plains, area index 40, ID 91, created by xoft - { - // Size: - 9, 7, 7, // SizeX = 9, SizeY = 7, SizeZ = 7 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 8, 6, 6, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 2: 0\n" /* grass */ - "b: 3: 0\n" /* dirt */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ "c: 67: 0\n" /* stairs */ "d: 67: 2\n" /* stairs */ "e: 67: 1\n" /* stairs */ @@ -2075,203 +3114,140 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "l: 53: 2\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ "n: 53: 7\n" /* woodstairs */ - "o: 50: 3\n" /* torch */ - "p: 53: 6\n" /* woodstairs */ - "q: 53: 3\n" /* woodstairs */, + "o: 53: 1\n" /* woodstairs */ + "p: 50: 3\n" /* torch */ + "q: 50: 4\n" /* torch */ + "r: 53: 6\n" /* woodstairs */ + "s: 50: 1\n" /* torch */ + "t: 50: 2\n" /* torch */ + "u: 53: 3\n" /* woodstairs */ + "v: 53: 0\n" /* woodstairs */ + "w: 53: 5\n" /* woodstairs */ + "x: 53: 4\n" /* woodstairs */, // Block data: // Level 0 - /* z\x* 012345678 */ - /* 0 */ "aaabbbaaa" - /* 1 */ "abbbbbbba" - /* 2 */ "abbbbbbba" - /* 3 */ "abbbbbbba" - /* 4 */ "abbbbbbba" - /* 5 */ "abbbbbbba" - /* 6 */ "aaaaaaaaa" + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaa" // Level 1 - /* z\x* 012345678 */ - /* 0 */ "...cde..." - /* 1 */ ".fffffff." - /* 2 */ ".fffffff." - /* 3 */ ".fffffff." - /* 4 */ ".fffffff." - /* 5 */ ".fffffff." - /* 6 */ "........." + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "bbbbaaabbbb" + /* 1 */ "baaaaaaaaab" + /* 2 */ "baaaaaaaaab" + /* 3 */ "baaaaaaaaab" + /* 4 */ "baaaaaaaaab" + /* 5 */ "baaaaaaaaab" + /* 6 */ "bbbbbaaaaab" + /* 7 */ "bbbbbaaaaab" + /* 8 */ "bbbbbaaaaab" + /* 9 */ "bbbbbaaaaab" + /* 10 */ "bbbbbbbbbbb" // Level 2 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ ".ghhihhg." - /* 2 */ ".h.....h." - /* 3 */ ".h.....h." - /* 4 */ ".h.....h." - /* 5 */ ".ghhhhhg." - /* 6 */ "........." + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....cde...." + /* 1 */ ".fffffffff." + /* 2 */ ".fffffffff." + /* 3 */ ".fffffffff." + /* 4 */ ".fffffffff." + /* 5 */ ".fffffffff." + /* 6 */ ".....fffff." + /* 7 */ "mmmm.fffff." + /* 8 */ "mmmm.fffff." + /* 9 */ "mmmm.fffff." + /* 10 */ "mmmm......." // Level 3 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ ".gjhkhjg." - /* 2 */ ".j.....j." - /* 3 */ ".j.....j." - /* 4 */ ".j.....j." - /* 5 */ ".gjjhjjg." - /* 6 */ "........." - - // Level 4 - /* z\x* 012345678 */ - /* 0 */ "lllllllll" - /* 1 */ "nghhhhhgn" - /* 2 */ ".h.o.o.h." - /* 3 */ ".h.....h." - /* 4 */ ".h.....h." - /* 5 */ "pghhhhhgp" - /* 6 */ "qqqqqqqqq" - - // Level 5 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ "lllllllll" - /* 2 */ "nhhhhhhhn" - /* 3 */ ".h.....h." - /* 4 */ "phhhhhhhp" - /* 5 */ "qqqqqqqqq" - /* 6 */ "........." - - // Level 6 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ "........." - /* 2 */ "lllllllll" - /* 3 */ "hhhhhhhhh" - /* 4 */ "qqqqqqqqq" - /* 5 */ "........." - /* 6 */ ".........", - - // Connectors: - "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_91 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_92: - // The data has been exported from the gallery Plains, area index 41, ID 92, created by xoft - { - // Size: - 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 5, 6, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 64: 7\n" /* wooddoorblock */ - "h:102: 0\n" /* glasspane */ - "i: 64:12\n" /* wooddoorblock */ - "j: 53: 2\n" /* woodstairs */ - "k: 53: 7\n" /* woodstairs */ - "l: 50: 3\n" /* torch */ - "m: 19: 0\n" /* sponge */ - "n: 53: 6\n" /* woodstairs */ - "o: 53: 3\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "....abc...." - /* 1 */ ".ddddddddd." - /* 2 */ ".ddddddddd." - /* 3 */ ".ddddddddd." - /* 4 */ ".ddddddddd." - /* 5 */ ".ddddddddd." - /* 6 */ "..........." - - // Level 1 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ ".efffgfffe." - /* 2 */ ".f.......f." - /* 3 */ ".f.......f." - /* 4 */ ".f.......f." - /* 5 */ ".efffffffe." - /* 6 */ "..........." - - // Level 2 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".ehhfifhhe." + /* 1 */ ".ghhhihhhg." /* 2 */ ".h.......h." /* 3 */ ".h.......h." /* 4 */ ".h.......h." - /* 5 */ ".ehhhfhhhe." - /* 6 */ "..........." - - // Level 3 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "jjjjjjjjjjj" - /* 1 */ "kfffffffffk" - /* 2 */ ".f..l.l.ff." - /* 3 */ ".f......ff." - /* 4 */ ".f......ff." - /* 5 */ "nfffffffffn" - /* 6 */ "ooooooooooo" + /* 5 */ ".ghhhg...h." + /* 6 */ ".....h...h." + /* 7 */ "mmmm.h...h." + /* 8 */ "mmmm.h...h." + /* 9 */ "mmmm.ghhhg." + /* 10 */ "mmmm......." // Level 4 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ "jjjjjjjjjjj" - /* 2 */ "kfffffffffk" - /* 3 */ ".fffffffff." - /* 4 */ "nfffffffffn" - /* 5 */ "ooooooooooo" - /* 6 */ "..........." + /* 1 */ ".gjjhkhjjg." + /* 2 */ ".j.......j." + /* 3 */ ".j.......j." + /* 4 */ ".j.......j." + /* 5 */ ".gjjjg...h." + /* 6 */ ".....j...j." + /* 7 */ "mmmm.j...j." + /* 8 */ "mmmm.j...j." + /* 9 */ "mmmm.gjjjg." + /* 10 */ "mmmm......." // Level 5 /* z\x* 1 */ /* * 01234567890 */ + /* 0 */ "lllllllllll" + /* 1 */ "nhhhhhhhhho" + /* 2 */ ".h..p.p..ho" + /* 3 */ ".h.......ho" + /* 4 */ ".h...q...ho" + /* 5 */ "rhhhhhs.tho" + /* 6 */ "uuuuuh...ho" + /* 7 */ "mmmmvh...ho" + /* 8 */ "mmmmvh...ho" + /* 9 */ "mmmmvhhhhho" + /* 10 */ "mmmmvw...xo" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "lllllllllo." + /* 2 */ "nhhhhhhhho." + /* 3 */ ".h......ho." + /* 4 */ "rhhhhhh.ho." + /* 5 */ "uuuuuuh.ho." + /* 6 */ ".....vh.ho." + /* 7 */ "mmmm.vh.ho." + /* 8 */ "mmmm.vh.ho." + /* 9 */ "mmmm.vhhho." + /* 10 */ "mmmm.vw.xo." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ /* 0 */ "..........." /* 1 */ "..........." - /* 2 */ "jjjjjjjjjjj" - /* 3 */ "fffffffffff" - /* 4 */ "ooooooooooo" - /* 5 */ "..........." - /* 6 */ "...........", + /* 2 */ "lllllllll.." + /* 3 */ "hhhhhhhho.." + /* 4 */ "uuuuuuvho.." + /* 5 */ "......vho.." + /* 6 */ "......vho.." + /* 7 */ "mmmm..vho.." + /* 8 */ "mmmm..vho.." + /* 9 */ "mmmm..vho.." + /* 10 */ "mmmm..vho..", // Connectors: - "-1: 5, 0, 0: 2\n" /* Type -1, direction Z- */, + "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2290,288 +3266,169 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, - }, // PlainsVillage_92 + }, // WoodenHouseL9x9 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_93: - // The data has been exported from the gallery Plains, area index 42, ID 93, created by xoft + // WoodenHouseU13x9: + // The data has been exported from the gallery Plains, area index 43, ID 94, created by xoft { // Size: - 11, 6, 11, // SizeX = 11, SizeY = 6, SizeZ = 11 + 15, 8, 11, // SizeX = 15, SizeY = 8, SizeZ = 11 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 10, 5, 10, // MaxX, MaxY, MaxZ + 14, 7, 10, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 64: 7\n" /* wooddoorblock */ - "h:102: 0\n" /* glasspane */ - "i: 64:12\n" /* wooddoorblock */ - "j: 53: 2\n" /* woodstairs */ - "k: 53: 7\n" /* woodstairs */ - "l: 53: 1\n" /* woodstairs */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h: 5: 0\n" /* wood */ + "i: 64: 7\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 64:12\n" /* wooddoorblock */ + "l: 53: 2\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 50: 3\n" /* torch */ - "o: 50: 4\n" /* torch */ - "p: 53: 6\n" /* woodstairs */ - "q: 50: 1\n" /* torch */ + "n: 53: 0\n" /* woodstairs */ + "o: 53: 1\n" /* woodstairs */ + "p: 50: 3\n" /* torch */ + "q: 50: 4\n" /* torch */ "r: 50: 2\n" /* torch */ - "s: 53: 3\n" /* woodstairs */ - "t: 53: 0\n" /* woodstairs */ + "s: 50: 1\n" /* torch */ + "t: 53: 3\n" /* woodstairs */ "u: 53: 5\n" /* woodstairs */ "v: 53: 4\n" /* woodstairs */, // Block data: // Level 0 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "....abc...." - /* 1 */ ".ddddddddd." - /* 2 */ ".ddddddddd." - /* 3 */ ".ddddddddd." - /* 4 */ ".ddddddddd." - /* 5 */ ".ddddddddd." - /* 6 */ ".....ddddd." - /* 7 */ "mmmm.ddddd." - /* 8 */ "mmmm.ddddd." - /* 9 */ "mmmm.ddddd." - /* 10 */ "mmmm......." + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "aaaaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaaaaaa" // Level 1 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".efffgfffe." - /* 2 */ ".f.......f." - /* 3 */ ".f.......f." - /* 4 */ ".f.......f." - /* 5 */ ".efffe...f." - /* 6 */ ".....f...f." - /* 7 */ "mmmm.f...f." - /* 8 */ "mmmm.f...f." - /* 9 */ "mmmm.efffe." - /* 10 */ "mmmm......." + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "bbbbbbaaabbbbbb" + /* 1 */ "baaaaaaaaaaaaab" + /* 2 */ "baaaaaaaaaaaaab" + /* 3 */ "baaaaaaaaaaaaab" + /* 4 */ "baaaaaaaaaaaaab" + /* 5 */ "baaaaaaaaaaaaab" + /* 6 */ "baaaaabbbaaaaab" + /* 7 */ "baaaaabbbaaaaab" + /* 8 */ "baaaaabbbaaaaab" + /* 9 */ "baaaaabbbaaaaab" + /* 10 */ "bbbbbbbbbbbbbbb" // Level 2 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".ehhfifhhe." - /* 2 */ ".h.......h." - /* 3 */ ".h.......h." - /* 4 */ ".h.......h." - /* 5 */ ".ehhhe...f." - /* 6 */ ".....h...h." - /* 7 */ "mmmm.h...h." - /* 8 */ "mmmm.h...h." - /* 9 */ "mmmm.ehhhe." - /* 10 */ "mmmm......." + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "......cde......" + /* 1 */ ".fffffffffffff." + /* 2 */ ".fffffffffffff." + /* 3 */ ".fffffffffffff." + /* 4 */ ".fffffffffffff." + /* 5 */ ".fffffffffffff." + /* 6 */ ".fffff...fffff." + /* 7 */ ".fffff...fffff." + /* 8 */ ".fffff...fffff." + /* 9 */ ".fffff...fffff." + /* 10 */ "..............." // Level 3 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "jjjjjjjjjjj" - /* 1 */ "kfffffffffl" - /* 2 */ ".f..n.n..fl" - /* 3 */ ".f.......fl" - /* 4 */ ".f...o...fl" - /* 5 */ "pfffffq.rfl" - /* 6 */ "sssssf...fl" - /* 7 */ "mmmmtf...fl" - /* 8 */ "mmmmtf...fl" - /* 9 */ "mmmmtfffffl" - /* 10 */ "mmmmtu...vl" - - // Level 4 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "jjjjjjjjjl." - /* 2 */ "kffffffffl." - /* 3 */ ".f......fl." - /* 4 */ "pffffff.fl." - /* 5 */ "ssssssf.fl." - /* 6 */ ".....tf.fl." - /* 7 */ "mmmm.tf.fl." - /* 8 */ "mmmm.tf.fl." - /* 9 */ "mmmm.tfffl." - /* 10 */ "mmmm.tu.vl." - - // Level 5 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "jjjjjjjjj.." - /* 3 */ "ffffffffl.." - /* 4 */ "sssssstfl.." - /* 5 */ "......tfl.." - /* 6 */ "......tfl.." - /* 7 */ "mmmm..tfl.." - /* 8 */ "mmmm..tfl.." - /* 9 */ "mmmm..tfl.." - /* 10 */ "mmmm..tfl..", - - // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_93 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_94: - // The data has been exported from the gallery Plains, area index 43, ID 94, created by xoft - { - // Size: - 15, 6, 11, // SizeX = 15, SizeY = 6, SizeZ = 11 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 14, 5, 10, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 64: 7\n" /* wooddoorblock */ - "h:102: 0\n" /* glasspane */ - "i: 64:12\n" /* wooddoorblock */ - "j: 53: 2\n" /* woodstairs */ - "k: 53: 0\n" /* woodstairs */ - "l: 53: 1\n" /* woodstairs */ - "m: 19: 0\n" /* sponge */ - "n: 50: 3\n" /* torch */ - "o: 50: 4\n" /* torch */ - "p: 50: 2\n" /* torch */ - "q: 50: 1\n" /* torch */ - "r: 53: 3\n" /* woodstairs */ - "s: 53: 5\n" /* woodstairs */ - "t: 53: 4\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "......abc......" - /* 1 */ ".ddddddddddddd." - /* 2 */ ".ddddddddddddd." - /* 3 */ ".ddddddddddddd." - /* 4 */ ".ddddddddddddd." - /* 5 */ ".ddddddddddddd." - /* 6 */ ".ddddd...ddddd." - /* 7 */ ".ddddd...ddddd." - /* 8 */ ".ddddd...ddddd." - /* 9 */ ".ddddd...ddddd." - /* 10 */ "..............." - - // Level 1 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".efffffgfffffe." - /* 2 */ ".f...........f." - /* 3 */ ".f...........f." - /* 4 */ ".f...........f." - /* 5 */ ".f...efffe...f." - /* 6 */ ".f...f...f...f." - /* 7 */ ".f...f...f...f." - /* 8 */ ".f...f...f...f." - /* 9 */ ".efffe...efffe." - /* 10 */ "..............." - - // Level 2 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".ehhhhfifhhhhe." + /* 1 */ ".ghhhhhihhhhhg." /* 2 */ ".h...........h." /* 3 */ ".h...........h." /* 4 */ ".h...........h." - /* 5 */ ".f...ehhhe...f." + /* 5 */ ".h...ghhhg...h." /* 6 */ ".h...h...h...h." /* 7 */ ".h...h...h...h." /* 8 */ ".h...h...h...h." - /* 9 */ ".ehhhe...ehhhe." + /* 9 */ ".ghhhg...ghhhg." /* 10 */ "..............." - // Level 3 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "jjjjjjjjjjjjjjj" - /* 1 */ "kfffffffffffffl" - /* 2 */ "kf....n.n....fl" - /* 3 */ "kf...........fl" - /* 4 */ "kf...o...o...fl" - /* 5 */ "kf..pfffffq..fl" - /* 6 */ "kf...frrrf...fl" - /* 7 */ "kf...fl.kf...fl" - /* 8 */ "kf...fl.kf...fl" - /* 9 */ "kfffffl.kfffffl" - /* 10 */ "ks...tl.ks...tl" - // Level 4 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".jjjjjjjjjjjjl." - /* 2 */ ".kfffffffffffl." - /* 3 */ ".kfffffffffffl." - /* 4 */ ".kfffffffffffl." - /* 5 */ ".kffflrrrrfffl." - /* 6 */ ".kfffl...kfffl." - /* 7 */ ".kfffl...kfffl." - /* 8 */ ".kfffl...kfffl." - /* 9 */ ".kfffl...kfffl." - /* 10 */ ".ks.tl...ks.tl." + /* 1 */ ".gjjjjhkhjjjjg." + /* 2 */ ".j...........j." + /* 3 */ ".j...........j." + /* 4 */ ".j...........j." + /* 5 */ ".h...gjjjg...h." + /* 6 */ ".j...j...j...j." + /* 7 */ ".j...j...j...j." + /* 8 */ ".j...j...j...j." + /* 9 */ ".gjjjg...gjjjg." + /* 10 */ "..............." // Level 5 /* z\x* 11111 */ /* * 012345678901234 */ + /* 0 */ "lllllllllllllll" + /* 1 */ "nhhhhhhhhhhhhho" + /* 2 */ "nh....p.p....ho" + /* 3 */ "nh...........ho" + /* 4 */ "nh...q...q...ho" + /* 5 */ "nh..rhhhhhs..ho" + /* 6 */ "nh...httth...ho" + /* 7 */ "nh...ho.nh...ho" + /* 8 */ "nh...ho.nh...ho" + /* 9 */ "nhhhhho.nhhhhho" + /* 10 */ "nu...vo.nu...vo" + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".llllllllllllo." + /* 2 */ ".nhhhhhhhhhhho." + /* 3 */ ".nhhhhhhhhhhho." + /* 4 */ ".nhhhhhhhhhhho." + /* 5 */ ".nhhhotttthhho." + /* 6 */ ".nhhho...nhhho." + /* 7 */ ".nhhho...nhhho." + /* 8 */ ".nhhho...nhhho." + /* 9 */ ".nhhho...nhhho." + /* 10 */ ".nu.vo...nu.vo." + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ "..kjjjjjjjjjj.." - /* 3 */ "..kfffffffffl.." - /* 4 */ "..kflrrrrrkfl.." - /* 5 */ "..kfl.....kfl.." - /* 6 */ "..kfl.....kfl.." - /* 7 */ "..kfl.....kfl.." - /* 8 */ "..kfl.....kfl.." - /* 9 */ "..kfl.....kfl.." - /* 10 */ "..kfl.....kfl..", + /* 2 */ "..nllllllllll.." + /* 3 */ "..nhhhhhhhhho.." + /* 4 */ "..nhotttttnho.." + /* 5 */ "..nho.....nho.." + /* 6 */ "..nho.....nho.." + /* 7 */ "..nho.....nho.." + /* 8 */ "..nho.....nho.." + /* 9 */ "..nho.....nho.." + /* 10 */ "..nho.....nho..", // Connectors: - "-1: 7, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 7, 2, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2590,446 +3447,338 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, - }, // PlainsVillage_94 + }, // WoodenHouseU13x9 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_97: - // The data has been exported from the gallery Plains, area index 46, ID 97, created by Aloe_vera + // WoodenMill5x5: + // The data has been exported from the gallery Plains, area index 60, ID 111, created by Aloe_vera { // Size: - 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7 + 9, 18, 13, // SizeX = 9, SizeY = 18, SizeZ = 13 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 10, 5, 6, // MaxX, MaxY, MaxZ + 8, 17, 12, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 64: 7\n" /* wooddoorblock */ - "h: 53: 3\n" /* woodstairs */ - "i: 85: 0\n" /* fence */ - "j: 53: 2\n" /* woodstairs */ - "k: 53: 1\n" /* woodstairs */ - "l: 53: 0\n" /* woodstairs */ - "m: 19: 0\n" /* sponge */ - "n:102: 0\n" /* glasspane */ - "o: 64:12\n" /* wooddoorblock */ - "p: 50: 3\n" /* torch */ - "q: 72: 0\n" /* woodplate */ - "r: 53: 7\n" /* woodstairs */ - "s: 47: 0\n" /* bookshelf */ - "t: 50: 1\n" /* torch */ - "u: 50: 2\n" /* torch */ - "v: 53: 6\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "....abc...." - /* 1 */ ".ddddddddd." - /* 2 */ ".ddddddddd." - /* 3 */ ".ddddddddd." - /* 4 */ ".ddddddddd." - /* 5 */ ".ddddddddd." - /* 6 */ "..........." - - // Level 1 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".efffgfffe." - /* 2 */ ".fh.....hf." - /* 3 */ ".fi.....if." - /* 4 */ ".fj.kil.jf." - /* 5 */ ".efffffffe." - /* 6 */ "..........." - - // Level 2 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".ennfofnne." - /* 2 */ ".n..p.p..n." - /* 3 */ ".nq.....qn." - /* 4 */ ".n...q...n." - /* 5 */ ".ennnfnnne." - /* 6 */ "..........." - - // Level 3 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "jjjjjjjjjjj" - /* 1 */ "rfffffffffr" - /* 2 */ ".fsssssssf." - /* 3 */ ".ft.....uf." - /* 4 */ ".fsssssssf." - /* 5 */ "vfffffffffv" - /* 6 */ "hhhhhhhhhhh" - - // Level 4 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "jjjjjjjjjjj" - /* 2 */ "rfffffffffr" - /* 3 */ ".f.......f." - /* 4 */ "vfffffffffv" - /* 5 */ "hhhhhhhhhhh" - /* 6 */ "..........." - - // Level 5 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "jjjjjjjjjjj" - /* 3 */ "fffffffffff" - /* 4 */ "hhhhhhhhhhh" - /* 5 */ "..........." - /* 6 */ "...........", - - // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_97 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_98: - // The data has been exported from the gallery Plains, area index 47, ID 98, created by Aloe_vera - { - // Size: - 12, 7, 9, // SizeX = 12, SizeY = 7, SizeZ = 9 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 11, 6, 8, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 64: 7\n" /* wooddoorblock */ - "h: 64: 5\n" /* wooddoorblock */ - "i: 53: 3\n" /* woodstairs */ - "j: 85: 0\n" /* fence */ - "k: 53: 2\n" /* woodstairs */ - "l: 53: 1\n" /* woodstairs */ - "m: 19: 0\n" /* sponge */ - "n: 53: 0\n" /* woodstairs */ - "o:102: 0\n" /* glasspane */ - "p: 64:12\n" /* wooddoorblock */ - "q: 50: 3\n" /* torch */ - "r: 72: 0\n" /* woodplate */ - "s: 53: 7\n" /* woodstairs */ - "t: 47: 0\n" /* bookshelf */ - "u: 50: 1\n" /* torch */ - "v: 50: 2\n" /* torch */ - "w: 53: 6\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "....abbc...." - /* 1 */ ".dddddddddd." - /* 2 */ ".dddddddddd." - /* 3 */ ".dddddddddd." - /* 4 */ ".dddddddddd." - /* 5 */ ".dddddddddd." - /* 6 */ ".dddddddddd." - /* 7 */ ".dddddddddd." - /* 8 */ "............" - - // Level 1 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".efffghfffe." - /* 2 */ ".f........f." - /* 3 */ ".fi......if." - /* 4 */ ".fj......jf." - /* 5 */ ".fk......kf." - /* 6 */ ".f.ljnljn.f." - /* 7 */ ".effffffffe." - /* 8 */ "............" - - // Level 2 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".eoofppfooe." - /* 2 */ ".o..q..q..o." - /* 3 */ ".o........o." - /* 4 */ ".fr......rf." - /* 5 */ ".o........o." - /* 6 */ ".o..r..r..o." - /* 7 */ ".eoofoofooe." - /* 8 */ "............" - - // Level 3 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "kkkkkkkkkkkk" - /* 1 */ "sffffffffffs" - /* 2 */ ".fttttttttf." - /* 3 */ ".f........f." - /* 4 */ ".fu......vf." - /* 5 */ ".f........f." - /* 6 */ ".fttttttttf." - /* 7 */ "wffffffffffw" - /* 8 */ "iiiiiiiiiiii" - - // Level 4 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "kkkkkkkkkkkk" - /* 2 */ "sffffffffffs" - /* 3 */ ".fttttttttf." - /* 4 */ ".f........f." - /* 5 */ ".fttttttttf." - /* 6 */ "wffffffffffw" - /* 7 */ "iiiiiiiiiiii" - /* 8 */ "............" - - // Level 5 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "............" - /* 2 */ "kkkkkkkkkkkk" - /* 3 */ "sffffffffffs" - /* 4 */ ".f........f." - /* 5 */ "wffffffffffw" - /* 6 */ "iiiiiiiiiiii" - /* 7 */ "............" - /* 8 */ "............" - - // Level 6 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "............" - /* 2 */ "............" - /* 3 */ "kkkkkkkkkkkk" - /* 4 */ "ffffffffffff" - /* 5 */ "iiiiiiiiiiii" - /* 6 */ "............" - /* 7 */ "............" - /* 8 */ "............", - - // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // PlainsVillage_98 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // PlainsVillage_99: - // The data has been exported from the gallery Plains, area index 48, ID 99, created by Aloe_vera - { - // Size: - 11, 7, 13, // SizeX = 11, SizeY = 7, SizeZ = 13 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 6, 12, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 43: 0\n" /* doubleslab */ - "f: 2: 0\n" /* grass */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 4: 0\n" /* cobblestone */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 67: 3\n" /* stairs */ "g: 17: 0\n" /* tree */ "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j: 53: 3\n" /* woodstairs */ - "k: 85: 0\n" /* fence */ - "l: 53: 2\n" /* woodstairs */ + "i: 54: 4\n" /* chest */ + "j:154: 4\n" /* hopper */ + "k: 64: 4\n" /* wooddoorblock */ + "l:102: 0\n" /* glasspane */ "m: 19: 0\n" /* sponge */ - "n:102: 0\n" /* glasspane */ + "n: 85: 0\n" /* fence */ "o: 64:12\n" /* wooddoorblock */ - "p: 72: 0\n" /* woodplate */ - "q: 53: 7\n" /* woodstairs */ - "r: 50: 1\n" /* torch */ - "s: 50: 2\n" /* torch */ - "t: 53: 6\n" /* woodstairs */, + "p: 50: 2\n" /* torch */ + "q: 35: 0\n" /* wool */ + "r: 17: 4\n" /* tree */ + "s: 17: 8\n" /* tree */ + "t: 53: 2\n" /* woodstairs */ + "u: 53: 7\n" /* woodstairs */ + "v: 53: 6\n" /* woodstairs */ + "w: 53: 3\n" /* woodstairs */, // Block data: // Level 0 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "....abc...." - /* 1 */ ".ddddddddd." - /* 2 */ ".deeeedddd." - /* 3 */ ".deeeedddd." - /* 4 */ ".deeeedddd." - /* 5 */ ".deeeedddd." - /* 6 */ ".deeeedddd." - /* 7 */ ".ddddddddd." - /* 8 */ "..fffffff.." - /* 9 */ "mmfffffffmm" - /* 10 */ "mmfffffffmm" - /* 11 */ "mmfffffffmm" - /* 12 */ "mmfffffffmm" + /* z\x* 012345678 */ + /* 0 */ "aaaaaaaaa" + /* 1 */ "aaaaaaaaa" + /* 2 */ "aaaaaaaaa" + /* 3 */ "aaaaaaaaa" + /* 4 */ "aaaaaaaaa" + /* 5 */ "aaaaaaaaa" + /* 6 */ "aaaaaaaaa" + /* 7 */ "aaaaaaaaa" + /* 8 */ "aaaaaaaaa" + /* 9 */ "aaaaaaaaa" + /* 10 */ "aaaaaaaaa" + /* 11 */ "aaaaaaaaa" + /* 12 */ "aaaaaaaaa" // Level 1 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".ghhhihhhg." - /* 2 */ ".h.e....jh." - /* 3 */ ".h.e....kh." - /* 4 */ ".h.e....lh." - /* 5 */ ".h.......h." - /* 6 */ ".h.......h." - /* 7 */ ".ghhhihhhg." - /* 8 */ "..k.....k.." - /* 9 */ "mmk.....kmm" - /* 10 */ "mmk.....kmm" - /* 11 */ "mmk.....kmm" - /* 12 */ "mmkkkkkkkmm" + /* z\x* 012345678 */ + /* 0 */ "bbbbbbbbb" + /* 1 */ "bbbbbbbbb" + /* 2 */ "bbbbbbbbb" + /* 3 */ "bbbbbbbbb" + /* 4 */ "baaaaabbb" + /* 5 */ "baaaaaabb" + /* 6 */ "baaaaaabb" + /* 7 */ "baaaaaabb" + /* 8 */ "baaaaabbb" + /* 9 */ "bbbbbbbbb" + /* 10 */ "bbbbbbbbb" + /* 11 */ "bbbbbbbbb" + /* 12 */ "bbbbbbbbb" // Level 2 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".gnnhohnng." - /* 2 */ ".n.......n." - /* 3 */ ".n......pn." - /* 4 */ ".h.......h." - /* 5 */ ".n.......n." - /* 6 */ ".n.......n." - /* 7 */ ".gnnhohnng." - /* 8 */ "..........." - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm" + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".ccccc..." + /* 5 */ ".cccccd.." + /* 6 */ ".ccccce.." + /* 7 */ ".cccccf.." + /* 8 */ ".ccccc..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." // Level 3 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "lllllllllll" - /* 1 */ "qhhhhhhhhhq" - /* 2 */ ".h.......h." - /* 3 */ ".h.......h." - /* 4 */ ".hr.....sh." - /* 5 */ ".h.......h." - /* 6 */ ".h.......h." - /* 7 */ "thhhhhhhhht" - /* 8 */ "jjjjjjjjjjj" - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm" + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".ghhhg..." + /* 5 */ ".h...h..." + /* 6 */ ".hij.k..." + /* 7 */ ".h...h..." + /* 8 */ ".ghhhg..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." // Level 4 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "lllllllllll" - /* 2 */ "qhhhhhhhhhq" - /* 3 */ ".h.......h." - /* 4 */ ".h.......h." - /* 5 */ ".h.......h." - /* 6 */ "thhhhhhhhht" - /* 7 */ "jjjjjjjjjjj" - /* 8 */ "..........." - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm" + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".glllg..." + /* 5 */ ".l...h..." + /* 6 */ ".l.n.o..." + /* 7 */ ".l...h..." + /* 8 */ ".glllg..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." // Level 5 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "lllllllllll" - /* 3 */ "qhhhhhhhhhq" - /* 4 */ ".h.......h." - /* 5 */ "thhhhhhhhht" - /* 6 */ "jjjjjjjjjjj" - /* 7 */ "..........." - /* 8 */ "..........." - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm" + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".ghhhg..." + /* 5 */ ".h..ph..." + /* 6 */ ".h.n.h..." + /* 7 */ ".h..ph..n" + /* 8 */ ".ghhhg..q" + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." // Level 6 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "..........." - /* 3 */ "lllllllllll" - /* 4 */ "hhhhhhhhhhh" - /* 5 */ "jjjjjjjjjjj" - /* 6 */ "..........." - /* 7 */ "..........." - /* 8 */ "..........." - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm", + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".grrrg..." + /* 5 */ ".s...s..." + /* 6 */ ".s.n.s..." + /* 7 */ ".s...s..n" + /* 8 */ ".grrrg..q" + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 7 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".ghhhg..." + /* 5 */ ".h...h..." + /* 6 */ ".h.n.h..n" + /* 7 */ ".h...h..q" + /* 8 */ ".ghhhg..q" + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 8 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "........." + /* 4 */ ".glllg..." + /* 5 */ ".l...l..." + /* 6 */ ".l.n.l..n" + /* 7 */ ".l...l..q" + /* 8 */ ".glllg..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 9 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.q" + /* 1 */ "mmmmmmm.q" + /* 2 */ "mmmmmmm.q" + /* 3 */ "........." + /* 4 */ ".ghhhg..." + /* 5 */ ".h...h..n" + /* 6 */ ".h.n.h..q" + /* 7 */ ".h...h..q" + /* 8 */ ".ghhhg..." + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 10 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.n" + /* 1 */ "mmmmmmm.n" + /* 2 */ "mmmmmmm.q" + /* 3 */ "........q" + /* 4 */ ".grrrg..q" + /* 5 */ ".s...s..n" + /* 6 */ ".s.n.s..q" + /* 7 */ ".s...s..n" + /* 8 */ ".grrrg..n" + /* 9 */ "........." + /* 10 */ "mmmmmmm.." + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 11 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.n" + /* 3 */ "ttttttt.n" + /* 4 */ "uhhhhhu.q" + /* 5 */ ".h...h..q" + /* 6 */ ".h.nrrrrr" + /* 7 */ ".h...h..q" + /* 8 */ "vhhhhhv.q" + /* 9 */ "wwwwwww.n" + /* 10 */ "mmmmmmm.n" + /* 11 */ "mmmmmmm.." + /* 12 */ "mmmmmmm.." + + // Level 12 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "mmmmmmm.." + /* 4 */ "ttttttt.n" + /* 5 */ "uhhhhhu.n" + /* 6 */ ".h...h..q" + /* 7 */ "vhhhhhv.n" + /* 8 */ "wwwwwww.q" + /* 9 */ "mmmmmmm.q" + /* 10 */ "mmmmmmm.q" + /* 11 */ "mmmmmmm.n" + /* 12 */ "mmmmmmm.n" + + // Level 13 + /* z\x* 012345678 */ + /* 0 */ "mmmmmmm.." + /* 1 */ "mmmmmmm.." + /* 2 */ "mmmmmmm.." + /* 3 */ "mmmmmmm.." + /* 4 */ "mmmmmmm.." + /* 5 */ "ttttttt.q" + /* 6 */ "hhhhhhh.q" + /* 7 */ "wwwwwww.n" + /* 8 */ "mmmmmmm.." + /* 9 */ "mmmmmmm.." + /* 10 */ "mmmmmmm.q" + /* 11 */ "mmmmmmm.q" + /* 12 */ "mmmmmmm.q" + + // Level 14 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........." + /* 5 */ "........q" + /* 6 */ "........n" + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." + + // Level 15 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........q" + /* 5 */ "........q" + /* 6 */ "........n" + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." + + // Level 16 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........q" + /* 5 */ "........n" + /* 6 */ "........." + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." + + // Level 17 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........q" + /* 5 */ "........n" + /* 6 */ "........." + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ ".........", // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 8, 2, 6: 5\n" /* Type -1, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3048,7 +3797,342 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, - }, // PlainsVillage_99 + }, // WoodenMill5x5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenStables: + // The data has been exported from the gallery Plains, area index 55, ID 106, created by Aloe_vera + { + // Size: + 15, 10, 9, // SizeX = 15, SizeY = 10, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 9, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 4: 0\n" /* cobblestone */ + "g: 17: 0\n" /* tree */ + "h:107: 0\n" /* fencegate */ + "i:107: 4\n" /* fencegate */ + "j: 5: 0\n" /* wood */ + "k:107: 6\n" /* fencegate */ + "l: 85: 0\n" /* fence */ + "m: 19: 0\n" /* sponge */ + "n:170: 0\n" /* haybale */ + "o:170: 4\n" /* haybale */ + "p:170: 8\n" /* haybale */ + "q: 50: 1\n" /* torch */ + "r: 50: 2\n" /* torch */ + "s: 53: 2\n" /* woodstairs */ + "t: 53: 7\n" /* woodstairs */ + "u: 53: 6\n" /* woodstairs */ + "v: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "aaaaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaaaaa" + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "baaaaaaaaaaaaab" + /* 1 */ "baaaaaaaaaaaaab" + /* 2 */ "baaaaaaaaaaaaab" + /* 3 */ "baaaaaaaaaaaaab" + /* 4 */ "baaaaaaaaaaaaab" + /* 5 */ "baaaaaaaaaaaaab" + /* 6 */ "baaaaaaaaaaaaab" + /* 7 */ "baaaaaaaaaaaaab" + /* 8 */ "bbbbbbbbbbbbbbb" + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ ".cddddddddddde." + /* 1 */ ".fffffffffffff." + /* 2 */ ".faaaaaaaaaaaf." + /* 3 */ ".faaaaaaaaaaaf." + /* 4 */ ".faaaaaaaaaaaf." + /* 5 */ ".faaaaaaaaaaaf." + /* 6 */ ".faaaaaaaaaaaf." + /* 7 */ ".fffffffffffff." + /* 8 */ "..............." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".ghihjhihjhkhg." + /* 2 */ ".l...l...l...l." + /* 3 */ ".l...l...l...l." + /* 4 */ ".l...l...l...l." + /* 5 */ ".l...l...l...l." + /* 6 */ ".ln..l..olp..l." + /* 7 */ ".gllljllljlllg." + /* 8 */ "..............." + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".g...j...j...g." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ ".g...j...j...g." + /* 8 */ "..............." + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".gq.rjq.rjq.rg." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ ".g...j...j...g." + /* 8 */ "..............." + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "sssssssssssssss" + /* 1 */ "tjjjjjjjjjjjjjt" + /* 2 */ ".j...........j." + /* 3 */ ".j...........j." + /* 4 */ ".j...........j." + /* 5 */ ".j...........j." + /* 6 */ ".j...........j." + /* 7 */ "ujjjjjjjjjjjjju" + /* 8 */ "vvvvvvvvvvvvvvv" + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "sssssssssssssss" + /* 2 */ "tjjjjjjjjjjjjjt" + /* 3 */ ".j...........j." + /* 4 */ ".j...........j." + /* 5 */ ".j...........j." + /* 6 */ "ujjjjjjjjjjjjju" + /* 7 */ "vvvvvvvvvvvvvvv" + /* 8 */ "..............." + + // Level 8 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "sssssssssssssss" + /* 3 */ "tjjjjjjjjjjjjjt" + /* 4 */ ".j...........j." + /* 5 */ "ujjjjjjjjjjjjju" + /* 6 */ "vvvvvvvvvvvvvvv" + /* 7 */ "..............." + /* 8 */ "..............." + + // Level 9 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "sssssssssssssss" + /* 4 */ "jjjjjjjjjjjjjjj" + /* 5 */ "vvvvvvvvvvvvvvv" + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "...............", + + // Connectors: + "-1: 7, 2, -1: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // WoodenStables +}; // g_PlainsVillagePrefabs + + + + + + +const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // CobbleWell4x4: + // The data has been exported from the gallery Plains, area index 1, ID 5, created by Aloe_vera + { + // Size: + 4, 13, 4, // SizeX = 4, SizeY = 13, SizeZ = 4 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 3, 12, 3, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 1: 0\n" /* stone */ + "b: 4: 0\n" /* cobblestone */ + "c: 8: 0\n" /* water */ + "d: 85: 0\n" /* fence */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123 */ + /* 0 */ "aaaa" + /* 1 */ "aaaa" + /* 2 */ "aaaa" + /* 3 */ "aaaa" + + // Level 1 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 2 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 3 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 4 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 5 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 6 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 7 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 8 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bccb" + /* 2 */ "bccb" + /* 3 */ "bbbb" + + // Level 9 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "b..b" + /* 2 */ "b..b" + /* 3 */ "bbbb" + + // Level 10 + /* z\x* 0123 */ + /* 0 */ "d..d" + /* 1 */ "...." + /* 2 */ "...." + /* 3 */ "d..d" + + // Level 11 + /* z\x* 0123 */ + /* 0 */ "d..d" + /* 1 */ "...." + /* 2 */ "...." + /* 3 */ "d..d" + + // Level 12 + /* z\x* 0123 */ + /* 0 */ "bbbb" + /* 1 */ "bbbb" + /* 2 */ "bbbb" + /* 3 */ "bbbb", + + // Connectors: + "2: 1, 9, 3: 3\n" /* Type 2, direction Z+ */ + "2: 2, 9, 0: 2\n" /* Type 2, direction Z- */ + "2: 0, 9, 1: 4\n" /* Type 2, direction X- */ + "2: 3, 9, 2: 5\n" /* Type 2, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // CobbleWell4x4 @@ -3234,7 +4318,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ ".......", // Connectors: - "", + "2: 0, 9, 3: 4\n" /* Type 2, direction X- */ + "2: 3, 9, 6: 3\n" /* Type 2, direction Z+ */ + "2: 6, 9, 3: 5\n" /* Type 2, direction X+ */ + "2: 3, 9, 0: 2\n" /* Type 2, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3254,466 +4341,6 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, }, // RoofedWell - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Windmill: - // The data has been exported from the gallery Plains, area index 60, ID 111, created by Aloe_vera - { - // Size: - 9, 16, 13, // SizeX = 9, SizeY = 16, SizeZ = 13 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 8, 15, 12, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 4: 0\n" /* cobblestone */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 67: 3\n" /* stairs */ - "e: 17: 0\n" /* tree */ - "f: 5: 0\n" /* wood */ - "g: 54: 4\n" /* chest */ - "h:154: 4\n" /* hopper */ - "i: 64: 4\n" /* wooddoorblock */ - "j:102: 0\n" /* glasspane */ - "k: 85: 0\n" /* fence */ - "l: 64:12\n" /* wooddoorblock */ - "m: 19: 0\n" /* sponge */ - "n: 50: 2\n" /* torch */ - "o: 35: 0\n" /* wool */ - "p: 17: 4\n" /* tree */ - "q: 17: 8\n" /* tree */ - "r: 53: 2\n" /* woodstairs */ - "s: 53: 7\n" /* woodstairs */ - "t: 53: 6\n" /* woodstairs */ - "u: 53: 3\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "........." - /* 4 */ ".aaaaa..." - /* 5 */ ".aaaaab.." - /* 6 */ ".aaaaac.." - /* 7 */ ".aaaaad.." - /* 8 */ ".aaaaa..." - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 1 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "........." - /* 4 */ ".efffe..." - /* 5 */ ".f...f..." - /* 6 */ ".fgh.i..." - /* 7 */ ".f...f..." - /* 8 */ ".efffe..." - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 2 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "........." - /* 4 */ ".ejjje..." - /* 5 */ ".j...f..." - /* 6 */ ".j.k.l..." - /* 7 */ ".j...f..." - /* 8 */ ".ejjje..." - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 3 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "........." - /* 4 */ ".efffe..." - /* 5 */ ".f..nf..." - /* 6 */ ".f.k.f..." - /* 7 */ ".f..nf..k" - /* 8 */ ".efffe..o" - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 4 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "........." - /* 4 */ ".epppe..." - /* 5 */ ".q...q..." - /* 6 */ ".q.k.q..." - /* 7 */ ".q...q..k" - /* 8 */ ".epppe..o" - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 5 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "........." - /* 4 */ ".efffe..." - /* 5 */ ".f...f..." - /* 6 */ ".f.k.f..k" - /* 7 */ ".f...f..o" - /* 8 */ ".efffe..o" - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 6 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "........." - /* 4 */ ".ejjje..." - /* 5 */ ".j...j..." - /* 6 */ ".j.k.j..k" - /* 7 */ ".j...j..o" - /* 8 */ ".ejjje..." - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 7 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.o" - /* 1 */ "mmmmmmm.o" - /* 2 */ "mmmmmmm.o" - /* 3 */ "........." - /* 4 */ ".efffe..." - /* 5 */ ".f...f..k" - /* 6 */ ".f.k.f..o" - /* 7 */ ".f...f..o" - /* 8 */ ".efffe..." - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 8 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.k" - /* 1 */ "mmmmmmm.k" - /* 2 */ "mmmmmmm.o" - /* 3 */ "........o" - /* 4 */ ".epppe..o" - /* 5 */ ".q...q..k" - /* 6 */ ".q.k.q..o" - /* 7 */ ".q...q..k" - /* 8 */ ".epppe..k" - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 9 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.k" - /* 3 */ "rrrrrrr.k" - /* 4 */ "sfffffs.o" - /* 5 */ ".f...f..o" - /* 6 */ ".f.kppppp" - /* 7 */ ".f...f..o" - /* 8 */ "tffffft.o" - /* 9 */ "uuuuuuu.k" - /* 10 */ "mmmmmmm.k" - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." - - // Level 10 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "mmmmmmm.." - /* 4 */ "rrrrrrr.k" - /* 5 */ "sfffffs.k" - /* 6 */ ".f...f..o" - /* 7 */ "tffffft.k" - /* 8 */ "uuuuuuu.o" - /* 9 */ "mmmmmmm.o" - /* 10 */ "mmmmmmm.o" - /* 11 */ "mmmmmmm.k" - /* 12 */ "mmmmmmm.k" - - // Level 11 - /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "mmmmmmm.." - /* 4 */ "mmmmmmm.." - /* 5 */ "rrrrrrr.o" - /* 6 */ "fffffff.o" - /* 7 */ "uuuuuuu.k" - /* 8 */ "mmmmmmm.." - /* 9 */ "mmmmmmm.." - /* 10 */ "mmmmmmm.o" - /* 11 */ "mmmmmmm.o" - /* 12 */ "mmmmmmm.o" - - // Level 12 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ "........." - /* 2 */ "........." - /* 3 */ "........." - /* 4 */ "........." - /* 5 */ "........o" - /* 6 */ "........k" - /* 7 */ "........." - /* 8 */ "........." - /* 9 */ "........." - /* 10 */ "........." - /* 11 */ "........." - /* 12 */ "........." - - // Level 13 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ "........." - /* 2 */ "........." - /* 3 */ "........." - /* 4 */ "........o" - /* 5 */ "........o" - /* 6 */ "........k" - /* 7 */ "........." - /* 8 */ "........." - /* 9 */ "........." - /* 10 */ "........." - /* 11 */ "........." - /* 12 */ "........." - - // Level 14 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ "........." - /* 2 */ "........." - /* 3 */ "........." - /* 4 */ "........o" - /* 5 */ "........k" - /* 6 */ "........." - /* 7 */ "........." - /* 8 */ "........." - /* 9 */ "........." - /* 10 */ "........." - /* 11 */ "........." - /* 12 */ "........." - - // Level 15 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ "........." - /* 2 */ "........." - /* 3 */ "........." - /* 4 */ "........o" - /* 5 */ "........k" - /* 6 */ "........." - /* 7 */ "........." - /* 8 */ "........." - /* 9 */ "........." - /* 10 */ "........." - /* 11 */ "........." - /* 12 */ ".........", - - // Connectors: - "-1: 5, 0, 6: 5\n" /* Type -1, direction X+ */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // Windmill -}; // g_PlainsVillagePrefabs - - - - - - -const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = -{ - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Well: - // The data has been exported from the gallery Plains, area index 1, ID 5, created by Aloe_vera - { - // Size: - 4, 13, 4, // SizeX = 4, SizeY = 13, SizeZ = 4 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 3, 12, 3, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 1: 0\n" /* stone */ - "b: 4: 0\n" /* cobblestone */ - "c: 8: 0\n" /* water */ - "d: 85: 0\n" /* fence */ - "m: 19: 0\n" /* sponge */, - - // Block data: - // Level 0 - /* z\x* 0123 */ - /* 0 */ "aaaa" - /* 1 */ "aaaa" - /* 2 */ "aaaa" - /* 3 */ "aaaa" - - // Level 1 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bccb" - /* 2 */ "bccb" - /* 3 */ "bbbb" - - // Level 2 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bccb" - /* 2 */ "bccb" - /* 3 */ "bbbb" - - // Level 3 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bccb" - /* 2 */ "bccb" - /* 3 */ "bbbb" - - // Level 4 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bccb" - /* 2 */ "bccb" - /* 3 */ "bbbb" - - // Level 5 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bccb" - /* 2 */ "bccb" - /* 3 */ "bbbb" - - // Level 6 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bccb" - /* 2 */ "bccb" - /* 3 */ "bbbb" - - // Level 7 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bccb" - /* 2 */ "bccb" - /* 3 */ "bbbb" - - // Level 8 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bccb" - /* 2 */ "bccb" - /* 3 */ "bbbb" - - // Level 9 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "b..b" - /* 2 */ "b..b" - /* 3 */ "bbbb" - - // Level 10 - /* z\x* 0123 */ - /* 0 */ "d..d" - /* 1 */ "...." - /* 2 */ "...." - /* 3 */ "d..d" - - // Level 11 - /* z\x* 0123 */ - /* 0 */ "d..d" - /* 1 */ "...." - /* 2 */ "...." - /* 3 */ "d..d" - - // Level 12 - /* z\x* 0123 */ - /* 0 */ "bbbb" - /* 1 */ "bbbb" - /* 2 */ "bbbb" - /* 3 */ "bbbb", - - // Connectors: - "2: 1, 9, 3: 3\n" /* Type 2, direction Z+ */ - "2: 2, 9, 0: 2\n" /* Type 2, direction Z- */ - "2: 0, 9, 1: 4\n" /* Type 2, direction X- */ - "2: 3, 9, 2: 5\n" /* Type 2, direction X+ */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // Well }; From 8bb8c2ca7ded71f57ec83ebc8a5214d01ae0b9b7 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 13:04:40 +0100 Subject: [PATCH 089/214] Don't start mcserver up in coverage builds Starting the server up is not a test. --- CIbuild.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CIbuild.sh b/CIbuild.sh index 20785a488..683c1fc74 100755 --- a/CIbuild.sh +++ b/CIbuild.sh @@ -6,4 +6,6 @@ cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1; make -j 2; make -j 2 test; cd MCServer/; -echo stop | $MCSERVER_PATH; +if [ "$TRAVIS_MCSERVER_BUILD_TYPE" != "COVERAGE" ] + then echo stop | $MCSERVER_PATH; +fi From 029e9a826a763e32496c30f259301c9d2d357a5f Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 13:05:12 +0100 Subject: [PATCH 090/214] test code does not need testing --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index fc17ddc2c..7b3195fce 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec sh -c 'cp {} $(dirname {})/../$(basename {})' \; - coveralls --exclude lib --exclude Android >/dev/null + coveralls --exclude lib --exclude Android --exclude tests >/dev/null fi From 46971330755be516b189601eea10c274ed918319 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 13:20:28 +0100 Subject: [PATCH 091/214] excluding tests excludes everything --- uploadCoverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadCoverage.sh b/uploadCoverage.sh index 7b3195fce..fc17ddc2c 100755 --- a/uploadCoverage.sh +++ b/uploadCoverage.sh @@ -3,7 +3,7 @@ if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ] then find tests -type f -name '*.gcda' -exec sh -c 'cp {} $(dirname {})/../$(basename {})' \; - coveralls --exclude lib --exclude Android --exclude tests >/dev/null + coveralls --exclude lib --exclude Android >/dev/null fi From 710656f84f7a572ff92a302548b19d1705c66851 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 13:39:28 +0100 Subject: [PATCH 092/214] Rewrote array copies test Moved each patten test into its own scope to test all unallocated section code paths. Moved 0's around so that they test the allocated sections code paths. --- tests/ChunkBuffer/Copies.cpp | 111 ++++++++++++++++++++--------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkBuffer/Copies.cpp index b37414ce4..76af81496 100644 --- a/tests/ChunkBuffer/Copies.cpp +++ b/tests/ChunkBuffer/Copies.cpp @@ -33,6 +33,21 @@ int main(int argc, char** argv) delete DstBlockBuffer; SrcBlockBuffer = NULL; DstBlockBuffer = NULL; + + SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); + buffer.SetBlocks(SrcBlockBuffer); + DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + buffer.CopyBlocks(DstBlockBuffer); + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); + delete SrcBlockBuffer; + delete DstBlockBuffer; + SrcBlockBuffer = NULL; + DstBlockBuffer = NULL; + + } + { + cChunkBuffer buffer; NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) @@ -51,54 +66,7 @@ int main(int argc, char** argv) delete DstNibbleBuffer; SrcNibbleBuffer = NULL; DstNibbleBuffer = NULL; - - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) - { - SrcNibbleBuffer[i+0] = 0xDE; - SrcNibbleBuffer[i+1] = 0xAD; - SrcNibbleBuffer[i+2] = 0xBE; - SrcNibbleBuffer[i+3] = 0xEF; - } - - buffer.SetLight(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; - - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) - { - SrcNibbleBuffer[i+0] = 0xAD; - SrcNibbleBuffer[i+1] = 0xBE; - SrcNibbleBuffer[i+2] = 0xEF; - SrcNibbleBuffer[i+3] = 0xDE; - } - - buffer.SetSkyLight(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopySkyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; - - SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; - memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - buffer.SetBlocks(SrcBlockBuffer); - DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; - buffer.CopyBlocks(DstBlockBuffer); - testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); - delete SrcBlockBuffer; - delete DstBlockBuffer; - SrcBlockBuffer = NULL; - DstBlockBuffer = NULL; - + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); buffer.SetMeta(SrcNibbleBuffer); @@ -110,6 +78,28 @@ int main(int argc, char** argv) SrcNibbleBuffer = NULL; DstNibbleBuffer = NULL; + } + { + cChunkBuffer buffer; + + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) + { + SrcNibbleBuffer[i+0] = 0xDE; + SrcNibbleBuffer[i+1] = 0xAD; + SrcNibbleBuffer[i+2] = 0xBE; + SrcNibbleBuffer[i+3] = 0xEF; + } + + buffer.SetLight(SrcNibbleBuffer); + NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); buffer.SetLight(SrcNibbleBuffer); @@ -121,6 +111,30 @@ int main(int argc, char** argv) SrcNibbleBuffer = NULL; DstNibbleBuffer = NULL; + + } + { + cChunkBuffer buffer; + + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) + { + SrcNibbleBuffer[i+0] = 0xAD; + SrcNibbleBuffer[i+1] = 0xBE; + SrcNibbleBuffer[i+2] = 0xEF; + SrcNibbleBuffer[i+3] = 0xDE; + } + + buffer.SetSkyLight(SrcNibbleBuffer); + NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + buffer.CopySkyLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); + delete SrcNibbleBuffer; + delete DstNibbleBuffer; + SrcNibbleBuffer = NULL; + DstNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); buffer.SetSkyLight(SrcNibbleBuffer); @@ -131,6 +145,7 @@ int main(int argc, char** argv) delete DstNibbleBuffer; SrcNibbleBuffer = NULL; DstNibbleBuffer = NULL; + } { cChunkBuffer buffer; From a7a811af3a2b7d4425abca2c7b4d733ab75449f6 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 13:59:31 +0100 Subject: [PATCH 093/214] Add tests for assignment operator --- tests/ChunkBuffer/Coordinates.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/ChunkBuffer/Coordinates.cpp b/tests/ChunkBuffer/Coordinates.cpp index b9861df23..d4fca1e50 100644 --- a/tests/ChunkBuffer/Coordinates.cpp +++ b/tests/ChunkBuffer/Coordinates.cpp @@ -120,5 +120,16 @@ int main(int argc, char** argv) } + { + // Operator = + cChunkBuffer buffer; + buffer.SetBlock(0,0,0,0x42); + cChunkBuffer copy; + copy = buffer; + testassert(copy.GetBlock(0,0,0) == 0x42); + copy = copy; + testassert(copy.GetBlock(0,0,0) == 0x42) + } + return 0; } From 7777da379d35b10bee38b2faf218810552452130 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 14:04:44 +0100 Subject: [PATCH 094/214] Fix assignment operators --- src/ChunkBuffer.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index e16575bb2..1f170abba 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -53,21 +53,25 @@ public: other.IsOwner = false; } - void operator=(const cChunkBuffer& other) + cChunkBuffer& operator=(const cChunkBuffer& other) { - if(IsOwner) + if(&other == this) { + if(IsOwner) + { + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + if(m_Sections[i]) Free(m_Sections[i]);; + } + } + IsOwner = true; for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i]) Free(m_Sections[i]);; + m_Sections[i] = other.m_Sections[i]; } + other.IsOwner = false; } - IsOwner = true; - for (int i = 0; i < CHUNK_SECTION_NUM; i++) - { - m_Sections[i] = other.m_Sections[i]; - } - other.IsOwner = false; + } #else // unique_ptr style interface for memory management @@ -79,7 +83,7 @@ public: } } - void operator=(const cChunkBuffer&& other) + cChunkBuffer& operator=(const cChunkBuffer&& other) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { From d53c84a7811e7f7af144efe24fdc21fa7b07f6ce Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 14:07:49 +0100 Subject: [PATCH 095/214] Add test for zeros --- tests/ChunkBuffer/ArraytoCoord.cpp | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/ChunkBuffer/ArraytoCoord.cpp b/tests/ChunkBuffer/ArraytoCoord.cpp index a765c5302..993dc6cc5 100644 --- a/tests/ChunkBuffer/ArraytoCoord.cpp +++ b/tests/ChunkBuffer/ArraytoCoord.cpp @@ -7,6 +7,7 @@ int main(int argc, char** argv) { { + // Test first segment cChunkBuffer buffer; BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; @@ -43,6 +44,7 @@ int main(int argc, char** argv) } { + // test following segment cChunkBuffer buffer; BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; @@ -77,5 +79,38 @@ int main(int argc, char** argv) delete SrcNibbleBuffer; SrcNibbleBuffer = NULL; } + + { + // test zeros + cChunkBuffer buffer; + + BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); + buffer.SetBlocks(SrcBlockBuffer); + testassert(buffer.GetBlock(7,24,4) == 0x00); + delete SrcBlockBuffer; + SrcBlockBuffer = NULL; + + NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + buffer.SetMeta(SrcNibbleBuffer); + testassert(buffer.GetMeta(6,24,1) == 0x0); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + buffer.SetLight(SrcNibbleBuffer); + testassert(buffer.GetBlockLight(6,24,1) == 0x0); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + + SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + buffer.SetSkyLight(SrcNibbleBuffer); + testassert(buffer.GetSkyLight(6,24,1) == 0xF); + delete SrcNibbleBuffer; + SrcNibbleBuffer = NULL; + } } From 4e841146b89523b0fe3f8f75b75c97a29b194e21 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 14:29:15 +0100 Subject: [PATCH 096/214] Fix assignment ops 2 --- src/ChunkBuffer.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index 1f170abba..66edce867 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -71,6 +71,7 @@ public: } other.IsOwner = false; } + return *this; } #else @@ -85,11 +86,15 @@ public: cChunkBuffer& operator=(const cChunkBuffer&& other) { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + if(&other != this) { - if(m_Sections[i]) Free(m_Sections[i]);; - m_Sections[i] = other.m_Sections[i]; + for (int i = 0; i < CHUNK_SECTION_NUM; i++) + { + if(m_Sections[i]) Free(m_Sections[i]);; + m_Sections[i] = other.m_Sections[i]; + } } + return *this; } #endif From 7616895eb32a90715c3a4c7762c23f0a10605db3 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sat, 17 May 2014 14:35:08 +0100 Subject: [PATCH 097/214] Fix assignment operators test --- tests/ChunkBuffer/Coordinates.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ChunkBuffer/Coordinates.cpp b/tests/ChunkBuffer/Coordinates.cpp index d4fca1e50..9eb30fa0a 100644 --- a/tests/ChunkBuffer/Coordinates.cpp +++ b/tests/ChunkBuffer/Coordinates.cpp @@ -125,10 +125,10 @@ int main(int argc, char** argv) cChunkBuffer buffer; buffer.SetBlock(0,0,0,0x42); cChunkBuffer copy; - copy = buffer; + copy = std::move(buffer); + testassert(copy.GetBlock(0,0,0) == 0x42); + copy = std::move(copy); testassert(copy.GetBlock(0,0,0) == 0x42); - copy = copy; - testassert(copy.GetBlock(0,0,0) == 0x42) } return 0; From 1f98f21dd1c1664102dfb480a69c8d1901c3ae5f Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 17 May 2014 15:11:58 +0100 Subject: [PATCH 098/214] fixed assignment bugs and Skylight bug --- src/ChunkBuffer.h | 8 +++++--- tests/ChunkBuffer/ArraytoCoord.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index 66edce867..4086c4ae9 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -76,15 +76,16 @@ public: } #else // unique_ptr style interface for memory management - cChunkBuffer(const cChunkBuffer&& other) + cChunkBuffer(cChunkBuffer&& other) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { m_Sections[i] = other.m_Sections[i]; + other.m_Sections[i] = 0; } } - cChunkBuffer& operator=(const cChunkBuffer&& other) + cChunkBuffer& operator=(cChunkBuffer&& other) { if(&other != this) { @@ -92,6 +93,7 @@ public: { if(m_Sections[i]) Free(m_Sections[i]);; m_Sections[i] = other.m_Sections[i]; + other.m_Sections[i] = 0; } } return *this; @@ -230,7 +232,7 @@ public: } else { - return 0xFF; + return 0xF; } } ASSERT(!"cChunkBuffer::GetMeta(): coords out of chunk range!"); diff --git a/tests/ChunkBuffer/ArraytoCoord.cpp b/tests/ChunkBuffer/ArraytoCoord.cpp index 993dc6cc5..5563a3f86 100644 --- a/tests/ChunkBuffer/ArraytoCoord.cpp +++ b/tests/ChunkBuffer/ArraytoCoord.cpp @@ -106,7 +106,7 @@ int main(int argc, char** argv) SrcNibbleBuffer = NULL; SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); buffer.SetSkyLight(SrcNibbleBuffer); testassert(buffer.GetSkyLight(6,24,1) == 0xF); delete SrcNibbleBuffer; From 016b8f7b993624a96f040e5d1b5e8564369b62f7 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 17 May 2014 15:19:35 +0100 Subject: [PATCH 099/214] C++11 --- tests/ChunkBuffer/Coordinates.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/ChunkBuffer/Coordinates.cpp b/tests/ChunkBuffer/Coordinates.cpp index 9eb30fa0a..bed61d5dc 100644 --- a/tests/ChunkBuffer/Coordinates.cpp +++ b/tests/ChunkBuffer/Coordinates.cpp @@ -125,9 +125,17 @@ int main(int argc, char** argv) cChunkBuffer buffer; buffer.SetBlock(0,0,0,0x42); cChunkBuffer copy; + #if __cplusplus < 201103L + copy = buffer; + #else copy = std::move(buffer); + #endif testassert(copy.GetBlock(0,0,0) == 0x42); + #if __cplusplus < 201103L + copy = copy; + #else copy = std::move(copy); + #endif testassert(copy.GetBlock(0,0,0) == 0x42); } From f451075c1f60dbea9521113269cc8e69e0730841 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 17 May 2014 15:32:28 +0100 Subject: [PATCH 100/214] derp --- src/ChunkBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index 4086c4ae9..bd178beaa 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -55,7 +55,7 @@ public: cChunkBuffer& operator=(const cChunkBuffer& other) { - if(&other == this) + if(&other != this) { if(IsOwner) { From 6951b68aaf208c7efdcc954fbc54420966fafa4a Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Sat, 17 May 2014 18:38:33 +0200 Subject: [PATCH 101/214] Added load command in the cServer class --- src/Server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Server.cpp b/src/Server.cpp index bfb1b1cbb..91bc6853e 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -476,6 +476,12 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac a_Output.Finished(); return; } + if (split[0] == "load" && !split[1].empty()) + { + cPluginManager::Get()->LoadPlugin(split[1]); + a_Output.Out("Plugin " + split[1] + " added and activated!"); + a_Output.Finished(); + } // There is currently no way a plugin can do these (and probably won't ever be): if (split[0].compare("chunkstats") == 0) From 19f4cd05470785a1afdc764b79db3777f62fe65d Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Sat, 17 May 2014 19:39:16 +0200 Subject: [PATCH 102/214] Added load cmd --- src/Server.cpp | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/Server.cpp b/src/Server.cpp index 91bc6853e..8e222b743 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -476,13 +476,34 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac a_Output.Finished(); return; } - if (split[0] == "load" && !split[1].empty()) + if (split[0] == "load") { - cPluginManager::Get()->LoadPlugin(split[1]); - a_Output.Out("Plugin " + split[1] + " added and activated!"); - a_Output.Finished(); + if (split.size() > 1) + { + cPluginManager::Get()->LoadPlugin(split[1]); + return; + } + else + { + a_Output.Out("No plugin given! Command: load "); + a_Output.Finished(); + return; + } } - + /* + * TODO: Declare unload command + if (split[0] == "unload") + { + if (split.size() > 1) + { + + } + else + { + + } + } + */ // There is currently no way a plugin can do these (and probably won't ever be): if (split[0].compare("chunkstats") == 0) { @@ -573,6 +594,9 @@ void cServer::BindBuiltInConsoleCommands(void) PlgMgr->BindConsoleCommand("restart", NULL, " - Restarts the server cleanly"); PlgMgr->BindConsoleCommand("stop", NULL, " - Stops the server cleanly"); PlgMgr->BindConsoleCommand("chunkstats", NULL, " - Displays detailed chunk memory statistics"); + PlgMgr->BindConsoleCommand("load ", NULL, " - Adds and enables the specified plugin"); + PlgMgr->BindConsoleCommand("unload ", NULL, " - Disables the specified plugin"); + #if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER) PlgMgr->BindConsoleCommand("dumpmem", NULL, " - Dumps all used memory blocks together with their callstacks into memdump.xml"); #endif From 7004043c6164c6b22346f94489cb823f9495738f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 17 May 2014 21:54:04 +0200 Subject: [PATCH 103/214] Village houses are height-adjusted onto the terrain. --- src/Generating/PieceGenerator.cpp | 11 +++++++++ src/Generating/PieceGenerator.h | 7 ++++++ src/Generating/Prefab.cpp | 12 +++++++-- src/Generating/Prefab.h | 3 +++ src/Generating/VillageGen.cpp | 41 +++++++++++++++++++++++++++---- 5 files changed, 67 insertions(+), 7 deletions(-) diff --git a/src/Generating/PieceGenerator.cpp b/src/Generating/PieceGenerator.cpp index ce19c1c95..c12559d3f 100644 --- a/src/Generating/PieceGenerator.cpp +++ b/src/Generating/PieceGenerator.cpp @@ -297,6 +297,17 @@ cPlacedPiece::cPlacedPiece(const cPlacedPiece * a_Parent, const cPiece & a_Piece +cPiece::cConnector cPlacedPiece::GetRotatedConnector(size_t a_Index) const +{ + cPiece::cConnectors Connectors = m_Piece->GetConnectors(); + ASSERT(Connectors.size() >= a_Index); + return m_Piece->RotateMoveConnector(Connectors[a_Index], m_NumCCWRotations, m_Coords.x, m_Coords.y, m_Coords.z); +} + + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cPieceGenerator: diff --git a/src/Generating/PieceGenerator.h b/src/Generating/PieceGenerator.h index 16bec3bb4..56ce996d2 100644 --- a/src/Generating/PieceGenerator.h +++ b/src/Generating/PieceGenerator.h @@ -144,6 +144,13 @@ public: const cCuboid & GetHitBox (void) const { return m_HitBox; } int GetDepth (void) const { return m_Depth; } + /** Returns the coords as a modifiable object. */ + Vector3i & GetCoords(void) { return m_Coords; } + + /** Returns the connector at the specified index, rotated in the actual placement. + Undefined behavior if a_Index is out of range. */ + cPiece::cConnector GetRotatedConnector(size_t a_Index) const; + protected: const cPlacedPiece * m_Parent; const cPiece * m_Piece; diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index 9aef7a94b..506e1c2cc 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -191,13 +191,21 @@ void cPrefab::AddRotatedBlockAreas(void) void cPrefab::Draw(cChunkDesc & a_Dest, const cPlacedPiece * a_Placement) const +{ + Draw(a_Dest, a_Placement->GetCoords(), a_Placement->GetNumCCWRotations()); +} + + + + +void cPrefab::Draw(cChunkDesc & a_Dest, const Vector3i & a_Placement, int a_NumRotations) const { // Draw the basic image: - Vector3i Placement = a_Placement->GetCoords(); + Vector3i Placement(a_Placement); int ChunkStartX = a_Dest.GetChunkX() * cChunkDef::Width; int ChunkStartZ = a_Dest.GetChunkZ() * cChunkDef::Width; Placement.Move(-ChunkStartX, 0, -ChunkStartZ); - const cBlockArea & Image = m_BlockArea[a_Placement->GetNumCCWRotations()]; + const cBlockArea & Image = m_BlockArea[a_NumRotations]; a_Dest.WriteBlockArea(Image, Placement.x, Placement.y, Placement.z, m_MergeStrategy); // If requested, draw the floor (from the bottom of the prefab down to the nearest non-air) diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h index c08413e87..2b89a204c 100644 --- a/src/Generating/Prefab.h +++ b/src/Generating/Prefab.h @@ -94,6 +94,9 @@ public: /** Draws the prefab into the specified chunk, according to the placement stored in the PlacedPiece. */ void Draw(cChunkDesc & a_Dest, const cPlacedPiece * a_Placement) const; + /** Draws the prefab into the specified chunks, according to the specified placement and rotations. */ + void Draw(cChunkDesc & a_Dest, const Vector3i & a_Placement, int a_NumRotations) const; + /** Returns true if the prefab has any connector of the specified type. */ bool HasConnectorType(int a_ConnectorType) const; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index b514a90cd..db81fb521 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -115,7 +115,9 @@ public: m_HeightGen(a_HeightGen) { cBFSPieceGenerator pg(m_Prefabs, a_Seed); - pg.PlacePieces(a_OriginX, 10, a_OriginZ, a_MaxRoadDepth + 1, m_Pieces); + // Generate the pieces at very negative Y coords, so that we can later test + // Piece has negative Y coord -> hasn't been height-adjusted yet + pg.PlacePieces(a_OriginX, -1000, a_OriginZ, a_MaxRoadDepth + 1, m_Pieces); } protected: @@ -144,16 +146,45 @@ protected: // cGrdStructGen::cStructure overrides: virtual void DrawIntoChunk(cChunkDesc & a_Chunk) override { - // TODO // Iterate over all items - // Each intersecting prefab is placed on ground (if not already placed), then drawn + // Each intersecting prefab is placed on ground, then drawn // Each intersecting road is drawn by replacing top soil blocks with gravel / sandstone blocks - for (cPlacedPieces::const_iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr) + cChunkDef::HeightMap HeightMap; // Heightmap for this chunk, used by roads + m_HeightGen.GenHeightMap(a_Chunk.GetChunkX(), a_Chunk.GetChunkZ(), HeightMap); + for (cPlacedPieces::iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr) { - const cPrefab & Prefab = (const cPrefab &)((*itr)->GetPiece()); + cPrefab & Prefab = (cPrefab &)((*itr)->GetPiece()); + if ((*itr)->GetPiece().GetSize().y == 1) + { + // It's a road, special handling (change top terrain blocks + // TODO + Prefab.Draw(a_Chunk, (*itr)->GetCoords() + Vector3i(0, 1100, 0), (*itr)->GetNumCCWRotations()); + continue; + } + if ((*itr)->GetCoords().y < 0) + { + PlacePieceOnGround(**itr); + } Prefab.Draw(a_Chunk, *itr); } // for itr - m_PlacedPieces[] } + + + /** Adjusts the Y coord of the given piece so that the piece is on the ground. + Ground level is assumed to be represented by the first connector in the piece. */ + void PlacePieceOnGround(cPlacedPiece & a_Piece) + { + cPiece::cConnector FirstConnector = a_Piece.GetRotatedConnector(0); + int ChunkX, ChunkZ; + int BlockX = FirstConnector.m_Pos.x; + int BlockZ = FirstConnector.m_Pos.z; + int BlockY; + cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ); + cChunkDef::HeightMap HeightMap; + m_HeightGen.GenHeightMap(ChunkX, ChunkZ, HeightMap); + int TerrainHeight = cChunkDef::GetHeight(HeightMap, BlockX, BlockZ); + a_Piece.GetCoords().y += TerrainHeight - FirstConnector.m_Pos.y + 1; + } } ; From a7e52e51dc3665ac2c2f27ed52e732ef7bbad32e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 17 May 2014 22:26:09 +0200 Subject: [PATCH 104/214] Village roads are drawn properly. --- src/Generating/PieceGenerator.h | 4 ++-- src/Generating/VillageGen.cpp | 39 ++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/Generating/PieceGenerator.h b/src/Generating/PieceGenerator.h index 56ce996d2..643ca58b6 100644 --- a/src/Generating/PieceGenerator.h +++ b/src/Generating/PieceGenerator.h @@ -156,8 +156,8 @@ protected: const cPiece * m_Piece; Vector3i m_Coords; int m_NumCCWRotations; - cCuboid m_HitBox; - int m_Depth; + cCuboid m_HitBox; // Hitbox of the placed piece, in world coords + int m_Depth; // Depth in the generated piece tree }; typedef std::vector cPlacedPieces; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index db81fb521..520d63029 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -104,7 +104,8 @@ public: int a_MaxRoadDepth, int a_MaxSize, cPrefabPiecePool & a_Prefabs, - cTerrainHeightGen & a_HeightGen + cTerrainHeightGen & a_HeightGen, + BLOCKTYPE a_RoadBlock ) : super(a_OriginX, a_OriginZ), m_Seed(a_Seed), @@ -112,7 +113,8 @@ public: m_MaxSize(a_MaxSize), m_Borders(a_OriginX - a_MaxSize, 0, a_OriginZ - a_MaxSize, a_OriginX + a_MaxSize, 255, a_OriginZ + a_MaxSize), m_Prefabs(a_Prefabs), - m_HeightGen(a_HeightGen) + m_HeightGen(a_HeightGen), + m_RoadBlock(a_RoadBlock) { cBFSPieceGenerator pg(m_Prefabs, a_Seed); // Generate the pieces at very negative Y coords, so that we can later test @@ -142,6 +144,9 @@ protected: /** The village pieces, placed by the generator. */ cPlacedPieces m_Pieces; + /** The block to use for the roads. */ + BLOCKTYPE m_RoadBlock; + // cGrdStructGen::cStructure overrides: virtual void DrawIntoChunk(cChunkDesc & a_Chunk) override @@ -156,9 +161,8 @@ protected: cPrefab & Prefab = (cPrefab &)((*itr)->GetPiece()); if ((*itr)->GetPiece().GetSize().y == 1) { - // It's a road, special handling (change top terrain blocks - // TODO - Prefab.Draw(a_Chunk, (*itr)->GetCoords() + Vector3i(0, 1100, 0), (*itr)->GetNumCCWRotations()); + // It's a road, special handling (change top terrain blocks to m_RoadBlock) + DrawRoad(a_Chunk, **itr, HeightMap); continue; } if ((*itr)->GetCoords().y < 0) @@ -185,6 +189,27 @@ protected: int TerrainHeight = cChunkDef::GetHeight(HeightMap, BlockX, BlockZ); a_Piece.GetCoords().y += TerrainHeight - FirstConnector.m_Pos.y + 1; } + + + /** Draws the road into the chunk. + The heightmap is not queried from the heightgen, but is given via parameter, so that it may be queried just + once for all roads in a chunk. */ + void DrawRoad(cChunkDesc & a_Chunk, cPlacedPiece & a_Road, cChunkDef::HeightMap & a_HeightMap) + { + cCuboid RoadCoords = a_Road.GetHitBox(); + RoadCoords.Sort(); + int MinX = std::max(RoadCoords.p1.x - a_Chunk.GetChunkX() * cChunkDef::Width, 0); + int MaxX = std::min(RoadCoords.p2.x - a_Chunk.GetChunkX() * cChunkDef::Width, cChunkDef::Width - 1); + int MinZ = std::max(RoadCoords.p1.z - a_Chunk.GetChunkZ() * cChunkDef::Width, 0); + int MaxZ = std::min(RoadCoords.p2.z - a_Chunk.GetChunkZ() * cChunkDef::Width, cChunkDef::Width - 1); + for (int z = MinZ; z <= MaxZ; z++) + { + for (int x = MinX; x <= MaxX; x++) + { + a_Chunk.SetBlockType(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, m_RoadBlock); + } + } + } } ; @@ -228,6 +253,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ // Check if all the biomes are village-friendly: // If just one is not, no village is created, because it's likely that an unfriendly biome is too close cVillagePiecePool * VillagePrefabs = NULL; + BLOCKTYPE RoadBlock = E_BLOCK_GRAVEL; for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) { switch (Biomes[i]) @@ -237,6 +263,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ { // These biomes allow sand villages VillagePrefabs = &g_SandVillage; + RoadBlock = E_BLOCK_SANDSTONE; break; } case biPlains: @@ -261,7 +288,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ { return cStructurePtr(); } - return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, m_MaxDepth, m_MaxSize, *VillagePrefabs, m_HeightGen)); + return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, m_MaxDepth, m_MaxSize, *VillagePrefabs, m_HeightGen, RoadBlock)); } From 8a0d3f79219a324c11930c8f22763f34e16a96f6 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 18 May 2014 15:10:12 +0100 Subject: [PATCH 105/214] Fixed issue with types not being defined for an unused parameter --- src/BlockArea.h | 1 + src/ChunkBuffer.h | 63 ---------------- src/ChunkDataCallback.h | 105 ++++++++++++++++++++++++++ src/ChunkDef.h | 40 ---------- src/ChunkMap.h | 3 +- src/ChunkSender.h | 2 +- src/WorldStorage/NBTChunkSerializer.h | 2 +- src/WorldStorage/WSSCompact.h | 2 +- 8 files changed, 111 insertions(+), 107 deletions(-) create mode 100644 src/ChunkDataCallback.h diff --git a/src/BlockArea.h b/src/BlockArea.h index 50c28aaf2..9c01719c3 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -14,6 +14,7 @@ #include "ForEachChunkProvider.h" #include "Vector3.h" +#include "ChunkDataCallback.h" diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index bd178beaa..266df2332 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -275,68 +275,5 @@ private: -/** A simple implementation of the cChunkDataCallback interface that collects all block data into a buffer -*/ -class cChunkBufferCollector : - public cChunkDataCallback -{ -public: - - cChunkBuffer m_BlockData; - -protected: - - virtual void ChunkBuffer(const cChunkBuffer & a_BlockData) override - { - m_BlockData = a_BlockData.Copy(); - } -}; - - -/** A simple implementation of the cChunkDataCallback interface that collects all block data into a single buffer -*/ -class cChunkDataCollector : -public cChunkDataCallback -{ -public: - - // Must be unsigned char instead of BLOCKTYPE or NIBBLETYPE, because it houses both. - unsigned char m_BlockData[cChunkDef::BlockDataSize]; - -protected: - - virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override - { - a_ChunkBuffer.CopyBlocks(m_BlockData); - a_ChunkBuffer.CopyMeta(m_BlockData + cChunkDef::NumBlocks); - a_ChunkBuffer.CopyLight(m_BlockData + 3 * cChunkDef::NumBlocks / 2); - a_ChunkBuffer.CopySkyLight(m_BlockData + 2 * cChunkDef::NumBlocks); - } -}; - -/** A simple implementation of the cChunkDataCallback interface that collects all block data into a separate buffers -*/ -class cChunkDataSeparateCollector : -public cChunkDataCallback -{ -public: - - cChunkDef::BlockTypes m_BlockTypes; - cChunkDef::BlockNibbles m_BlockMetas; - cChunkDef::BlockNibbles m_BlockLight; - cChunkDef::BlockNibbles m_BlockSkyLight; - -protected: - - virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override - { - a_ChunkBuffer.CopyBlocks(m_BlockTypes); - a_ChunkBuffer.CopyMeta(m_BlockMetas); - a_ChunkBuffer.CopyLight(m_BlockLight); - a_ChunkBuffer.CopySkyLight(m_BlockSkyLight); - } -} ; - - diff --git a/src/ChunkDataCallback.h b/src/ChunkDataCallback.h new file mode 100644 index 000000000..76c45040e --- /dev/null +++ b/src/ChunkDataCallback.h @@ -0,0 +1,105 @@ + + +#pragma once + + +#include "ChunkBuffer.h" + + +/** Interface class used for getting data out of a chunk using the GetAllData() function. +Implementation must use the pointers immediately and NOT store any of them for later use +The virtual methods are called in the same order as they're declared here. +*/ +class cChunkDataCallback abstract +{ +public: + + virtual ~cChunkDataCallback() {} + + /** Called before any other callbacks to inform of the current coords + (only in processes where multiple chunks can be processed, such as cWorld::ForEachChunkInRect()). + If false is returned, the chunk is skipped. + */ + virtual bool Coords(int a_ChunkX, int a_ChunkZ) { UNUSED(a_ChunkX); UNUSED(a_ChunkZ); return true; }; + + /// Called once to provide heightmap data + virtual void HeightMap(const cChunkDef::HeightMap * a_HeightMap) {UNUSED(a_HeightMap); }; + + /// Called once to provide biome data + virtual void BiomeData (const cChunkDef::BiomeMap * a_BiomeMap) {UNUSED(a_BiomeMap); }; + + /// Called once to let know if the chunk lighting is valid. Return value is ignored + virtual void LightIsValid(bool a_IsLightValid) {UNUSED(a_IsLightValid); }; + + /// Called once to export block info + virtual void ChunkBuffer (const cChunkBuffer & a_Buffer) {UNUSED(a_Buffer); }; + + /// Called for each entity in the chunk + virtual void Entity(cEntity * a_Entity) {UNUSED(a_Entity); }; + + /// Called for each blockentity in the chunk + virtual void BlockEntity(cBlockEntity * a_Entity) {UNUSED(a_Entity); }; +} ; + +/** A simple implementation of the cChunkDataCallback interface that collects all block data into a buffer +*/ +class cChunkBufferCollector : + public cChunkDataCallback +{ +public: + + cChunkBuffer m_BlockData; + +protected: + + virtual void ChunkBuffer(const cChunkBuffer & a_BlockData) override + { + m_BlockData = a_BlockData.Copy(); + } +}; + + +/** A simple implementation of the cChunkDataCallback interface that collects all block data into a single buffer +*/ +class cChunkDataCollector : +public cChunkDataCallback +{ +public: + + // Must be unsigned char instead of BLOCKTYPE or NIBBLETYPE, because it houses both. + unsigned char m_BlockData[cChunkDef::BlockDataSize]; + +protected: + + virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override + { + a_ChunkBuffer.CopyBlocks(m_BlockData); + a_ChunkBuffer.CopyMeta(m_BlockData + cChunkDef::NumBlocks); + a_ChunkBuffer.CopyLight(m_BlockData + 3 * cChunkDef::NumBlocks / 2); + a_ChunkBuffer.CopySkyLight(m_BlockData + 2 * cChunkDef::NumBlocks); + } +}; + +/** A simple implementation of the cChunkDataCallback interface that collects all block data into a separate buffers +*/ +class cChunkDataSeparateCollector : +public cChunkDataCallback +{ +public: + + cChunkDef::BlockTypes m_BlockTypes; + cChunkDef::BlockNibbles m_BlockMetas; + cChunkDef::BlockNibbles m_BlockLight; + cChunkDef::BlockNibbles m_BlockSkyLight; + +protected: + + virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override + { + a_ChunkBuffer.CopyBlocks(m_BlockTypes); + a_ChunkBuffer.CopyMeta(m_BlockMetas); + a_ChunkBuffer.CopyLight(m_BlockLight); + a_ChunkBuffer.CopySkyLight(m_BlockSkyLight); + } +} ; + diff --git a/src/ChunkDef.h b/src/ChunkDef.h index d79f4b92b..f89e16ed1 100644 --- a/src/ChunkDef.h +++ b/src/ChunkDef.h @@ -328,46 +328,6 @@ private: -class cChunkBuffer; - - -/** Interface class used for getting data out of a chunk using the GetAllData() function. -Implementation must use the pointers immediately and NOT store any of them for later use -The virtual methods are called in the same order as they're declared here. -*/ -class cChunkDataCallback abstract -{ -public: - - virtual ~cChunkDataCallback() {} - - /** Called before any other callbacks to inform of the current coords - (only in processes where multiple chunks can be processed, such as cWorld::ForEachChunkInRect()). - If false is returned, the chunk is skipped. - */ - virtual bool Coords(int a_ChunkX, int a_ChunkZ) { UNUSED(a_ChunkX); UNUSED(a_ChunkZ); return true; }; - - /// Called once to provide heightmap data - virtual void HeightMap(const cChunkDef::HeightMap * a_HeightMap) {UNUSED(a_HeightMap); }; - - /// Called once to provide biome data - virtual void BiomeData (const cChunkDef::BiomeMap * a_BiomeMap) {UNUSED(a_BiomeMap); }; - - /// Called once to let know if the chunk lighting is valid. Return value is ignored - virtual void LightIsValid(bool a_IsLightValid) {UNUSED(a_IsLightValid); }; - - /// Called once to export block info - virtual void ChunkBuffer (const cChunkBuffer & a_Buffer) {UNUSED(a_Buffer); }; - - /// Called for each entity in the chunk - virtual void Entity(cEntity * a_Entity) {UNUSED(a_Entity); }; - - /// Called for each blockentity in the chunk - virtual void BlockEntity(cBlockEntity * a_Entity) {UNUSED(a_Entity); }; -} ; - - - /** Interface class used for comparing clients of two chunks. diff --git a/src/ChunkMap.h b/src/ChunkMap.h index 9d973f2a9..c3deda088 100644 --- a/src/ChunkMap.h +++ b/src/ChunkMap.h @@ -5,7 +5,8 @@ #pragma once -#include "ChunkDef.h" + +#include "ChunkDataCallback.h" diff --git a/src/ChunkSender.h b/src/ChunkSender.h index 81b298a55..00565d7c3 100644 --- a/src/ChunkSender.h +++ b/src/ChunkSender.h @@ -27,7 +27,7 @@ Note that it may be called by world's BroadcastToChunk() if the client is still #include "OSSupport/IsThread.h" #include "ChunkDef.h" -#include "ChunkBuffer.h" +#include "ChunkDataCallback.h" diff --git a/src/WorldStorage/NBTChunkSerializer.h b/src/WorldStorage/NBTChunkSerializer.h index 6da2bc6dd..112afc27e 100644 --- a/src/WorldStorage/NBTChunkSerializer.h +++ b/src/WorldStorage/NBTChunkSerializer.h @@ -9,7 +9,7 @@ #pragma once -#include "../ChunkBuffer.h" +#include "ChunkDataCallback.h" diff --git a/src/WorldStorage/WSSCompact.h b/src/WorldStorage/WSSCompact.h index 606853a16..6c363d5ac 100644 --- a/src/WorldStorage/WSSCompact.h +++ b/src/WorldStorage/WSSCompact.h @@ -14,7 +14,7 @@ #include "WorldStorage.h" #include "../Vector3.h" #include "json/json.h" -#include "ChunkBuffer.h" +#include "ChunkDataCallback.h" From cfd3c33dfa38c946151a1c4d3ba780f7733963c0 Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Sun, 18 May 2014 17:16:02 +0200 Subject: [PATCH 106/214] Added unload command --- src/Server.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Server.cpp b/src/Server.cpp index 8e222b743..e71e728a6 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -29,6 +29,7 @@ #include #include #include +#include extern "C" { #include "zlib/zlib.h" @@ -481,6 +482,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac if (split.size() > 1) { cPluginManager::Get()->LoadPlugin(split[1]); + return; } else @@ -490,20 +492,22 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac return; } } - /* - * TODO: Declare unload command + if (split[0] == "unload") { if (split.size() > 1) { - + cPluginManager::Get()->RemovePlugin(cPluginManager::Get()->GetPlugin(split[1])); + return; } else { - + a_Output.Out("No plugin given! Command: unload "); + a_Output.Finished(); + return; } } - */ + // There is currently no way a plugin can do these (and probably won't ever be): if (split[0].compare("chunkstats") == 0) { From 40ce737a7e372b5f3aef51cad7362a199351cb27 Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Sun, 18 May 2014 17:30:21 +0200 Subject: [PATCH 107/214] removed the include --- src/Server.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Server.cpp b/src/Server.cpp index e71e728a6..aa731cdd2 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -29,7 +29,6 @@ #include #include #include -#include extern "C" { #include "zlib/zlib.h" From e09a04a23aaa14598bff6692393f4187f59d3824 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 18 May 2014 22:36:17 +0200 Subject: [PATCH 108/214] Fixed datatype truncation in Diff() template. --- src/Defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Defines.h b/src/Defines.h index b0b209934..563fc308c 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -529,7 +529,7 @@ inline float GetSpecialSignf( float a_Val ) -template inline int Diff(T a_Val1, T a_Val2) +template inline T Diff(T a_Val1, T a_Val2) { return std::abs(a_Val1 - a_Val2); } From a651c865e40ad80b52ddf69004b40a580e7069ea Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 18 May 2014 22:49:27 +0200 Subject: [PATCH 109/214] There's no "round" function in MSVC2008. --- src/Entities/Entity.cpp | 2 +- src/Entities/Player.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index c393f89fd..31ad66779 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -321,7 +321,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) m_World->BroadcastEntityAnimation(*this, 4); // Critical hit } - Player->GetStatManager().AddValue(statDamageDealt, round(a_TDI.FinalDamage * 10)); + Player->GetStatManager().AddValue(statDamageDealt, (StatValue)floor(a_TDI.FinalDamage * 10 + 0.5)); } m_Health -= (short)a_TDI.FinalDamage; diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 632c41936..c3b763278 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -838,7 +838,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI) AddFoodExhaustion(0.3f); SendHealth(); - m_Stats.AddValue(statDamageTaken, round(a_TDI.FinalDamage * 10)); + m_Stats.AddValue(statDamageTaken, (StatValue)floor(a_TDI.FinalDamage * 10 + 0.5)); return true; } return false; @@ -1953,7 +1953,7 @@ void cPlayer::HandleFloater() void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos) { - StatValue Value = round(a_DeltaPos.Length() * 100); + StatValue Value = (StatValue)floor(a_DeltaPos.Length() * 100 + 0.5); if (m_AttachedTo == NULL) { @@ -1970,7 +1970,7 @@ void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos) if ((Block == E_BLOCK_LADDER) && (a_DeltaPos.y > 0.0)) // Going up { - m_Stats.AddValue(statDistClimbed, round(a_DeltaPos.y * 100)); + m_Stats.AddValue(statDistClimbed, (StatValue)floor(a_DeltaPos.y * 100 + 0.5)); } else { From ec50c0f9e1ee59ad8e782795c46f100be79b3ed0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 18 May 2014 23:09:39 +0200 Subject: [PATCH 110/214] Updated SandVillage prefabs to latest Gallery content. This fixes sand village generation. --- src/Generating/Prefabs/SandVillagePrefabs.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Generating/Prefabs/SandVillagePrefabs.cpp b/src/Generating/Prefabs/SandVillagePrefabs.cpp index 8460ee5f7..539f57b9d 100644 --- a/src/Generating/Prefabs/SandVillagePrefabs.cpp +++ b/src/Generating/Prefabs/SandVillagePrefabs.cpp @@ -183,7 +183,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ "...........", // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 5, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -326,7 +326,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ "...........", // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 5, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -444,7 +444,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ ".............", // Connectors: - "-1: 6, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 6, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -587,7 +587,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ ".............", // Connectors: - "-1: 6, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 6, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -730,7 +730,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ "...............", // Connectors: - "-1: 6, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 6, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -873,7 +873,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ "................", // Connectors: - "-1: 9, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 9, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -984,7 +984,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ ".......", // Connectors: - "-1: 4, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 4, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1096,7 +1096,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 6 */ ".........", // Connectors: - "-1: 4, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 4, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1232,7 +1232,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 8 */ ".........", // Connectors: - "-1: 4, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 4, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1384,7 +1384,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 11 */ "mmmmmmm..adc..", // Connectors: - "-1: 8, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 8, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1552,7 +1552,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 11 */ "mmmmm...adc...", // Connectors: - "-1: 5, 0, 1: 2\n" /* Type -1, direction Z- */, + "-1: 5, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1712,7 +1712,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] = /* 5 */ ".....", // Connectors: - "-1: 2, 0, 4: 3\n" /* Type -1, direction Z+ */, + "-1: 2, 0, 5: 3\n" /* Type -1, direction Z+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ From 6167c79e7a822cb14431985a82f4cc5b463e556f Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 18 May 2014 22:41:42 +0100 Subject: [PATCH 111/214] Implemented cacti damage + Implemented cacti damage * Fixed pickup tossing (PR #994 bug) --- src/ClientHandle.cpp | 5 +++-- src/Entities/Entity.cpp | 23 +++++++++++++++++++++++ src/Entities/Entity.h | 3 +++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 1009cdbd6..6d0fae3ae 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -816,9 +816,10 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB } if ( - (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || + ((a_Status == DIG_STATUS_STARTED) || (a_Status == DIG_STATUS_FINISHED)) && // Only do a radius check for block destruction - things like pickup tossing send coordinates that are to be ignored + ((Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || - (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) + (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6)) ) { m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 4cf10a219..b7cb2c3d9 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -601,6 +601,10 @@ void cEntity::Tick(float a_Dt, cChunk & a_Chunk) m_TicksSinceLastVoidDamage = 0; } + if (IsMob() || IsPlayer() || IsPickup() || IsExpOrb()) + { + DetectCacti(); + } if (IsMob() || IsPlayer()) { // Set swimming state @@ -998,6 +1002,25 @@ void cEntity::TickInVoid(cChunk & a_Chunk) +void cEntity::DetectCacti() +{ + int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT; + if ( + ((X + 1) - GetPosX() < 0.3) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS) || + ((GetPosX() - (X - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS) || + ((Z + 1) - GetPosZ() < 0.3) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS) || + ((GetPosZ() - (Z - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS) || + (((Y > 0) && (Y < cChunkDef::Height)) && ((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))) + ) + { + TakeDamage(dtCactus, NULL, 1, 0); + } +} + + + + + void cEntity::SetSwimState(cChunk & a_Chunk) { int RelY = (int)floor(GetPosY() + 0.1); diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index df03d635b..d5e7cf5c1 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -317,6 +317,9 @@ public: /// Updates the state related to this entity being on fire virtual void TickBurning(cChunk & a_Chunk); + + /** Detects the time for application of cacti damage */ + virtual void DetectCacti(void); /// Handles when the entity is in the void virtual void TickInVoid(cChunk & a_Chunk); From 70cf4a5eafaf91f9b6d0b71f607270b7df86e6d9 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 19 May 2014 07:31:53 +0100 Subject: [PATCH 112/214] Fixed clanging errors. Please @tigerw make sure this is correct. --- src/Entities/Entity.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index b7cb2c3d9..1a91639ac 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1006,14 +1006,14 @@ void cEntity::DetectCacti() { int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT; if ( - ((X + 1) - GetPosX() < 0.3) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS) || - ((GetPosX() - (X - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS) || - ((Z + 1) - GetPosZ() < 0.3) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS) || - ((GetPosZ() - (Z - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS) || + (((X + 1) - GetPosX() < 0.3) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) || + (((GetPosX() - (X - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) || + (((Z + 1) - GetPosZ() < 0.3) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS)) || + (((GetPosZ() - (Z - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) || (((Y > 0) && (Y < cChunkDef::Height)) && ((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))) ) { - TakeDamage(dtCactus, NULL, 1, 0); + TakeDamage(dtCactusContact, NULL, 1, 0); } } From dc39d88d3f5951479084c1ea4d51079015777f01 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 19 May 2014 10:35:21 +0100 Subject: [PATCH 113/214] Should have fixed assumptions about entity width. @madmaxoft can you comment? --- src/Entities/Entity.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 1a91639ac..71b9f63a7 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1005,11 +1005,12 @@ void cEntity::TickInVoid(cChunk & a_Chunk) void cEntity::DetectCacti() { int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT; + float w = m_Width / 2 if ( - (((X + 1) - GetPosX() < 0.3) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) || - (((GetPosX() - (X - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) || - (((Z + 1) - GetPosZ() < 0.3) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS)) || - (((GetPosZ() - (Z - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) || + (((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) || + (((GetPosX() - (X - 1)) - 1 < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) || + (((Z + 1) - GetPosZ() < w) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS)) || + (((GetPosZ() - (Z - 1)) - 1 < w) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) || (((Y > 0) && (Y < cChunkDef::Height)) && ((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))) ) { From 6de0257bbe1f0c676e9cc1401298f08b96b54e73 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 19 May 2014 13:31:19 +0100 Subject: [PATCH 114/214] Derp --- src/Entities/Entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 71b9f63a7..aa671bf35 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1005,7 +1005,7 @@ void cEntity::TickInVoid(cChunk & a_Chunk) void cEntity::DetectCacti() { int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT; - float w = m_Width / 2 + float w = m_Width / 2; if ( (((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) || (((GetPosX() - (X - 1)) - 1 < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) || From 42c36429d7cd1e6c3f879b6749e18e912deefe0d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 May 2014 20:40:56 +0100 Subject: [PATCH 115/214] Added client translation to achievements --- src/CompositeChat.cpp | 22 ++++++++++++++++++++++ src/CompositeChat.h | 15 +++++++++++++++ src/Entities/Player.cpp | 8 ++++---- src/Protocol/Protocol17x.cpp | 29 +++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 4 deletions(-) diff --git a/src/CompositeChat.cpp b/src/CompositeChat.cpp index c70ef1070..d3b7595b7 100644 --- a/src/CompositeChat.cpp +++ b/src/CompositeChat.cpp @@ -189,6 +189,15 @@ void cCompositeChat::AddSuggestCommandPart(const AString & a_Text, const AString +void cCompositeChat::AddShowAchievementPart(const AString & a_PlayerName, const AString & a_Achievement, const AString & a_Style) +{ + m_Parts.push_back(new cShowAchievementPart(a_PlayerName, a_Achievement, a_Style)); +} + + + + + void cCompositeChat::ParseText(const AString & a_ParseText) { size_t len = a_ParseText.length(); @@ -476,3 +485,16 @@ cCompositeChat::cSuggestCommandPart::cSuggestCommandPart(const AString & a_Text, + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// cCompositeChat::cShowAchievementPart: + +cCompositeChat::cShowAchievementPart::cShowAchievementPart(const AString & a_PlayerName, const AString & a_Achievement, const AString & a_Style) : + super(ptShowAchievement, a_Achievement, a_Style), + m_PlayerName(a_PlayerName) +{ +} + + + + diff --git a/src/CompositeChat.h b/src/CompositeChat.h index 5b9c5f612..a0264d864 100644 --- a/src/CompositeChat.h +++ b/src/CompositeChat.h @@ -38,6 +38,7 @@ public: ptUrl, ptRunCommand, ptSuggestCommand, + ptShowAchievement, } ; class cBasePart @@ -106,6 +107,15 @@ public: public: cSuggestCommandPart(const AString & a_Text, const AString & a_Command, const AString & a_Style = ""); } ; + + class cShowAchievementPart : + public cBasePart + { + typedef cBasePart super; + public: + AString m_PlayerName; + cShowAchievementPart(const AString & a_PlayerName, const AString & a_Achievement, const AString & a_Style = ""); + } ; typedef std::vector cParts; @@ -148,6 +158,11 @@ public: /** Adds a part that suggests a command (enters it into the chat message area, but doesn't send) when clicked. The default style is underlined yellow text. */ void AddSuggestCommandPart(const AString & a_Text, const AString & a_SuggestedCommand, const AString & a_Style = "u@b"); + + /** Adds a part that fully formats a specified achievement using client translatable strings + Takes achievement name and player awarded to. Displays as {player} has earned the achievement {achievement_name}. + */ + void AddShowAchievementPart(const AString & a_PlayerName, const AString & a_Achievement, const AString & a_Style = ""); /** Parses text into various parts, adds those. Recognizes "http:" and "https:" URLs and @color-codes. */ diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index c3b763278..3a32bfb2e 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1169,8 +1169,8 @@ unsigned int cPlayer::AwardAchievement(const eStatistic a_Ach) { // First time, announce it cCompositeChat Msg; - Msg.AddTextPart(m_PlayerName + " has just earned the achievement "); - Msg.AddTextPart(cStatInfo::GetName(a_Ach)); // TODO 2014-05-12 xdot: Use the proper cCompositeChat part (cAchievement) + Msg.SetMessageType(mtSuccess); + Msg.AddShowAchievementPart(GetName(), cStatInfo::GetName(a_Ach)); m_World->BroadcastChat(Msg); // Increment the statistic @@ -1788,7 +1788,7 @@ bool cPlayer::SaveToDisk() // Save the player stats. // We use the default world name (like bukkit) because stats are shared between dimensions/worlds. - cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), m_PlayerName, &m_Stats); + cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats); if (!StatSerializer.Save()) { LOGERROR("Could not save stats for player %s", m_PlayerName.c_str()); @@ -1963,7 +1963,7 @@ void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos) BLOCKTYPE Block; NIBBLETYPE Meta; - if (!m_World->GetBlockTypeMeta(PosX, PosY, PosZ, Block, Meta)) + if ((PosY < 0) || (PosY > cChunkDef::Height) || !m_World->GetBlockTypeMeta(PosX, PosY, PosZ, Block, Meta)) { return; } diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 39feee16f..3061d132b 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -289,6 +289,35 @@ void cProtocol172::SendChat(const cCompositeChat & a_Message) AddChatPartStyle(Part, p.m_Style); break; } + + case cCompositeChat::ptShowAchievement: + { + const cCompositeChat::cShowAchievementPart & p = (const cCompositeChat::cShowAchievementPart &)**itr; + Part["translate"] = "chat.type.achievement"; + + Json::Value Ach; + Ach["action"] = "show_achievement"; + Ach["value"] = p.m_Text; + + Json::Value AchColourAndName; + AchColourAndName["color"] = "green"; + AchColourAndName["translate"] = p.m_Text; + AchColourAndName["hoverEvent"] = Ach; + + Json::Value Extra; + Extra.append(AchColourAndName); + + Json::Value Name; + Name["text"] = p.m_PlayerName; + + Json::Value With; + With.append(Name); + With.append(Extra); + + Part["with"] = With; + AddChatPartStyle(Part, p.m_Style); + break; + } } msg["extra"].append(Part); } // for itr - Parts[] From 3a9543178abb7500aff65e09f054c28200ca6cac Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 May 2014 21:16:29 +0100 Subject: [PATCH 116/214] cCompositeChat message type is now formatted --- src/ClientHandle.h | 4 ++-- src/CompositeChat.cpp | 3 ++- src/CompositeChat.h | 9 ++++++++- src/Protocol/Protocol17x.cpp | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 9f1245be5..659c67658 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -80,9 +80,9 @@ public: static AString GenerateOfflineUUID(const AString & a_Username); // tolua_export /** Formats the type of message with the proper color and prefix for sending to the client. **/ - AString FormatMessageType(bool ShouldAppendChatPrefixes, eMessageType a_ChatPrefix, const AString & a_AdditionalData); + static AString FormatMessageType(bool ShouldAppendChatPrefixes, eMessageType a_ChatPrefix, const AString & a_AdditionalData); - AString FormatChatPrefix(bool ShouldAppendChatPrefixes, AString a_ChatPrefixS, AString m_Color1, AString m_Color2); + static AString FormatChatPrefix(bool ShouldAppendChatPrefixes, AString a_ChatPrefixS, AString m_Color1, AString m_Color2); void Kick(const AString & a_Reason); // tolua_export void Authenticate(const AString & a_Name, const AString & a_UUID); // Called by cAuthenticator when the user passes authentication diff --git a/src/CompositeChat.cpp b/src/CompositeChat.cpp index d3b7595b7..a3612983a 100644 --- a/src/CompositeChat.cpp +++ b/src/CompositeChat.cpp @@ -299,9 +299,10 @@ void cCompositeChat::ParseText(const AString & a_ParseText) -void cCompositeChat::SetMessageType(eMessageType a_MessageType) +void cCompositeChat::SetMessageType(eMessageType a_MessageType, const AString & a_AdditionalMessageTypeData) { m_MessageType = a_MessageType; + m_AdditionalMessageTypeData = a_AdditionalMessageTypeData; } diff --git a/src/CompositeChat.h b/src/CompositeChat.h index a0264d864..209d9d925 100644 --- a/src/CompositeChat.h +++ b/src/CompositeChat.h @@ -47,6 +47,7 @@ public: ePartType m_PartType; AString m_Text; AString m_Style; + AString m_AdditionalStyleData; cBasePart(ePartType a_PartType, const AString & a_Text, const AString & a_Style = ""); @@ -169,7 +170,7 @@ public: void ParseText(const AString & a_ParseText); /** Sets the message type, which is indicated by prefixes added to the message when serializing. */ - void SetMessageType(eMessageType a_MessageType); + void SetMessageType(eMessageType a_MessageType, const AString & a_AdditionalMessageTypeata = ""); /** Adds the "underline" style to each part that is an URL. */ void UnderlineUrls(void); @@ -178,6 +179,9 @@ public: /** Returns the message type set previously by SetMessageType(). */ eMessageType GetMessageType(void) const { return m_MessageType; } + + /** Returns additional data pertaining to message type, for example, the name of a mtPrivateMsg sender */ + AString GetAdditionalMessageTypeData(void) const { return m_AdditionalMessageTypeData; } /** Returns the text from the parts that comprises the human-readable data. Used for older protocols that don't support composite chat @@ -199,6 +203,9 @@ protected: /** The message type, as indicated by prefixes. */ eMessageType m_MessageType; + /** Additional data pertaining to message type, for example, the name of a mtPrivateMsg sender */ + AString m_AdditionalMessageTypeData; + /** Adds a_AddStyle to a_Style; overwrites the existing style if appropriate. If the style already contains something that a_AddStyle overrides, it is erased first. */ diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 3061d132b..7c526d103 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -234,7 +234,7 @@ void cProtocol172::SendChat(const cCompositeChat & a_Message) // Compose the complete Json string to send: Json::Value msg; - msg["text"] = ""; // The client crashes without this + msg["text"] = cClientHandle::FormatMessageType(m_Client->GetPlayer()->GetWorld()->ShouldUseChatPrefixes(), a_Message.GetMessageType(), a_Message.GetAdditionalMessageTypeData()); // The client crashes without this field being present const cCompositeChat::cParts & Parts = a_Message.GetParts(); for (cCompositeChat::cParts::const_iterator itr = Parts.begin(), end = Parts.end(); itr != end; ++itr) { From 4008af692556ffb0f819c9a570267ffbaa871cad Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 May 2014 21:17:28 +0100 Subject: [PATCH 117/214] Simplified cacti conditions --- src/Entities/Entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 15f456332..ed06e76b9 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1024,9 +1024,9 @@ void cEntity::DetectCacti() float w = m_Width / 2; if ( (((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) || - (((GetPosX() - (X - 1)) - 1 < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) || + ((GetPosX() - X < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) || (((Z + 1) - GetPosZ() < w) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS)) || - (((GetPosZ() - (Z - 1)) - 1 < w) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) || + ((GetPosZ() - Z < w) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) || (((Y > 0) && (Y < cChunkDef::Height)) && ((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))) ) { From 2bfe962e2831316f651aa22c4e7b7ea68021c978 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 May 2014 22:15:39 +0100 Subject: [PATCH 118/214] Fixed a cactus Y position issue --- src/Entities/Entity.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index ed06e76b9..8a584d2ca 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1023,11 +1023,12 @@ void cEntity::DetectCacti() int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT; float w = m_Width / 2; if ( - (((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) || + ((Y > 0) && (Y < cChunkDef::Height)) && + ((((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) || ((GetPosX() - X < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) || (((Z + 1) - GetPosZ() < w) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS)) || ((GetPosZ() - Z < w) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) || - (((Y > 0) && (Y < cChunkDef::Height)) && ((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))) + (((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS)))) ) { TakeDamage(dtCactusContact, NULL, 1, 0); From 4aec5c9450180271bcac547287042d96f01eb4cd Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 20 May 2014 09:37:21 +0200 Subject: [PATCH 119/214] Fixed MCADefrag compilation. --- Tools/MCADefrag/Globals.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tools/MCADefrag/Globals.h b/Tools/MCADefrag/Globals.h index 0f31de7e3..f70a90d17 100644 --- a/Tools/MCADefrag/Globals.h +++ b/Tools/MCADefrag/Globals.h @@ -22,6 +22,15 @@ #define ALIGN_8 #define ALIGN_16 + #define FORMATSTRING(formatIndex, va_argsIndex) + + // MSVC has its own custom version of zu format + #define SIZE_T_FMT "%Iu" + #define SIZE_T_FMT_PRECISION(x) "%" #x "Iu" + #define SIZE_T_FMT_HEX "%Ix" + + #define NORETURN __declspec(noreturn) + #elif defined(__GNUC__) // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? @@ -39,6 +48,12 @@ #define stricmp strcasecmp #define FORMATSTRING(formatIndex,va_argsIndex) + + #define SIZE_T_FMT "%zu" + #define SIZE_T_FMT_PRECISION(x) "%" #x "zu" + #define SIZE_T_FMT_HEX "%zx" + + #define NORETURN __attribute((__noreturn__)) #else #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" From 507df718453483e6ca74ca897a78eed679222f06 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 20 May 2014 13:35:39 +0100 Subject: [PATCH 120/214] Update Player.cpp --- src/Entities/Player.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 3a32bfb2e..c27456397 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -377,7 +377,7 @@ short cPlayer::DeltaExperience(short a_Xp_delta) } LOGD("Player \"%s\" gained/lost %d experience, total is now: %d", - m_PlayerName.c_str(), a_Xp_delta, m_CurrentXp); + GetName().c_str(), a_Xp_delta, m_CurrentXp); // Set experience to be updated m_bDirtyExperience = true; @@ -391,7 +391,7 @@ short cPlayer::DeltaExperience(short a_Xp_delta) void cPlayer::StartChargingBow(void) { - LOGD("Player \"%s\" started charging their bow", m_PlayerName.c_str()); + LOGD("Player \"%s\" started charging their bow", GetName().c_str()); m_IsChargingBow = true; m_BowCharge = 0; } @@ -402,7 +402,7 @@ void cPlayer::StartChargingBow(void) int cPlayer::FinishChargingBow(void) { - LOGD("Player \"%s\" finished charging their bow at a charge of %d", m_PlayerName.c_str(), m_BowCharge); + LOGD("Player \"%s\" finished charging their bow at a charge of %d", GetName().c_str(), m_BowCharge); int res = m_BowCharge; m_IsChargingBow = false; m_BowCharge = 0; @@ -415,7 +415,7 @@ int cPlayer::FinishChargingBow(void) void cPlayer::CancelChargingBow(void) { - LOGD("Player \"%s\" cancelled charging their bow at a charge of %d", m_PlayerName.c_str(), m_BowCharge); + LOGD("Player \"%s\" cancelled charging their bow at a charge of %d", GetName().c_str(), m_BowCharge); m_IsChargingBow = false; m_BowCharge = 0; } @@ -1305,7 +1305,7 @@ void cPlayer::AddToGroup( const AString & a_GroupName ) { cGroup* Group = cRoot::Get()->GetGroupManager()->GetGroup( a_GroupName ); m_Groups.push_back( Group ); - LOGD("Added %s to group %s", m_PlayerName.c_str(), a_GroupName.c_str() ); + LOGD("Added %s to group %s", GetName().c_str(), a_GroupName.c_str() ); ResolveGroups(); ResolvePermissions(); } @@ -1329,13 +1329,13 @@ void cPlayer::RemoveFromGroup( const AString & a_GroupName ) if( bRemoved ) { - LOGD("Removed %s from group %s", m_PlayerName.c_str(), a_GroupName.c_str() ); + LOGD("Removed %s from group %s", GetName().c_str(), a_GroupName.c_str() ); ResolveGroups(); ResolvePermissions(); } else { - LOGWARN("Tried to remove %s from group %s but was not in that group", m_PlayerName.c_str(), a_GroupName.c_str() ); + LOGWARN("Tried to remove %s from group %s but was not in that group", GetName().c_str(), a_GroupName.c_str() ); } } @@ -1441,7 +1441,7 @@ void cPlayer::ResolveGroups() if( AllGroups.find( CurrentGroup ) != AllGroups.end() ) { LOGWARNING("ERROR: Player \"%s\" is in the group multiple times (\"%s\"). Please fix your settings in users.ini!", - m_PlayerName.c_str(), CurrentGroup->GetName().c_str() + GetName().c_str(), CurrentGroup->GetName().c_str() ); } else @@ -1453,7 +1453,7 @@ void cPlayer::ResolveGroups() { if( AllGroups.find( *itr ) != AllGroups.end() ) { - LOGERROR("ERROR: Player %s is in the same group multiple times due to inheritance (%s). FIX IT!", m_PlayerName.c_str(), (*itr)->GetName().c_str() ); + LOGERROR("ERROR: Player %s is in the same group multiple times due to inheritance (%s). FIX IT!", GetName().c_str(), (*itr)->GetName().c_str() ); continue; } ToIterate.push_back( *itr ); @@ -1605,19 +1605,19 @@ void cPlayer::LoadPermissionsFromDisk() cIniFile IniFile; if (IniFile.ReadFile("users.ini")) { - AString Groups = IniFile.GetValueSet(m_PlayerName, "Groups", "Default"); + AString Groups = IniFile.GetValueSet(GetName(), "Groups", "Default"); AStringVector Split = StringSplitAndTrim(Groups, ","); for (AStringVector::const_iterator itr = Split.begin(), end = Split.end(); itr != end; ++itr) { if (!cRoot::Get()->GetGroupManager()->ExistsGroup(*itr)) { - LOGWARNING("The group %s for player %s was not found!", itr->c_str(), m_PlayerName.c_str()); + LOGWARNING("The group %s for player %s was not found!", itr->c_str(), GetName().c_str()); } AddToGroup(*itr); } - AString Color = IniFile.GetValue(m_PlayerName, "Color", "-"); + AString Color = IniFile.GetValue(GetName(), "Color", "-"); if (!Color.empty()) { m_Color = Color[0]; @@ -1626,7 +1626,7 @@ void cPlayer::LoadPermissionsFromDisk() else { cGroupManager::GenerateDefaultUsersIni(IniFile); - IniFile.AddValue("Groups", m_PlayerName, "Default"); + IniFile.AddValue("Groups", GetName(), "Default"); AddToGroup("Default"); } IniFile.WriteFile("users.ini"); @@ -1641,14 +1641,14 @@ bool cPlayer::LoadFromDisk() LoadPermissionsFromDisk(); // Log player permissions, cause it's what the cool kids do - LOGINFO("Player %s has permissions:", m_PlayerName.c_str() ); + LOGINFO("Player %s has permissions:", GetName().c_str() ); for( PermissionMap::iterator itr = m_ResolvedPermissions.begin(); itr != m_ResolvedPermissions.end(); ++itr ) { if( itr->second ) LOG(" - %s", itr->first.c_str() ); } AString SourceFile; - Printf(SourceFile, "players/%s.json", m_PlayerName.c_str() ); + Printf(SourceFile, "players/%s.json", GetName().c_str() ); cFile f; if (!f.Open(SourceFile, cFile::fmRead)) @@ -1716,7 +1716,7 @@ bool cPlayer::LoadFromDisk() StatSerializer.Load(); LOGD("Player \"%s\" was read from file, spawning at {%.2f, %.2f, %.2f} in world \"%s\"", - m_PlayerName.c_str(), GetPosX(), GetPosY(), GetPosZ(), m_LoadedWorldName.c_str() + GetName().c_str(), GetPosX(), GetPosY(), GetPosZ(), m_LoadedWorldName.c_str() ); return true; @@ -1772,12 +1772,12 @@ bool cPlayer::SaveToDisk() std::string JsonData = writer.write(root); AString SourceFile; - Printf(SourceFile, "players/%s.json", m_PlayerName.c_str() ); + Printf(SourceFile, "players/%s.json", GetName().c_str() ); cFile f; if (!f.Open(SourceFile, cFile::fmWrite)) { - LOGERROR("ERROR WRITING PLAYER \"%s\" TO FILE \"%s\" - cannot open file", m_PlayerName.c_str(), SourceFile.c_str()); + LOGERROR("ERROR WRITING PLAYER \"%s\" TO FILE \"%s\" - cannot open file", GetName().c_str(), SourceFile.c_str()); return false; } if (f.Write(JsonData.c_str(), JsonData.size()) != (int)JsonData.size()) @@ -1791,7 +1791,7 @@ bool cPlayer::SaveToDisk() cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats); if (!StatSerializer.Save()) { - LOGERROR("Could not save stats for player %s", m_PlayerName.c_str()); + LOGERROR("Could not save stats for player %s", GetName().c_str()); return false; } From 07baf9bdd3b04e3aec6e77f367eb38c0547f54ca Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 20 May 2014 15:52:59 +0300 Subject: [PATCH 121/214] Cleaned up cPlayer::UpdateMovementStats; Wither achievements --- src/Blocks/BlockMobHead.h | 27 +++++++++++++++ src/Entities/Player.cpp | 71 ++++++++++++++++++++++++++++++-------- src/Entities/Player.h | 3 ++ src/Items/ItemFishingRod.h | 6 ++++ src/Mobs/Wither.cpp | 33 ++++++++++++++++++ src/Mobs/Wither.h | 1 + src/Statistics.cpp | 2 +- 7 files changed, 128 insertions(+), 15 deletions(-) diff --git a/src/Blocks/BlockMobHead.h b/src/Blocks/BlockMobHead.h index acd1c88fb..552c0491c 100644 --- a/src/Blocks/BlockMobHead.h +++ b/src/Blocks/BlockMobHead.h @@ -46,8 +46,29 @@ public: bool IsWither(void) const { return m_IsWither; } void Reset(void) { m_IsWither = false; } + } CallbackA, CallbackB; + class cPlayerCallback : public cPlayerListCallback + { + Vector3f m_Pos; + + virtual bool Item(cPlayer * a_Player) + { + double Dist = (a_Player->GetPosition() - m_Pos).Length(); + if (Dist < 50.0) + { + // If player is close, award achievement + a_Player->AwardAchievement(achSpawnWither); + } + return false; + } + + public: + cPlayerCallback(const Vector3f & a_Pos) : m_Pos(a_Pos) {} + + } PlayerCallback(Vector3f(a_BlockX, a_BlockY, a_BlockZ)); + a_World->DoWithMobHeadAt(a_BlockX, a_BlockY, a_BlockZ, CallbackA); if (!CallbackA.IsWither()) @@ -86,6 +107,9 @@ public: // Spawn the wither: a_World->SpawnMob(a_BlockX + 0.5, a_BlockY - 2, a_BlockZ + 0.5, cMonster::mtWither); + // Award Achievement + a_World->ForEachPlayer(PlayerCallback); + return true; } @@ -113,6 +137,9 @@ public: // Spawn the wither: a_World->SpawnMob(a_BlockX + 0.5, a_BlockY - 2, a_BlockZ + 0.5, cMonster::mtWither); + // Award Achievement + a_World->ForEachPlayer(PlayerCallback); + return true; } diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index c3b763278..0eacb67f9 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -456,8 +456,18 @@ void cPlayer::SetTouchGround(bool a_bTouchGround) else { float Dist = (float)(m_LastGroundHeight - floor(GetPosY())); + + if (Dist >= 2.0) // At least two blocks - TODO: Use m_LastJumpHeight instead of m_LastGroundHeight above + { + // Increment statistic + m_Stats.AddValue(statDistFallen, (StatValue)floor(Dist * 100 + 0.5)); + } + int Damage = (int)(Dist - 3.f); - if (m_LastJumpHeight > m_LastGroundHeight) Damage++; + if (m_LastJumpHeight > m_LastGroundHeight) + { + Damage++; + } m_LastJumpHeight = (float)GetPosY(); if (Damage > 0) @@ -1951,31 +1961,64 @@ void cPlayer::HandleFloater() +bool cPlayer::IsClimbing(void) const +{ + int PosX = POSX_TOINT; + int PosY = POSY_TOINT; + int PosZ = POSZ_TOINT; + + if ((PosY < 0) || (PosY >= cChunkDef::Height)) + { + return false; + } + + BLOCKTYPE Block = m_World->GetBlock(PosX, PosY, PosZ); + switch (Block) + { + case E_BLOCK_LADDER: + case E_BLOCK_VINES: + { + return true; + } + default: return false; + } +} + + + + + void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos) { StatValue Value = (StatValue)floor(a_DeltaPos.Length() * 100 + 0.5); if (m_AttachedTo == NULL) { - int PosX = POSX_TOINT; - int PosY = POSY_TOINT; - int PosZ = POSZ_TOINT; - - BLOCKTYPE Block; - NIBBLETYPE Meta; - if (!m_World->GetBlockTypeMeta(PosX, PosY, PosZ, Block, Meta)) + if (IsClimbing()) { - return; + if (a_DeltaPos.y > 0.0) // Going up + { + m_Stats.AddValue(statDistClimbed, (StatValue)floor(a_DeltaPos.y * 100 + 0.5)); + } } - - if ((Block == E_BLOCK_LADDER) && (a_DeltaPos.y > 0.0)) // Going up + else if (IsSubmerged()) { - m_Stats.AddValue(statDistClimbed, (StatValue)floor(a_DeltaPos.y * 100 + 0.5)); + m_Stats.AddValue(statDistDove, Value); + } + else if (IsSwimming()) + { + m_Stats.AddValue(statDistSwum, Value); + } + else if (IsOnGround()) + { + m_Stats.AddValue(statDistWalked, Value); } else { - // TODO 2014-05-12 xdot: Other types - m_Stats.AddValue(statDistWalked, Value); + if (Value >= 25) // Ignore small/slow movement + { + m_Stats.AddValue(statDistFlown, Value); + } } } else diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 78b534d83..b7cb27d6c 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -127,6 +127,9 @@ public: inline const cItem & GetEquippedItem(void) const { return GetInventory().GetEquippedItem(); } // tolua_export + /** Returns whether the player is climbing (ladders, vines e.t.c). */ + bool IsClimbing(void) const; + virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) override; // tolua_begin diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h index 0431b88b7..32c151db5 100644 --- a/src/Items/ItemFishingRod.h +++ b/src/Items/ItemFishingRod.h @@ -142,6 +142,8 @@ public: break; } } + + a_Player->GetStatManager().AddValue(statTreasureFished, 1); } else if (ItemCategory <= 14) // Junk 10% { @@ -190,6 +192,8 @@ public: { Drops.Add(cItem(E_BLOCK_TRIPWIRE_HOOK)); } + + a_Player->GetStatManager().AddValue(statJunkFished, 1); } else // Fish { @@ -210,6 +214,8 @@ public: { Drops.Add(cItem(E_ITEM_RAW_FISH, 1, E_META_RAW_FISH_FISH)); } + + a_Player->GetStatManager().AddValue(statFishCaught, 1); } if (cRoot::Get()->GetPluginManager()->CallHookPlayerFishing(*a_Player, Drops)) diff --git a/src/Mobs/Wither.cpp b/src/Mobs/Wither.cpp index 5b6e895e1..deb2cf34e 100644 --- a/src/Mobs/Wither.cpp +++ b/src/Mobs/Wither.cpp @@ -2,7 +2,9 @@ #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Wither.h" + #include "../World.h" +#include "../Entities/Player.h" @@ -100,3 +102,34 @@ void cWither::GetDrops(cItems & a_Drops, cEntity * a_Killer) + +void cWither::KilledBy(cEntity * a_Killer) +{ + UNUSED(a_Killer); + + class cPlayerCallback : public cPlayerListCallback + { + Vector3f m_Pos; + + virtual bool Item(cPlayer * a_Player) + { + double Dist = (a_Player->GetPosition() - m_Pos).Length(); + if (Dist < 50.0) + { + // If player is close, award achievement + a_Player->AwardAchievement(achKillWither); + } + return false; + } + + public: + cPlayerCallback(const Vector3f & a_Pos) : m_Pos(a_Pos) {} + + } PlayerCallback(GetPosition()); + + m_World->ForEachPlayer(PlayerCallback); +} + + + + diff --git a/src/Mobs/Wither.h b/src/Mobs/Wither.h index 08b460009..93b4f8bfc 100644 --- a/src/Mobs/Wither.h +++ b/src/Mobs/Wither.h @@ -29,6 +29,7 @@ public: virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override; virtual void Tick(float a_Dt, cChunk & a_Chunk) override; + virtual void KilledBy(cEntity * a_Killer) override; private: diff --git a/src/Statistics.cpp b/src/Statistics.cpp index 5950eb96c..5c0524f9e 100644 --- a/src/Statistics.cpp +++ b/src/Statistics.cpp @@ -52,7 +52,7 @@ cStatInfo cStatInfo::ms_Info[statCount] = { /* Type | Name */ cStatInfo(statGamesQuit, "stat.leaveGame"), cStatInfo(statMinutesPlayed, "stat.playOneMinute"), - cStatInfo(statDistWalked, "stat.walkOnCm"), + cStatInfo(statDistWalked, "stat.walkOneCm"), cStatInfo(statDistSwum, "stat.swimOneCm"), cStatInfo(statDistFallen, "stat.fallOneCm"), cStatInfo(statDistClimbed, "stat.climbOneCm"), From 576e17ae08ddd0dcff625134325bfceeab956906 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 20 May 2014 22:49:21 +0100 Subject: [PATCH 122/214] Update CompositeChat.h --- src/CompositeChat.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CompositeChat.h b/src/CompositeChat.h index 209d9d925..1ad196f1d 100644 --- a/src/CompositeChat.h +++ b/src/CompositeChat.h @@ -169,8 +169,10 @@ public: Recognizes "http:" and "https:" URLs and @color-codes. */ void ParseText(const AString & a_ParseText); - /** Sets the message type, which is indicated by prefixes added to the message when serializing. */ - void SetMessageType(eMessageType a_MessageType, const AString & a_AdditionalMessageTypeata = ""); + /** Sets the message type, which is indicated by prefixes added to the message when serializing + Takes optional AdditionalMessageTypeData to set m_AdditionalMessageTypeData. See said variable for more documentation. + */ + void SetMessageType(eMessageType a_MessageType, const AString & a_AdditionalMessageTypeData = ""); /** Adds the "underline" style to each part that is an URL. */ void UnderlineUrls(void); From 7aeb8ce9936e8ebd203d67100de8635d391bd8a1 Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 21 May 2014 10:59:14 +0300 Subject: [PATCH 123/214] Fixed cWither::KilledBy --- src/Blocks/BlockMobHead.h | 1 + src/Mobs/Wither.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Blocks/BlockMobHead.h b/src/Blocks/BlockMobHead.h index 552c0491c..b7629b07c 100644 --- a/src/Blocks/BlockMobHead.h +++ b/src/Blocks/BlockMobHead.h @@ -55,6 +55,7 @@ public: virtual bool Item(cPlayer * a_Player) { + // TODO 2014-05-21 xdot: Vanilla minecraft uses an AABB check instead of a radius one double Dist = (a_Player->GetPosition() - m_Pos).Length(); if (Dist < 50.0) { diff --git a/src/Mobs/Wither.cpp b/src/Mobs/Wither.cpp index deb2cf34e..170f4fdc0 100644 --- a/src/Mobs/Wither.cpp +++ b/src/Mobs/Wither.cpp @@ -105,7 +105,7 @@ void cWither::GetDrops(cItems & a_Drops, cEntity * a_Killer) void cWither::KilledBy(cEntity * a_Killer) { - UNUSED(a_Killer); + super::KilledBy(a_Killer); class cPlayerCallback : public cPlayerListCallback { @@ -113,6 +113,7 @@ void cWither::KilledBy(cEntity * a_Killer) virtual bool Item(cPlayer * a_Player) { + // TODO 2014-05-21 xdot: Vanilla minecraft uses an AABB check instead of a radius one double Dist = (a_Player->GetPosition() - m_Pos).Length(); if (Dist < 50.0) { From cdd3d11496d51ce6f444a2e637fee1d38e07fd09 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 21 May 2014 18:33:54 +0100 Subject: [PATCH 124/214] Fixed minor style issues --- MCServer/Plugins/Core | 2 +- src/BlockArea.cpp | 2 +- src/BlockArea.h | 4 ++-- src/Chunk.cpp | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core index 013a32a7f..5c8557d4f 160000 --- a/MCServer/Plugins/Core +++ b/MCServer/Plugins/Core @@ -1 +1 @@ -Subproject commit 013a32a7fb3c8a6cfe0aef892d4c7394d4e1be59 +Subproject commit 5c8557d4fdfa580c100510cde07a1a778ea2e244 diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index fd2f3c9b4..5e41b135c 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -1843,7 +1843,7 @@ void cBlockArea::cChunkReader::ChunkBuffer(const cChunkBuffer & a_BlockBuffer) int SizeY = m_Area.m_Size.y; int MinY = m_Origin.y; - // SizeX, SizeZ are the dmensions of the block data to copy from the current chunk (size of the geometric union) + // SizeX, SizeZ are the dimensions of the block data to copy from the current chunk (size of the geometric union) // OffX, OffZ are the offsets of the current chunk data from the area origin // BaseX, BaseZ are the offsets of the area data within the current chunk from the chunk borders int SizeX = cChunkDef::Width; diff --git a/src/BlockArea.h b/src/BlockArea.h index 9c01719c3..6b3bdf337 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -317,8 +317,8 @@ protected: void CopyNibbles(NIBBLETYPE * a_AreaDst, const NIBBLETYPE * a_ChunkSrc); // cChunkDataCallback overrides: - virtual bool Coords (int a_ChunkX, int a_ChunkZ) override; - virtual void ChunkBuffer (const cChunkBuffer & a_BlockTypes) override; + virtual bool Coords(int a_ChunkX, int a_ChunkZ) override; + virtual void ChunkBuffer(const cChunkBuffer & a_BlockTypes) override; } ; typedef NIBBLETYPE * NIBBLEARRAY; diff --git a/src/Chunk.cpp b/src/Chunk.cpp index a986ac076..00ea33e16 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -282,10 +282,10 @@ void cChunk::SetAllData( CalculateHeightmap(a_BlockTypes); } - m_ChunkBuffer.SetBlocks (a_BlockTypes); - m_ChunkBuffer.SetMeta (a_BlockMeta); - m_ChunkBuffer.SetLight (a_BlockLight); - m_ChunkBuffer.SetSkyLight (a_BlockSkyLight); + m_ChunkBuffer.SetBlocks(a_BlockTypes); + m_ChunkBuffer.SetMeta(a_BlockMeta); + m_ChunkBuffer.SetLight(a_BlockLight); + m_ChunkBuffer.SetSkyLight(a_BlockSkyLight); m_IsLightValid = (a_BlockLight != NULL) && (a_BlockSkyLight != NULL); From 024027db89ca833406147b79b7be74fc92906bbe Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 21 May 2014 19:58:48 +0100 Subject: [PATCH 125/214] Renamed cChunkBuffer to cChunkData --- src/BlockArea.cpp | 4 +- src/BlockArea.h | 2 +- src/Chunk.cpp | 38 +++++++++---------- src/Chunk.h | 12 +++--- src/{ChunkBuffer.cpp => ChunkData.cpp} | 30 +++++++-------- src/{ChunkBuffer.h => ChunkData.h} | 26 ++++++------- src/ChunkDataCallback.h | 18 ++++----- src/LightingThread.cpp | 2 +- src/WorldStorage/WSSCompact.h | 2 +- tests/CMakeLists.txt | 2 +- .../ArraytoCoord.cpp | 8 ++-- .../{ChunkBuffer => ChunkData}/CMakeLists.txt | 2 +- .../Coordinates.cpp | 10 ++--- tests/{ChunkBuffer => ChunkData}/Copies.cpp | 14 +++---- .../{ChunkBuffer => ChunkData}/creatable.cpp | 4 +- 15 files changed, 87 insertions(+), 87 deletions(-) rename src/{ChunkBuffer.cpp => ChunkData.cpp} (88%) rename src/{ChunkBuffer.h => ChunkData.h} (91%) rename tests/{ChunkBuffer => ChunkData}/ArraytoCoord.cpp (97%) rename tests/{ChunkBuffer => ChunkData}/CMakeLists.txt (91%) rename tests/{ChunkBuffer => ChunkData}/Coordinates.cpp (95%) rename tests/{ChunkBuffer => ChunkData}/Copies.cpp (97%) rename tests/{ChunkBuffer => ChunkData}/creatable.cpp (61%) diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 5e41b135c..0c46e59e5 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -9,7 +9,7 @@ #include "OSSupport/GZipFile.h" #include "Blocks/BlockHandler.h" #include "Cuboid.h" -#include "ChunkBuffer.h" +#include "ChunkData.h" @@ -1835,7 +1835,7 @@ bool cBlockArea::cChunkReader::Coords(int a_ChunkX, int a_ChunkZ) -void cBlockArea::cChunkReader::ChunkBuffer(const cChunkBuffer & a_BlockBuffer) +void cBlockArea::cChunkReader::ChunkData(const cChunkData & a_BlockBuffer) { { if (!(m_Area.m_BlockTypes == NULL)) diff --git a/src/BlockArea.h b/src/BlockArea.h index 6b3bdf337..2bd26facd 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -318,7 +318,7 @@ protected: // cChunkDataCallback overrides: virtual bool Coords(int a_ChunkX, int a_ChunkZ) override; - virtual void ChunkBuffer(const cChunkBuffer & a_BlockTypes) override; + virtual void ChunkData(const cChunkData & a_BlockTypes) override; } ; typedef NIBBLETYPE * NIBBLEARRAY; diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 00ea33e16..a45ed32c1 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -238,12 +238,12 @@ void cChunk::MarkLoadFailed(void) void cChunk::GetAllData(cChunkDataCallback & a_Callback) { - a_Callback.HeightMap (&m_HeightMap); - a_Callback.BiomeData (&m_BiomeMap); + a_Callback.HeightMap(&m_HeightMap); + a_Callback.BiomeData(&m_BiomeMap); - a_Callback.LightIsValid (m_IsLightValid); + a_Callback.LightIsValid(m_IsLightValid); - a_Callback.ChunkBuffer (m_ChunkBuffer); + a_Callback.ChunkData(m_ChunkData); for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr) { @@ -282,10 +282,10 @@ void cChunk::SetAllData( CalculateHeightmap(a_BlockTypes); } - m_ChunkBuffer.SetBlocks(a_BlockTypes); - m_ChunkBuffer.SetMeta(a_BlockMeta); - m_ChunkBuffer.SetLight(a_BlockLight); - m_ChunkBuffer.SetSkyLight(a_BlockSkyLight); + m_ChunkData.SetBlocks(a_BlockTypes); + m_ChunkData.SetMeta(a_BlockMeta); + m_ChunkData.SetLight(a_BlockLight); + m_ChunkData.SetSkyLight(a_BlockSkyLight); m_IsLightValid = (a_BlockLight != NULL) && (a_BlockSkyLight != NULL); @@ -326,9 +326,9 @@ void cChunk::SetLight( // TODO: We might get cases of wrong lighting when a chunk changes in the middle of a lighting calculation. // Postponing until we see how bad it is :) - m_ChunkBuffer.SetLight (a_BlockLight); + m_ChunkData.SetLight (a_BlockLight); - m_ChunkBuffer.SetSkyLight (a_SkyLight); + m_ChunkData.SetSkyLight (a_SkyLight); m_IsLightValid = true; } @@ -339,7 +339,7 @@ void cChunk::SetLight( void cChunk::GetBlockTypes(BLOCKTYPE * a_BlockTypes) { - m_ChunkBuffer.CopyBlocks(a_BlockTypes); + m_ChunkData.CopyBlocks(a_BlockTypes); } @@ -1507,7 +1507,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT ASSERT(IsValid()); const BLOCKTYPE OldBlockType = GetBlock(a_RelX, a_RelY, a_RelZ); - const BLOCKTYPE OldBlockMeta = m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); + const BLOCKTYPE OldBlockMeta = m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ); if ((OldBlockType == a_BlockType) && (OldBlockMeta == a_BlockMeta)) { return; @@ -1515,7 +1515,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT MarkDirty(); - m_ChunkBuffer.SetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType); + m_ChunkData.SetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType); // The client doesn't need to distinguish between stationary and nonstationary fluids: if ( @@ -1531,7 +1531,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta)); } - m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_BlockMeta); + m_ChunkData.SetMeta(a_RelX, a_RelY, a_RelZ, a_BlockMeta); // ONLY recalculate lighting if it's necessary! if ( @@ -2438,7 +2438,7 @@ BLOCKTYPE cChunk::GetBlock(int a_RelX, int a_RelY, int a_RelZ) const return 0; // Clip } - return m_ChunkBuffer.GetBlock(a_RelX, a_RelY, a_RelZ); + return m_ChunkData.GetBlock(a_RelX, a_RelY, a_RelZ); } @@ -2448,7 +2448,7 @@ BLOCKTYPE cChunk::GetBlock(int a_RelX, int a_RelY, int a_RelZ) const void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) { a_BlockType = GetBlock(a_RelX, a_RelY, a_RelZ); - a_BlockMeta = m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); + a_BlockMeta = m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ); } @@ -2458,9 +2458,9 @@ void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_ void cChunk::GetBlockInfo(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight) { a_BlockType = GetBlock(a_RelX, a_RelY, a_RelZ); - a_Meta = m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); - a_SkyLight = m_ChunkBuffer.GetSkyLight(a_RelX, a_RelY, a_RelZ); - a_BlockLight = m_ChunkBuffer.GetBlockLight(a_RelX, a_RelY, a_RelZ); + a_Meta = m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ); + a_SkyLight = m_ChunkData.GetSkyLight(a_RelX, a_RelY, a_RelZ); + a_BlockLight = m_ChunkData.GetBlockLight(a_RelX, a_RelY, a_RelZ); } diff --git a/src/Chunk.h b/src/Chunk.h index 038be42de..4f6c4cf0a 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -3,7 +3,7 @@ #include "Entities/Entity.h" #include "ChunkDef.h" -#include "ChunkBuffer.h" +#include "ChunkData.h" #include "Simulator/FireSimulator.h" #include "Simulator/SandSimulator.h" @@ -324,21 +324,21 @@ public: inline NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const { - return m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); + return m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ); } inline void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta) { if (!(GetMeta(a_RelX, a_RelY, a_RelZ) == a_Meta)) { MarkDirty(); - m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); + m_ChunkData.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, GetBlock(a_RelX, a_RelY, a_RelZ), a_Meta)); } } - inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkBuffer.GetBlockLight(a_RelX, a_RelY, a_RelZ); } - inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkBuffer.GetSkyLight(a_RelX, a_RelY, a_RelZ); } + inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkData.GetBlockLight(a_RelX, a_RelY, a_RelZ); } + inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkData.GetSkyLight(a_RelX, a_RelY, a_RelZ); } /** Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success */ bool UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const; @@ -430,7 +430,7 @@ private: cWorld * m_World; cChunkMap * m_ChunkMap; - cChunkBuffer m_ChunkBuffer; + cChunkData m_ChunkData; cChunkDef::HeightMap m_HeightMap; cChunkDef::BiomeMap m_BiomeMap; diff --git a/src/ChunkBuffer.cpp b/src/ChunkData.cpp similarity index 88% rename from src/ChunkBuffer.cpp rename to src/ChunkData.cpp index 99bcdebef..160d118ad 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkData.cpp @@ -1,10 +1,10 @@ #include "Globals.h" -#include "ChunkBuffer.h" +#include "ChunkData.h" -cChunkBuffer cChunkBuffer::Copy() const +cChunkData cChunkData::Copy() const { - cChunkBuffer copy; + cChunkData copy; for (int i = 0; i < CHUNK_SECTION_NUM; i++) { if(m_Sections[i]) @@ -20,7 +20,7 @@ cChunkBuffer cChunkBuffer::Copy() const -void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) const +void cChunkData::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) const { for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -54,7 +54,7 @@ void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length -void cChunkBuffer::CopyMeta(NIBBLETYPE * a_dest) const +void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const { for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -81,7 +81,7 @@ void cChunkBuffer::CopyMeta(NIBBLETYPE * a_dest) const -void cChunkBuffer::CopyLight(NIBBLETYPE * a_dest) const +void cChunkData::CopyLight(NIBBLETYPE * a_dest) const { for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -109,7 +109,7 @@ void cChunkBuffer::CopyLight(NIBBLETYPE * a_dest) const -void cChunkBuffer::CopySkyLight(NIBBLETYPE * a_dest) const +void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const { for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -137,7 +137,7 @@ void cChunkBuffer::CopySkyLight(NIBBLETYPE * a_dest) const -void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) +void cChunkData::SetBlocks(const BLOCKTYPE * a_src) { for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -175,7 +175,7 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src) -void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) +void cChunkData::SetMeta(const NIBBLETYPE * a_src) { for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -213,7 +213,7 @@ void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src) -void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) +void cChunkData::SetLight(const NIBBLETYPE * a_src) { if (!a_src) return; for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) @@ -252,7 +252,7 @@ void cChunkBuffer::SetLight(const NIBBLETYPE * a_src) -void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) +void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) { if (!a_src) return; for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) @@ -292,22 +292,22 @@ void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src) -cChunkBuffer::sChunkSection * cChunkBuffer::Allocate() const +cChunkData::sChunkSection * cChunkData::Allocate() const { // TODO: use a allocation pool - return new cChunkBuffer::sChunkSection; + return new cChunkData::sChunkSection; } -void cChunkBuffer::Free(cChunkBuffer::sChunkSection * ptr) const +void cChunkData::Free(cChunkData::sChunkSection * ptr) const { delete ptr; } -void cChunkBuffer::ZeroSection(cChunkBuffer::sChunkSection * ptr) const +void cChunkData::ZeroSection(cChunkData::sChunkSection * ptr) const { memset(ptr->m_BlockTypes,0x00,sizeof(ptr->m_BlockTypes)); memset(ptr->m_BlockMeta,0x00,sizeof(ptr->m_BlockMeta)); diff --git a/src/ChunkBuffer.h b/src/ChunkData.h similarity index 91% rename from src/ChunkBuffer.h rename to src/ChunkData.h index 266df2332..809f3cdf2 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkData.h @@ -17,11 +17,11 @@ // unique_ptr style interface for memory management #endif -class cChunkBuffer +class cChunkData { public: - cChunkBuffer() + cChunkData() #if __cplusplus < 201103L // auto_ptr style interface for memory management : IsOwner(true) @@ -29,7 +29,7 @@ public: { memset(m_Sections, 0, sizeof(m_Sections)); } - ~cChunkBuffer() + ~cChunkData() { #if __cplusplus < 201103L // auto_ptr style interface for memory management @@ -43,7 +43,7 @@ public: #if __cplusplus < 201103L // auto_ptr style interface for memory management - cChunkBuffer(const cChunkBuffer& other) : + cChunkData(const cChunkData& other) : IsOwner(true) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) @@ -53,7 +53,7 @@ public: other.IsOwner = false; } - cChunkBuffer& operator=(const cChunkBuffer& other) + cChunkData& operator=(const cChunkData& other) { if(&other != this) { @@ -76,7 +76,7 @@ public: } #else // unique_ptr style interface for memory management - cChunkBuffer(cChunkBuffer&& other) + cChunkData(cChunkData&& other) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -85,7 +85,7 @@ public: } } - cChunkBuffer& operator=(cChunkBuffer&& other) + cChunkData& operator=(cChunkData&& other) { if(&other != this) { @@ -125,7 +125,7 @@ public: (a_RelZ >= cChunkDef::Width) || (a_RelZ < 0) ) { - ASSERT(!"cChunkBuffer::SetMeta(): index out of range!"); + ASSERT(!"cChunkData::SetMeta(): index out of range!"); return; } @@ -163,7 +163,7 @@ public: return 0; } } - ASSERT(!"cChunkBuffer::GetMeta(): coords out of chunk range!"); + ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); return 0; } @@ -175,7 +175,7 @@ public: (a_RelZ >= cChunkDef::Width) || (a_RelZ < 0) ) { - ASSERT(!"cChunkBuffer::SetMeta(): index out of range!"); + ASSERT(!"cChunkData::SetMeta(): index out of range!"); return; } @@ -216,7 +216,7 @@ public: return 0; } } - ASSERT(!"cChunkBuffer::GetMeta(): coords out of chunk range!"); + ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); return 0; } @@ -235,11 +235,11 @@ public: return 0xF; } } - ASSERT(!"cChunkBuffer::GetMeta(): coords out of chunk range!"); + ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); return 0; } - cChunkBuffer Copy() const; + cChunkData Copy() const; void CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx = 0, size_t length = cChunkDef::NumBlocks) const; void CopyMeta (NIBBLETYPE * a_dest) const; void CopyLight (NIBBLETYPE * a_dest) const; diff --git a/src/ChunkDataCallback.h b/src/ChunkDataCallback.h index 76c45040e..340582885 100644 --- a/src/ChunkDataCallback.h +++ b/src/ChunkDataCallback.h @@ -3,7 +3,7 @@ #pragma once -#include "ChunkBuffer.h" +#include "ChunkData.h" /** Interface class used for getting data out of a chunk using the GetAllData() function. @@ -26,13 +26,13 @@ public: virtual void HeightMap(const cChunkDef::HeightMap * a_HeightMap) {UNUSED(a_HeightMap); }; /// Called once to provide biome data - virtual void BiomeData (const cChunkDef::BiomeMap * a_BiomeMap) {UNUSED(a_BiomeMap); }; + virtual void BiomeData(const cChunkDef::BiomeMap * a_BiomeMap) {UNUSED(a_BiomeMap); }; /// Called once to let know if the chunk lighting is valid. Return value is ignored virtual void LightIsValid(bool a_IsLightValid) {UNUSED(a_IsLightValid); }; /// Called once to export block info - virtual void ChunkBuffer (const cChunkBuffer & a_Buffer) {UNUSED(a_Buffer); }; + virtual void ChunkData(const cChunkData & a_Buffer) {UNUSED(a_Buffer); }; /// Called for each entity in the chunk virtual void Entity(cEntity * a_Entity) {UNUSED(a_Entity); }; @@ -43,16 +43,16 @@ public: /** A simple implementation of the cChunkDataCallback interface that collects all block data into a buffer */ -class cChunkBufferCollector : +class cChunkDataCollector : public cChunkDataCallback { public: - cChunkBuffer m_BlockData; + cChunkData m_BlockData; protected: - virtual void ChunkBuffer(const cChunkBuffer & a_BlockData) override + virtual void ChunkData(const cChunkData & a_BlockData) override { m_BlockData = a_BlockData.Copy(); } @@ -61,7 +61,7 @@ protected: /** A simple implementation of the cChunkDataCallback interface that collects all block data into a single buffer */ -class cChunkDataCollector : +class cChunkDataArrayCollector : public cChunkDataCallback { public: @@ -71,7 +71,7 @@ public: protected: - virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override + virtual void ChunkData(const cChunkData & a_ChunkBuffer) override { a_ChunkBuffer.CopyBlocks(m_BlockData); a_ChunkBuffer.CopyMeta(m_BlockData + cChunkDef::NumBlocks); @@ -94,7 +94,7 @@ public: protected: - virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override + virtual void ChunkData(const cChunkData & a_ChunkBuffer) override { a_ChunkBuffer.CopyBlocks(m_BlockTypes); a_ChunkBuffer.CopyMeta(m_BlockMetas); diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index f961e35c6..879252c34 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -18,7 +18,7 @@ class cReader : public cChunkDataCallback { - virtual void ChunkBuffer(const cChunkBuffer & a_ChunkBuffer) override + virtual void ChunkData(const cChunkData & a_ChunkBuffer) override { BLOCKTYPE * OutputRows = m_BlockTypes; int InputIdx = 0; diff --git a/src/WorldStorage/WSSCompact.h b/src/WorldStorage/WSSCompact.h index 6c363d5ac..b148005f6 100644 --- a/src/WorldStorage/WSSCompact.h +++ b/src/WorldStorage/WSSCompact.h @@ -22,7 +22,7 @@ /// Helper class for serializing a chunk into Json class cJsonChunkSerializer : - public cChunkDataCollector + public cChunkDataArrayCollector { public: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1e3a01dc8..1fbd88f04 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,4 +4,4 @@ enable_testing() include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -add_subdirectory(ChunkBuffer) +add_subdirectory(ChunkData) diff --git a/tests/ChunkBuffer/ArraytoCoord.cpp b/tests/ChunkData/ArraytoCoord.cpp similarity index 97% rename from tests/ChunkBuffer/ArraytoCoord.cpp rename to tests/ChunkData/ArraytoCoord.cpp index 5563a3f86..fe82a3a7b 100644 --- a/tests/ChunkBuffer/ArraytoCoord.cpp +++ b/tests/ChunkData/ArraytoCoord.cpp @@ -1,6 +1,6 @@ #include "TestGlobals.h" -#include "ChunkBuffer.h" +#include "ChunkData.h" @@ -8,7 +8,7 @@ int main(int argc, char** argv) { { // Test first segment - cChunkBuffer buffer; + cChunkData buffer; BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); @@ -45,7 +45,7 @@ int main(int argc, char** argv) { // test following segment - cChunkBuffer buffer; + cChunkData buffer; BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); @@ -82,7 +82,7 @@ int main(int argc, char** argv) { // test zeros - cChunkBuffer buffer; + cChunkData buffer; BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); diff --git a/tests/ChunkBuffer/CMakeLists.txt b/tests/ChunkData/CMakeLists.txt similarity index 91% rename from tests/ChunkBuffer/CMakeLists.txt rename to tests/ChunkData/CMakeLists.txt index b216b1d39..3f6653bb5 100644 --- a/tests/ChunkBuffer/CMakeLists.txt +++ b/tests/ChunkData/CMakeLists.txt @@ -4,7 +4,7 @@ enable_testing() include_directories(${CMAKE_SOURCE_DIR}/src/) -add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkBuffer.cpp) +add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkData.cpp) add_executable(creatable-exe creatable.cpp) diff --git a/tests/ChunkBuffer/Coordinates.cpp b/tests/ChunkData/Coordinates.cpp similarity index 95% rename from tests/ChunkBuffer/Coordinates.cpp rename to tests/ChunkData/Coordinates.cpp index bed61d5dc..c0c46000e 100644 --- a/tests/ChunkBuffer/Coordinates.cpp +++ b/tests/ChunkData/Coordinates.cpp @@ -1,13 +1,13 @@ #include "TestGlobals.h" -#include "ChunkBuffer.h" +#include "ChunkData.h" int main(int argc, char** argv) { { - cChunkBuffer buffer; + cChunkData buffer; // Empty chunks buffer.SetBlock(0,0,0, 0xAB); @@ -105,7 +105,7 @@ int main(int argc, char** argv) } { - cChunkBuffer buffer; + cChunkData buffer; // Zero's buffer.SetBlock(0,0,0, 0x0); @@ -122,9 +122,9 @@ int main(int argc, char** argv) { // Operator = - cChunkBuffer buffer; + cChunkData buffer; buffer.SetBlock(0,0,0,0x42); - cChunkBuffer copy; + cChunkData copy; #if __cplusplus < 201103L copy = buffer; #else diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkData/Copies.cpp similarity index 97% rename from tests/ChunkBuffer/Copies.cpp rename to tests/ChunkData/Copies.cpp index 76af81496..145ffd8e0 100644 --- a/tests/ChunkBuffer/Copies.cpp +++ b/tests/ChunkData/Copies.cpp @@ -1,18 +1,18 @@ #include "TestGlobals.h" -#include "ChunkBuffer.h" +#include "ChunkData.h" int main(int argc, char** argv) { { - cChunkBuffer buffer; + cChunkData buffer; buffer.SetBlock(3,1,4,0xDE); buffer.SetMeta(3,1,4,0xA); - cChunkBuffer copy = buffer.Copy(); + cChunkData copy = buffer.Copy(); testassert(copy.GetBlock(3,1,4) == 0xDE); testassert(copy.GetMeta(3,1,4) == 0xA); @@ -47,7 +47,7 @@ int main(int argc, char** argv) } { - cChunkBuffer buffer; + cChunkData buffer; NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) @@ -80,7 +80,7 @@ int main(int argc, char** argv) } { - cChunkBuffer buffer; + cChunkData buffer; NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) @@ -114,7 +114,7 @@ int main(int argc, char** argv) } { - cChunkBuffer buffer; + cChunkData buffer; NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) @@ -148,7 +148,7 @@ int main(int argc, char** argv) } { - cChunkBuffer buffer; + cChunkData buffer; BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); diff --git a/tests/ChunkBuffer/creatable.cpp b/tests/ChunkData/creatable.cpp similarity index 61% rename from tests/ChunkBuffer/creatable.cpp rename to tests/ChunkData/creatable.cpp index 49204c879..74025cb14 100644 --- a/tests/ChunkBuffer/creatable.cpp +++ b/tests/ChunkData/creatable.cpp @@ -1,9 +1,9 @@ #include "TestGlobals.h" -#include "ChunkBuffer.h" +#include "ChunkData.h" int main(int argc, char** argv) { - cChunkBuffer buffer; + cChunkData buffer; return 0; } From 5929ffbc40d24f4e69cf12c8495d194407547c9c Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 21 May 2014 20:08:34 +0100 Subject: [PATCH 126/214] Fixed stylistic issues --- src/BlockArea.cpp | 8 ++++---- src/Chunk.cpp | 4 ++-- src/ChunkData.cpp | 18 +++++++++--------- src/ChunkData.h | 20 ++++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 0c46e59e5..abbfca767 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -1838,7 +1838,7 @@ bool cBlockArea::cChunkReader::Coords(int a_ChunkX, int a_ChunkZ) void cBlockArea::cChunkReader::ChunkData(const cChunkData & a_BlockBuffer) { { - if (!(m_Area.m_BlockTypes == NULL)) + if (m_Area.m_BlockTypes != NULL) { int SizeY = m_Area.m_Size.y; int MinY = m_Origin.y; @@ -1901,17 +1901,17 @@ void cBlockArea::cChunkReader::ChunkData(const cChunkData & a_BlockBuffer) } } - if (m_Area.m_BlockMetas) + if (m_Area.m_BlockMetas != NULL) { a_BlockBuffer.CopyMeta(m_Area.m_BlockMetas); } - if (m_Area.m_BlockLight) + if (m_Area.m_BlockLight != NULL) { a_BlockBuffer.CopyLight(m_Area.m_BlockLight); } - if (m_Area.m_BlockSkyLight) + if (m_Area.m_BlockSkyLight != NULL) { a_BlockBuffer.CopySkyLight(m_Area.m_BlockSkyLight); } diff --git a/src/Chunk.cpp b/src/Chunk.cpp index a45ed32c1..d85b44607 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -326,9 +326,9 @@ void cChunk::SetLight( // TODO: We might get cases of wrong lighting when a chunk changes in the middle of a lighting calculation. // Postponing until we see how bad it is :) - m_ChunkData.SetLight (a_BlockLight); + m_ChunkData.SetLight(a_BlockLight); - m_ChunkData.SetSkyLight (a_SkyLight); + m_ChunkData.SetSkyLight(a_SkyLight); m_IsLightValid = true; } diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 160d118ad..7194eca92 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -7,7 +7,7 @@ cChunkData cChunkData::Copy() const cChunkData copy; for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i]) + if(m_Sections[i] == NULL) { copy.m_Sections[i] = Allocate(); *copy.m_Sections[i] = *m_Sections[i]; @@ -30,7 +30,7 @@ void cChunkData::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) { size_t tocopy = length > segment_length ? segment_length : length; length -= tocopy; - if(m_Sections[i]) + if(m_Sections[i] == NULL) { memcpy( &a_dest[i * segment_length], @@ -59,7 +59,7 @@ void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i]) + if(m_Sections[i] == NULL) { memcpy( &a_dest[i * segment_length], @@ -86,7 +86,7 @@ void cChunkData::CopyLight(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i]) + if(m_Sections[i] == NULL) { memcpy( &a_dest[i * segment_length], @@ -114,7 +114,7 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i]) + if(m_Sections[i] == NULL) { memcpy( &a_dest[i * segment_length], @@ -142,7 +142,7 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src) for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; - if (m_Sections[i]) + if (m_Sections[i] == NULL) { memcpy(&m_Sections[i]->m_BlockTypes, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length); } @@ -180,7 +180,7 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src) for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if (m_Sections[i]) + if (m_Sections[i] == NULL) { memcpy(&m_Sections[i]->m_BlockMeta, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); } @@ -219,7 +219,7 @@ void cChunkData::SetLight(const NIBBLETYPE * a_src) for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if (m_Sections[i]) + if (m_Sections[i] == NULL) { memcpy(&m_Sections[i]->m_BlockLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); } @@ -258,7 +258,7 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if (m_Sections[i]) + if (m_Sections[i] == NULL) { memcpy(&m_Sections[i]->m_BlockSkyLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); } diff --git a/src/ChunkData.h b/src/ChunkData.h index 809f3cdf2..24a437629 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -37,7 +37,7 @@ public: #endif for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i]) Free(m_Sections[i]);; + if(m_Sections[i] == NULL) Free(m_Sections[i]);; } } @@ -91,7 +91,7 @@ public: { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i]) Free(m_Sections[i]);; + Free(m_Sections[i]);; m_Sections[i] = other.m_Sections[i]; other.m_Sections[i] = 0; } @@ -106,7 +106,7 @@ public: ASSERT((a_Y >= 0) && (a_Y < cChunkDef::Height)); ASSERT((a_Z >= 0) && (a_Z < cChunkDef::Width)); int Section = a_Y / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section]) + if(m_Sections[Section] == NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * CHUNK_SECTION_HEIGHT), a_Z); return m_Sections[Section]->m_BlockTypes[Index]; @@ -130,14 +130,14 @@ public: } int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(!m_Sections[Section]) + if(m_Sections[Section] != NULL) { if(a_Block == 0x00) { return; } m_Sections[Section] = Allocate(); - if(!m_Sections[Section]) + if(m_Sections[Section] != NULL) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return; @@ -153,7 +153,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section]) + if(m_Sections[Section] == NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f; @@ -180,14 +180,14 @@ public: } int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(!m_Sections[Section]) + if(m_Sections[Section] != NULL) { if((a_Nibble & 0xf) == 0x00) { return; } m_Sections[Section] = Allocate(); - if(!m_Sections[Section]) + if(m_Sections[Section] != NULL) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return; @@ -206,7 +206,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section]) + if(m_Sections[Section] == NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; @@ -225,7 +225,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section]) + if(m_Sections[Section] == NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; From bd880603a560160d247d79a2fdeb3fbab26994f0 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 21 May 2014 20:18:09 +0100 Subject: [PATCH 127/214] Changed cChunkData::SetMeta to return a bool indicating whether the value changed --- src/Chunk.h | 6 +++--- src/ChunkData.h | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Chunk.h b/src/Chunk.h index 4f6c4cf0a..2de45919e 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -328,11 +328,11 @@ public: } inline void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta) { - if (!(GetMeta(a_RelX, a_RelY, a_RelZ) == a_Meta)) + bool hasChanged = m_ChunkData.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); + if (hasChanged) { MarkDirty(); - m_ChunkData.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); - + m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, GetBlock(a_RelX, a_RelY, a_RelZ), a_Meta)); } } diff --git a/src/ChunkData.h b/src/ChunkData.h index 24a437629..73b1e8c6a 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -167,7 +167,7 @@ public: return 0; } - void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble) + bool SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble) { if ( (a_RelX >= cChunkDef::Width) || (a_RelX < 0) || @@ -176,7 +176,7 @@ public: ) { ASSERT(!"cChunkData::SetMeta(): index out of range!"); - return; + return false; } int Section = a_RelY / CHUNK_SECTION_HEIGHT; @@ -184,21 +184,23 @@ public: { if((a_Nibble & 0xf) == 0x00) { - return; + return false; } m_Sections[Section] = Allocate(); if(m_Sections[Section] != NULL) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); - return; + return false; } ZeroSection(m_Sections[Section]); } int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + NIBBLETYPE oldval = m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4) & 0xf; m_Sections[Section]->m_BlockMeta[Index / 2] = static_cast( (m_Sections[Section]->m_BlockMeta[Index / 2] & (0xf0 >> ((Index & 1) * 4))) | // The untouched nibble ((a_Nibble & 0x0f) << ((Index & 1) * 4)) // The nibble being set ); + return oldval == a_Nibble; } NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const From 93c0dcb1feb6daebbea586e750b586ec6588bfa2 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 21 May 2014 20:26:43 +0100 Subject: [PATCH 128/214] Added space to ChunkData.cpp --- src/ChunkData.cpp | 120 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 100 insertions(+), 20 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 7194eca92..f8c4a851d 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -144,7 +144,11 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src) const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; if (m_Sections[i] == NULL) { - memcpy(&m_Sections[i]->m_BlockTypes, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length); + memcpy( + &m_Sections[i]->m_BlockTypes, + &a_src[i * segment_length], + sizeof(BLOCKTYPE) * segment_length + ); } else { @@ -159,9 +163,21 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src) &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); - memset(m_Sections[i]->m_BlockMeta,0x00,sizeof(m_Sections[i]->m_BlockMeta)); - memset(m_Sections[i]->m_BlockLight,0x00,sizeof(m_Sections[i]->m_BlockLight)); - memset(m_Sections[i]->m_BlockSkyLight,0xFF,sizeof(m_Sections[i]->m_BlockSkyLight)); + memset( + m_Sections[i]->m_BlockMeta, + 0x00, + sizeof(m_Sections[i]->m_BlockMeta) + ); + memset( + m_Sections[i]->m_BlockLight, + 0x00, + sizeof(m_Sections[i]->m_BlockLight) + ); + memset( + m_Sections[i]->m_BlockSkyLight, + 0xFF, + sizeof(m_Sections[i]->m_BlockSkyLight) + ); } else { @@ -182,7 +198,11 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src) const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] == NULL) { - memcpy(&m_Sections[i]->m_BlockMeta, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); + memcpy( + &m_Sections[i]->m_BlockMeta, + &a_src[i * segment_length], + sizeof(NIBBLETYPE) * segment_length + ); } else { @@ -197,9 +217,21 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src) &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); - memset(m_Sections[i]->m_BlockTypes,0x00,sizeof(m_Sections[i]->m_BlockTypes)); - memset(m_Sections[i]->m_BlockLight,0x00,sizeof(m_Sections[i]->m_BlockLight)); - memset(m_Sections[i]->m_BlockSkyLight,0xFF,sizeof(m_Sections[i]->m_BlockSkyLight)); + memset( + m_Sections[i]->m_BlockTypes, + 0x00, + sizeof(m_Sections[i]->m_BlockTypes) + ); + memset( + m_Sections[i]->m_BlockLight, + 0x00, + sizeof(m_Sections[i]->m_BlockLight) + ); + memset( + m_Sections[i]->m_BlockSkyLight, + 0xFF, + sizeof(m_Sections[i]->m_BlockSkyLight) + ); } else { @@ -221,7 +253,11 @@ void cChunkData::SetLight(const NIBBLETYPE * a_src) const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] == NULL) { - memcpy(&m_Sections[i]->m_BlockLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); + memcpy( + &m_Sections[i]->m_BlockLight, + &a_src[i * segment_length], + sizeof(NIBBLETYPE) * segment_length + ); } else { @@ -236,9 +272,21 @@ void cChunkData::SetLight(const NIBBLETYPE * a_src) &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); - memset(m_Sections[i]->m_BlockTypes,0x00,sizeof(m_Sections[i]->m_BlockTypes)); - memset(m_Sections[i]->m_BlockMeta,0x00,sizeof(m_Sections[i]->m_BlockMeta)); - memset(m_Sections[i]->m_BlockSkyLight,0xFF,sizeof(m_Sections[i]->m_BlockSkyLight)); + memset( + m_Sections[i]->m_BlockTypes, + 0x00, + sizeof(m_Sections[i]->m_BlockTypes) + ); + memset( + m_Sections[i]->m_BlockMeta, + 0x00, + sizeof(m_Sections[i]->m_BlockMeta) + ); + memset( + m_Sections[i]->m_BlockSkyLight, + 0xFF, + sizeof(m_Sections[i]->m_BlockSkyLight) + ); } else { @@ -260,7 +308,11 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] == NULL) { - memcpy(&m_Sections[i]->m_BlockSkyLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length); + memcpy( + &m_Sections[i]->m_BlockSkyLight, + &a_src[i * segment_length], + sizeof(NIBBLETYPE) * segment_length + ); } else { @@ -275,9 +327,21 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length ); - memset(m_Sections[i]->m_BlockTypes,0x00,sizeof(m_Sections[i]->m_BlockTypes)); - memset(m_Sections[i]->m_BlockMeta,0x00,sizeof(m_Sections[i]->m_BlockMeta)); - memset(m_Sections[i]->m_BlockLight,0x00,sizeof(m_Sections[i]->m_BlockLight)); + memset( + m_Sections[i]->m_BlockTypes, + 0x00, + sizeof(m_Sections[i]->m_BlockTypes) + ); + memset( + m_Sections[i]->m_BlockMeta, + 0x00, + sizeof(m_Sections[i]->m_BlockMeta) + ); + memset( + m_Sections[i]->m_BlockLight, + 0x00, + sizeof(m_Sections[i]->m_BlockLight) + ); } else { @@ -309,10 +373,26 @@ void cChunkData::Free(cChunkData::sChunkSection * ptr) const void cChunkData::ZeroSection(cChunkData::sChunkSection * ptr) const { - memset(ptr->m_BlockTypes,0x00,sizeof(ptr->m_BlockTypes)); - memset(ptr->m_BlockMeta,0x00,sizeof(ptr->m_BlockMeta)); - memset(ptr->m_BlockLight,0x00,sizeof(ptr->m_BlockLight)); - memset(ptr->m_BlockSkyLight,0xFF,sizeof(ptr->m_BlockSkyLight)); + memset( + ptr->m_BlockTypes, + 0x00, + sizeof(ptr->m_BlockTypes) + ); + memset( + ptr->m_BlockMeta, + 0x00, + sizeof(ptr->m_BlockMeta) + ); + memset( + ptr->m_BlockLight, + 0x00, + sizeof(ptr->m_BlockLight) + ); + memset( + ptr->m_BlockSkyLight, + 0xFF, + sizeof(ptr->m_BlockSkyLight) + ); } From 88c61a2e96af9c7d1b173c0b580cef2c348850d7 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 21 May 2014 21:18:14 +0100 Subject: [PATCH 129/214] Fixed reversed comparisons to null --- src/ChunkData.cpp | 18 +++++++++--------- src/ChunkData.h | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index f8c4a851d..0cacaf02d 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -7,7 +7,7 @@ cChunkData cChunkData::Copy() const cChunkData copy; for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i] == NULL) + if(m_Sections[i] != NULL) { copy.m_Sections[i] = Allocate(); *copy.m_Sections[i] = *m_Sections[i]; @@ -30,7 +30,7 @@ void cChunkData::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) { size_t tocopy = length > segment_length ? segment_length : length; length -= tocopy; - if(m_Sections[i] == NULL) + if(m_Sections[i] != NULL) { memcpy( &a_dest[i * segment_length], @@ -59,7 +59,7 @@ void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i] == NULL) + if(m_Sections[i] != NULL) { memcpy( &a_dest[i * segment_length], @@ -86,7 +86,7 @@ void cChunkData::CopyLight(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i] == NULL) + if(m_Sections[i] != NULL) { memcpy( &a_dest[i * segment_length], @@ -114,7 +114,7 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i] == NULL) + if(m_Sections[i] != NULL) { memcpy( &a_dest[i * segment_length], @@ -142,7 +142,7 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src) for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; - if (m_Sections[i] == NULL) + if (m_Sections[i] != NULL) { memcpy( &m_Sections[i]->m_BlockTypes, @@ -196,7 +196,7 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src) for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if (m_Sections[i] == NULL) + if (m_Sections[i] != NULL) { memcpy( &m_Sections[i]->m_BlockMeta, @@ -251,7 +251,7 @@ void cChunkData::SetLight(const NIBBLETYPE * a_src) for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if (m_Sections[i] == NULL) + if (m_Sections[i] != NULL) { memcpy( &m_Sections[i]->m_BlockLight, @@ -306,7 +306,7 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if (m_Sections[i] == NULL) + if (m_Sections[i] != NULL) { memcpy( &m_Sections[i]->m_BlockSkyLight, diff --git a/src/ChunkData.h b/src/ChunkData.h index 73b1e8c6a..51244225b 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -106,7 +106,7 @@ public: ASSERT((a_Y >= 0) && (a_Y < cChunkDef::Height)); ASSERT((a_Z >= 0) && (a_Z < cChunkDef::Width)); int Section = a_Y / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] == NULL) + if(m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * CHUNK_SECTION_HEIGHT), a_Z); return m_Sections[Section]->m_BlockTypes[Index]; @@ -130,14 +130,14 @@ public: } int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] != NULL) + if(m_Sections[Section] == NULL) { if(a_Block == 0x00) { return; } m_Sections[Section] = Allocate(); - if(m_Sections[Section] != NULL) + if(m_Sections[Section] == NULL) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return; @@ -153,7 +153,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] == NULL) + if(m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f; @@ -180,14 +180,14 @@ public: } int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] != NULL) + if(m_Sections[Section] == NULL) { if((a_Nibble & 0xf) == 0x00) { return false; } m_Sections[Section] = Allocate(); - if(m_Sections[Section] != NULL) + if(m_Sections[Section] == NULL) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return false; @@ -208,7 +208,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] == NULL) + if(m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; @@ -227,7 +227,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] == NULL) + if(m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; From 4b23472097fa2daee464b6c5d73da56a0706731c Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 21 May 2014 21:46:20 +0100 Subject: [PATCH 130/214] Fixed if spaces --- src/ChunkData.cpp | 13 +++++++------ src/ChunkData.h | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 0cacaf02d..86b0c431c 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -7,7 +7,7 @@ cChunkData cChunkData::Copy() const cChunkData copy; for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i] != NULL) + if (m_Sections[i] != NULL) { copy.m_Sections[i] = Allocate(); *copy.m_Sections[i] = *m_Sections[i]; @@ -30,7 +30,7 @@ void cChunkData::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) { size_t tocopy = length > segment_length ? segment_length : length; length -= tocopy; - if(m_Sections[i] != NULL) + if (m_Sections[i] != NULL) { memcpy( &a_dest[i * segment_length], @@ -59,12 +59,13 @@ void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i] != NULL) + if (m_Sections[i] != NULL) { memcpy( &a_dest[i * segment_length], &m_Sections[i]->m_BlockMeta, - sizeof(NIBBLETYPE) * segment_length); + sizeof(NIBBLETYPE) * segment_length + ); } else { @@ -86,7 +87,7 @@ void cChunkData::CopyLight(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i] != NULL) + if (m_Sections[i] != NULL) { memcpy( &a_dest[i * segment_length], @@ -114,7 +115,7 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; - if(m_Sections[i] != NULL) + if (m_Sections[i] != NULL) { memcpy( &a_dest[i * segment_length], diff --git a/src/ChunkData.h b/src/ChunkData.h index 51244225b..9c852ee24 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -33,11 +33,11 @@ public: { #if __cplusplus < 201103L // auto_ptr style interface for memory management - if(!IsOwner) return; + if (!IsOwner) return; #endif for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i] == NULL) Free(m_Sections[i]);; + if (m_Sections[i] == NULL) Free(m_Sections[i]);; } } @@ -55,13 +55,13 @@ public: cChunkData& operator=(const cChunkData& other) { - if(&other != this) + if (&other != this) { - if(IsOwner) + if (IsOwner) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { - if(m_Sections[i]) Free(m_Sections[i]);; + if (m_Sections[i]) Free(m_Sections[i]);; } } IsOwner = true; @@ -87,7 +87,7 @@ public: cChunkData& operator=(cChunkData&& other) { - if(&other != this) + if (&other != this) { for (int i = 0; i < CHUNK_SECTION_NUM; i++) { @@ -106,7 +106,7 @@ public: ASSERT((a_Y >= 0) && (a_Y < cChunkDef::Height)); ASSERT((a_Z >= 0) && (a_Z < cChunkDef::Width)); int Section = a_Y / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] != NULL) + if (m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * CHUNK_SECTION_HEIGHT), a_Z); return m_Sections[Section]->m_BlockTypes[Index]; @@ -130,14 +130,14 @@ public: } int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] == NULL) + if (m_Sections[Section] == NULL) { - if(a_Block == 0x00) + if (a_Block == 0x00) { return; } m_Sections[Section] = Allocate(); - if(m_Sections[Section] == NULL) + if (m_Sections[Section] == NULL) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return; @@ -153,7 +153,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] != NULL) + if (m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f; @@ -180,14 +180,14 @@ public: } int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] == NULL) + if (m_Sections[Section] == NULL) { - if((a_Nibble & 0xf) == 0x00) + if ((a_Nibble & 0xf) == 0x00) { return false; } m_Sections[Section] = Allocate(); - if(m_Sections[Section] == NULL) + if (m_Sections[Section] == NULL) { ASSERT(!"Failed to allocate a new section in Chunkbuffer"); return false; @@ -208,7 +208,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] != NULL) + if (m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; @@ -227,7 +227,7 @@ public: if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if(m_Sections[Section] != NULL) + if (m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; From efcae77828d52680f9521793520ffc4325b465b8 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 21 May 2014 23:16:43 +0200 Subject: [PATCH 131/214] Added second kind of desert village (FlatRoof). --- .../Prefabs/SandFlatRoofVillagePrefabs.cpp | 1511 +++++++++++++++++ .../Prefabs/SandFlatRoofVillagePrefabs.h | 15 + src/Generating/VillageGen.cpp | 13 +- 3 files changed, 1535 insertions(+), 4 deletions(-) create mode 100644 src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp create mode 100644 src/Generating/Prefabs/SandFlatRoofVillagePrefabs.h diff --git a/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp b/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp new file mode 100644 index 000000000..93aa405c2 --- /dev/null +++ b/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp @@ -0,0 +1,1511 @@ + +// SandFlatRoofVillagePrefabs.cpp + +// Defines the prefabs in the group SandFlatRoofVillage + +// NOTE: This file has been generated automatically by GalExport! +// Any manual changes will be overwritten by the next automatic export! + +#include "Globals.h" +#include "SandFlatRoofVillagePrefabs.h" + + + + + +const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Forge: + // The data has been exported from the gallery Desert, area index 32, ID 173, created by Aloe_vera + { + // Size: + 12, 5, 10, // SizeX = 12, SizeY = 5, SizeZ = 10 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 11, 4, 9, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 2\n" /* sandstonestairs */ + "b:128: 1\n" /* sandstonestairs */ + "c:128: 0\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e:128: 3\n" /* sandstonestairs */ + "f:171:15\n" /* carpet */ + "g: 64: 6\n" /* wooddoorblock */ + "h:171: 0\n" /* carpet */ + "i:171:14\n" /* carpet */ + "j: 61: 2\n" /* furnace */ + "k: 10: 0\n" /* lava */ + "l: 54: 2\n" /* chest */ + "m: 19: 0\n" /* sponge */ + "n: 24: 2\n" /* sandstone */ + "o: 64:12\n" /* wooddoorblock */ + "p: 50: 1\n" /* torch */ + "q:101: 0\n" /* ironbars */ + "r:128: 4\n" /* sandstonestairs */ + "s:128: 6\n" /* sandstonestairs */ + "t:128: 5\n" /* sandstonestairs */ + "u:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "aaaaaab....." + /* 1 */ "cdddddddddd." + /* 2 */ "cdddddddddd." + /* 3 */ "cdddddddddd." + /* 4 */ "cdddddddddd." + /* 5 */ "edddddddddd." + /* 6 */ ".dddddddddd." + /* 7 */ ".dddddddddd." + /* 8 */ ".dddddddddd." + /* 9 */ "............" + + // Level 1 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".d....ddddd." + /* 2 */ "......dfffd." + /* 3 */ "......ghfhd." + /* 4 */ "......diiid." + /* 5 */ ".d....dhfhd." + /* 6 */ ".djddjdfffd." + /* 7 */ ".ddkkddl..d." + /* 8 */ ".dddddddddd." + /* 9 */ "............" + + // Level 2 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".n....nn.nn." + /* 2 */ "......n...n." + /* 3 */ "......o...n." + /* 4 */ "......n....." + /* 5 */ ".n....n...n." + /* 6 */ ".n....n...n." + /* 7 */ ".n....n...n." + /* 8 */ ".nnn.nnn.nn." + /* 9 */ "............" + + // Level 3 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ ".d....ddddd." + /* 2 */ "......d...d." + /* 3 */ "......d...d." + /* 4 */ "......dp..d." + /* 5 */ ".d....d...d." + /* 6 */ ".dqqqqd...d." + /* 7 */ ".d....d...d." + /* 8 */ ".dddddddddd." + /* 9 */ "............" + + // Level 4 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "rsssssssssss" + /* 1 */ "rddddddddddt" + /* 2 */ "rddddddddddt" + /* 3 */ "rddddddddddt" + /* 4 */ "rddddddddddt" + /* 5 */ "rddddddddddt" + /* 6 */ "rddddddddddt" + /* 7 */ "rddddddddddt" + /* 8 */ "rddddddddddt" + /* 9 */ "uuuuuuuuuuut", + + // Connectors: + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Forge + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House11x7: + // The data has been exported from the gallery Desert, area index 31, ID 172, created by Aloe_vera + { + // Size: + 13, 5, 9, // SizeX = 13, SizeY = 5, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 4, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f:171: 0\n" /* carpet */ + "g:171:15\n" /* carpet */ + "h:171:14\n" /* carpet */ + "i: 24: 2\n" /* sandstone */ + "j: 64:12\n" /* wooddoorblock */ + "k: 50: 3\n" /* torch */ + "l: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 50: 2\n" /* torch */ + "o: 50: 4\n" /* torch */ + "p:128: 4\n" /* sandstonestairs */ + "q:128: 6\n" /* sandstonestairs */ + "r:128: 5\n" /* sandstonestairs */ + "s:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "..abc........" + /* 1 */ ".ddddddddddd." + /* 2 */ ".ddddddddddd." + /* 3 */ ".ddddddddddd." + /* 4 */ ".ddddddddddd." + /* 5 */ ".ddddddddddd." + /* 6 */ ".ddddddddddd." + /* 7 */ ".ddddddddddd." + /* 8 */ "............." + + // Level 1 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ ".ddedddddddd." + /* 2 */ ".dffgggggffd." + /* 3 */ ".dfghhhhhgfd." + /* 4 */ ".dfghfffhgfd." + /* 5 */ ".dfghhhhhgfd." + /* 6 */ ".dffgggggffd." + /* 7 */ ".ddddddddddd." + /* 8 */ "............." + + // Level 2 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ ".iiji.iii.ii." + /* 2 */ ".i.........i." + /* 3 */ ".i.........i." + /* 4 */ "............." + /* 5 */ ".i.........i." + /* 6 */ ".i.........i." + /* 7 */ ".ii.ii.ii.ii." + /* 8 */ "............." + + // Level 3 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ ".ddddddddddd." + /* 2 */ ".d..k..k...d." + /* 3 */ ".d.........d." + /* 4 */ ".dl.......nd." + /* 5 */ ".d.........d." + /* 6 */ ".d....o....d." + /* 7 */ ".ddddddddddd." + /* 8 */ "............." + + // Level 4 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "pqqqqqqqqqqqq" + /* 1 */ "pdddddddddddr" + /* 2 */ "pdddddddddddr" + /* 3 */ "pdddddddddddr" + /* 4 */ "pdddddddddddr" + /* 5 */ "pdddddddddddr" + /* 6 */ "pdddddddddddr" + /* 7 */ "pdddddddddddr" + /* 8 */ "ssssssssssssr", + + // Connectors: + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House11x7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House5x4: + // The data has been exported from the gallery Desert, area index 25, ID 166, created by Aloe_vera + { + // Size: + 7, 5, 6, // SizeX = 7, SizeY = 5, SizeZ = 6 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 4, 5, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f:171: 0\n" /* carpet */ + "g:171:14\n" /* carpet */ + "h: 24: 2\n" /* sandstone */ + "i: 64:12\n" /* wooddoorblock */ + "j: 50: 3\n" /* torch */ + "k:128: 4\n" /* sandstonestairs */ + "l:128: 6\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:128: 5\n" /* sandstonestairs */ + "o:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "..abc.." + /* 1 */ ".ddddd." + /* 2 */ ".ddddd." + /* 3 */ ".ddddd." + /* 4 */ ".ddddd." + /* 5 */ "......." + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ddedd." + /* 2 */ ".dfgfd." + /* 3 */ ".dfgfd." + /* 4 */ ".ddddd." + /* 5 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".hhihh." + /* 2 */ ".h...h." + /* 3 */ ".h...h." + /* 4 */ ".hh.hh." + /* 5 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ddddd." + /* 2 */ ".dj.jd." + /* 3 */ ".d...d." + /* 4 */ ".ddddd." + /* 5 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "kllllln" + /* 1 */ "kdddddn" + /* 2 */ "kdddddn" + /* 3 */ "kdddddn" + /* 4 */ "kdddddn" + /* 5 */ "oooooon", + + // Connectors: + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House5x4 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House5x5: + // The data has been exported from the gallery Desert, area index 26, ID 167, created by Aloe_vera + { + // Size: + 7, 5, 7, // SizeX = 7, SizeY = 5, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 4, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f:171: 0\n" /* carpet */ + "g:171:15\n" /* carpet */ + "h:171:14\n" /* carpet */ + "i: 24: 2\n" /* sandstone */ + "j: 64:12\n" /* wooddoorblock */ + "k: 50: 3\n" /* torch */ + "l:128: 4\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:128: 6\n" /* sandstonestairs */ + "o:128: 5\n" /* sandstonestairs */ + "p:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "..abc.." + /* 1 */ ".ddddd." + /* 2 */ ".ddddd." + /* 3 */ ".ddddd." + /* 4 */ ".ddddd." + /* 5 */ ".ddddd." + /* 6 */ "......." + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ddedd." + /* 2 */ ".dfffd." + /* 3 */ ".dghgd." + /* 4 */ ".dfffd." + /* 5 */ ".ddddd." + /* 6 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".iijii." + /* 2 */ ".i...i." + /* 3 */ "......." + /* 4 */ ".i...i." + /* 5 */ ".ii.ii." + /* 6 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ddddd." + /* 2 */ ".dk.kd." + /* 3 */ ".d...d." + /* 4 */ ".d...d." + /* 5 */ ".ddddd." + /* 6 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "lnnnnno" + /* 1 */ "ldddddo" + /* 2 */ "ldddddo" + /* 3 */ "ldddddo" + /* 4 */ "ldddddo" + /* 5 */ "ldddddo" + /* 6 */ "ppppppo", + + // Connectors: + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House5x5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House7x5: + // The data has been exported from the gallery Desert, area index 27, ID 168, created by Aloe_vera + { + // Size: + 9, 5, 7, // SizeX = 9, SizeY = 5, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 4, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f:171:14\n" /* carpet */ + "g:171: 0\n" /* carpet */ + "h:171:15\n" /* carpet */ + "i: 24: 2\n" /* sandstone */ + "j: 64:12\n" /* wooddoorblock */ + "k: 50: 3\n" /* torch */ + "l:128: 4\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:128: 6\n" /* sandstonestairs */ + "o:128: 5\n" /* sandstonestairs */ + "p:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "..abc...." + /* 1 */ ".ddddddd." + /* 2 */ ".ddddddd." + /* 3 */ ".ddddddd." + /* 4 */ ".ddddddd." + /* 5 */ ".ddddddd." + /* 6 */ "........." + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".ddedddd." + /* 2 */ ".dfffffd." + /* 3 */ ".dghhhgd." + /* 4 */ ".dfffffd." + /* 5 */ ".ddddddd." + /* 6 */ "........." + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".iiji.ii." + /* 2 */ ".i.....i." + /* 3 */ "........." + /* 4 */ ".i.....i." + /* 5 */ ".iii.iii." + /* 6 */ "........." + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ ".ddddddd." + /* 2 */ ".dk.k..d." + /* 3 */ ".d.....d." + /* 4 */ ".d.....d." + /* 5 */ ".ddddddd." + /* 6 */ "........." + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "lnnnnnnnn" + /* 1 */ "ldddddddo" + /* 2 */ "ldddddddo" + /* 3 */ "ldddddddo" + /* 4 */ "ldddddddo" + /* 5 */ "ldddddddo" + /* 6 */ "ppppppppo", + + // Connectors: + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House7x5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House8x5: + // The data has been exported from the gallery Desert, area index 28, ID 169, created by Aloe_vera + { + // Size: + 10, 5, 7, // SizeX = 10, SizeY = 5, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 4, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f:171: 0\n" /* carpet */ + "g:171:14\n" /* carpet */ + "h:171:15\n" /* carpet */ + "i: 24: 2\n" /* sandstone */ + "j: 64:12\n" /* wooddoorblock */ + "k: 50: 3\n" /* torch */ + "l:128: 4\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:128: 6\n" /* sandstonestairs */ + "o:128: 5\n" /* sandstonestairs */ + "p:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "..abc....." + /* 1 */ ".dddddddd." + /* 2 */ ".dddddddd." + /* 3 */ ".dddddddd." + /* 4 */ ".dddddddd." + /* 5 */ ".dddddddd." + /* 6 */ ".........." + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".ddeddddd." + /* 2 */ ".dfghhgfd." + /* 3 */ ".dfhffhfd." + /* 4 */ ".dfghhgfd." + /* 5 */ ".dddddddd." + /* 6 */ ".........." + + // Level 2 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".iijii.ii." + /* 2 */ ".i......i." + /* 3 */ ".........." + /* 4 */ ".i......i." + /* 5 */ ".ii.ii.ii." + /* 6 */ ".........." + + // Level 3 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".dddddddd." + /* 2 */ ".dk.k...d." + /* 3 */ ".d......d." + /* 4 */ ".d......d." + /* 5 */ ".dddddddd." + /* 6 */ ".........." + + // Level 4 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "lnnnnnnnnn" + /* 1 */ "lddddddddo" + /* 2 */ "lddddddddo" + /* 3 */ "lddddddddo" + /* 4 */ "lddddddddo" + /* 5 */ "lddddddddo" + /* 6 */ "pppppppppo", + + // Connectors: + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House8x5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House8x7: + // The data has been exported from the gallery Desert, area index 29, ID 170, created by Aloe_vera + { + // Size: + 10, 5, 9, // SizeX = 10, SizeY = 5, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 4, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f:171: 0\n" /* carpet */ + "g:171:14\n" /* carpet */ + "h:171:15\n" /* carpet */ + "i: 24: 2\n" /* sandstone */ + "j: 64:12\n" /* wooddoorblock */ + "k: 50: 3\n" /* torch */ + "l: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 50: 2\n" /* torch */ + "o:128: 4\n" /* sandstonestairs */ + "p:128: 6\n" /* sandstonestairs */ + "q:128: 5\n" /* sandstonestairs */ + "r:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "..abc....." + /* 1 */ ".dddddddd." + /* 2 */ ".dddddddd." + /* 3 */ ".dddddddd." + /* 4 */ ".dddddddd." + /* 5 */ ".dddddddd." + /* 6 */ ".dddddddd." + /* 7 */ ".dddddddd." + /* 8 */ ".........." + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".ddeddddd." + /* 2 */ ".dfghhgfd." + /* 3 */ ".dfhffhfd." + /* 4 */ ".dfhgghfd." + /* 5 */ ".dfhffhfd." + /* 6 */ ".dfghhgfd." + /* 7 */ ".dddddddd." + /* 8 */ ".........." + + // Level 2 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".iijii.ii." + /* 2 */ ".i......i." + /* 3 */ ".i......i." + /* 4 */ ".........." + /* 5 */ ".i......i." + /* 6 */ ".i......i." + /* 7 */ ".ii.ii.ii." + /* 8 */ ".........." + + // Level 3 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".dddddddd." + /* 2 */ ".d..k...d." + /* 3 */ ".d......d." + /* 4 */ ".dl....nd." + /* 5 */ ".d......d." + /* 6 */ ".d......d." + /* 7 */ ".dddddddd." + /* 8 */ ".........." + + // Level 4 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "oppppppppp" + /* 1 */ "oddddddddq" + /* 2 */ "oddddddddq" + /* 3 */ "oddddddddq" + /* 4 */ "oddddddddq" + /* 5 */ "oddddddddq" + /* 6 */ "oddddddddq" + /* 7 */ "oddddddddq" + /* 8 */ "rrrrrrrrrq", + + // Connectors: + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House8x7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // House9x7: + // The data has been exported from the gallery Desert, area index 30, ID 171, created by Aloe_vera + { + // Size: + 11, 5, 9, // SizeX = 11, SizeY = 5, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 4, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f:171: 0\n" /* carpet */ + "g:171:15\n" /* carpet */ + "h:171:14\n" /* carpet */ + "i: 24: 2\n" /* sandstone */ + "j: 64:12\n" /* wooddoorblock */ + "k: 50: 3\n" /* torch */ + "l: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 50: 2\n" /* torch */ + "o: 50: 4\n" /* torch */ + "p:128: 4\n" /* sandstonestairs */ + "q:128: 6\n" /* sandstonestairs */ + "r:128: 5\n" /* sandstonestairs */ + "s:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..abc......" + /* 1 */ ".ddddddddd." + /* 2 */ ".ddddddddd." + /* 3 */ ".ddddddddd." + /* 4 */ ".ddddddddd." + /* 5 */ ".ddddddddd." + /* 6 */ ".ddddddddd." + /* 7 */ ".ddddddddd." + /* 8 */ "..........." + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ddedddddd." + /* 2 */ ".dffgggffd." + /* 3 */ ".dfghhhgfd." + /* 4 */ ".dfghfhgfd." + /* 5 */ ".dfghhhgfd." + /* 6 */ ".dffgggffd." + /* 7 */ ".ddddddddd." + /* 8 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".iijii.iii." + /* 2 */ ".i.......i." + /* 3 */ ".i.......i." + /* 4 */ "..........." + /* 5 */ ".i.......i." + /* 6 */ ".i.......i." + /* 7 */ ".ii.iii.ii." + /* 8 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ddddddddd." + /* 2 */ ".d..k....d." + /* 3 */ ".d.......d." + /* 4 */ ".dl.....nd." + /* 5 */ ".d.......d." + /* 6 */ ".d...o...d." + /* 7 */ ".ddddddddd." + /* 8 */ "..........." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "pqqqqqqqqqq" + /* 1 */ "pdddddddddr" + /* 2 */ "pdddddddddr" + /* 3 */ "pdddddddddr" + /* 4 */ "pdddddddddr" + /* 5 */ "pdddddddddr" + /* 6 */ "pdddddddddr" + /* 7 */ "pdddddddddr" + /* 8 */ "ssssssssssr", + + // Connectors: + "-1: 3, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // House9x7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseL13x12: + // The data has been exported from the gallery Desert, area index 53, ID 345, created by jakibaki + { + // Size: + 15, 5, 14, // SizeX = 15, SizeY = 5, SizeZ = 14 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 4, 13, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e: 43: 1\n" /* doubleslab */ + "f: 64: 7\n" /* wooddoorblock */ + "g:171: 0\n" /* carpet */ + "h:171:15\n" /* carpet */ + "i:171:14\n" /* carpet */ + "j: 58: 0\n" /* workbench */ + "k: 24: 2\n" /* sandstone */ + "l: 64:12\n" /* wooddoorblock */ + "m: 19: 0\n" /* sponge */ + "n: 50: 3\n" /* torch */ + "o: 50: 1\n" /* torch */ + "p: 50: 2\n" /* torch */ + "q: 50: 4\n" /* torch */ + "r:128: 6\n" /* sandstonestairs */ + "s:128: 5\n" /* sandstonestairs */ + "t:128: 4\n" /* sandstonestairs */ + "u:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "...abc........." + /* 1 */ ".ddddddddddddd." + /* 2 */ ".ddddddddddddd." + /* 3 */ ".ddddddddddddd." + /* 4 */ ".ddddddddddddd." + /* 5 */ ".ddddddddddded." + /* 6 */ ".ddddddddddddd." + /* 7 */ ".ddddddddddddd." + /* 8 */ ".......deddddd." + /* 9 */ "mmmmmm.ddddddd." + /* 10 */ "mmmmmm.ddddddd." + /* 11 */ "mmmmmm.ddddddd." + /* 12 */ "mmmmmm.ddddddd." + /* 13 */ "..............." + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".dddfddddddddd." + /* 2 */ ".dgghhhhhhhhgd." + /* 3 */ ".dghiiiiiiiihd." + /* 4 */ ".dghiggggggihd." + /* 5 */ ".dghiiiiiigihd." + /* 6 */ ".dgghhhhhigihd." + /* 7 */ ".dddddddhigihd." + /* 8 */ ".......dhigihd." + /* 9 */ "mmmmmm.dhiiihd." + /* 10 */ "mmmmmm.dghhhgd." + /* 11 */ "mmmmmm.dggggjd." + /* 12 */ "mmmmmm.ddddddd." + /* 13 */ "..............." + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".kkklkkkk.kkkk." + /* 2 */ ".k...........k." + /* 3 */ ".k...........k." + /* 4 */ "..............." + /* 5 */ ".k...........k." + /* 6 */ ".k...........k." + /* 7 */ ".kkk.kkk.....k." + /* 8 */ ".......k.....k." + /* 9 */ "mmmmmm.k......." + /* 10 */ "mmmmmm.......k." + /* 11 */ "mmmmmm.k.....k." + /* 12 */ "mmmmmm.kkk.kkk." + /* 13 */ "..............." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".ddddddddddddd." + /* 2 */ ".d......n....d." + /* 3 */ ".d...........d." + /* 4 */ ".do..........d." + /* 5 */ ".d...........d." + /* 6 */ ".d..........pd." + /* 7 */ ".ddddddd.....d." + /* 8 */ ".......d.....d." + /* 9 */ "mmmmmm.d.....d." + /* 10 */ "mmmmmm.d.....d." + /* 11 */ "mmmmmm.d..q..d." + /* 12 */ "mmmmmm.ddddddd." + /* 13 */ "..............." + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "rrrrrrrrrrrrrrs" + /* 1 */ "tddddddddddddds" + /* 2 */ "tddddddddddddds" + /* 3 */ "tddddddddddddds" + /* 4 */ "tddddddddddddds" + /* 5 */ "tddddddddddddds" + /* 6 */ "tddddddddddddds" + /* 7 */ "tddddddddddddds" + /* 8 */ "tuuuuutddddddds" + /* 9 */ "mmmmmmtddddddds" + /* 10 */ "mmmmmmtddddddds" + /* 11 */ "mmmmmmtddddddds" + /* 12 */ "mmmmmmtddddddds" + /* 13 */ "......tuuuuuuuu", + + // Connectors: + "-1: 4, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseL13x12 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MarketStall: + // The data has been exported from the gallery Desert, area index 34, ID 175, created by Aloe_vera + { + // Size: + 7, 5, 7, // SizeX = 7, SizeY = 5, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 4, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 85: 0\n" /* fence */ + "b:171:14\n" /* carpet */ + "c:171:15\n" /* carpet */ + "d:171: 0\n" /* carpet */ + "e: 35:14\n" /* wool */ + "f: 35: 0\n" /* wool */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "a.....a" + /* 1 */ "bccdccb" + /* 2 */ "bcdddcb" + /* 3 */ "bcdddcb" + /* 4 */ "bccdccb" + /* 5 */ "a.....a" + /* 6 */ "......." + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "a.....a" + /* 1 */ "......." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ "a.....a" + /* 6 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "a.....a" + /* 1 */ "......." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ "a.....a" + /* 6 */ "efefefe" + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "efefefe" + /* 1 */ "......." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ "efefefe" + /* 6 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "efefefe" + /* 2 */ "efefefe" + /* 3 */ "efefefe" + /* 4 */ "efefefe" + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "-1: 2, -1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // MarketStall + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Marketplace: + // The data has been exported from the gallery Desert, area index 38, ID 261, created by Aloe_vera + { + // Size: + 14, 4, 16, // SizeX = 14, SizeY = 4, SizeZ = 16 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 13, 3, 15, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 24: 0\n" /* sandstone */ + "b: 12: 0\n" /* sand */ + "c: 24: 2\n" /* sandstone */ + "d: 12: 2\n" /* sand */ + "e: 85: 0\n" /* fence */ + "f: 5: 0\n" /* wood */ + "g:128: 2\n" /* sandstonestairs */ + "h:128: 0\n" /* sandstonestairs */ + "i: 8: 0\n" /* water */ + "j:128: 1\n" /* sandstonestairs */ + "k:128: 3\n" /* sandstonestairs */ + "l: 35: 0\n" /* wool */ + "m: 19: 0\n" /* sponge */ + "n: 35:14\n" /* wool */, + + // Block data: + // Level 0 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ "aaaabbbaaabbbb" + /* 1 */ "aaaabbaabbabbb" + /* 2 */ "aababbabcabbbb" + /* 3 */ "aaaaabaaaaabbb" + /* 4 */ "bbbbbbbbbbbbbb" + /* 5 */ "bbbbbbbbbbaabb" + /* 6 */ "bbbbccccbbabab" + /* 7 */ "ccbbccccbbaaab" + /* 8 */ "ccbbccccbbabbb" + /* 9 */ "dcbbccccbbabaa" + /* 10 */ "ccbbbbbbbbaaba" + /* 11 */ "ccbbbbbbbbabaa" + /* 12 */ "bbbbbbbbbbabaa" + /* 13 */ "bbbaababbbaaba" + /* 14 */ "bbbcaaaabbabbb" + /* 15 */ "bbbcccabbbabbb" + + // Level 1 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ "e...e.e...e..." + /* 1 */ ".............." + /* 2 */ ".............." + /* 3 */ "fffff.fffff..." + /* 4 */ ".............." + /* 5 */ "..........f..e" + /* 6 */ "....gggg..f..." + /* 7 */ ".f..hiij..f..." + /* 8 */ ".f..hiij..f..." + /* 9 */ ".f..kkkk..f..e" + /* 10 */ ".f............" + /* 11 */ ".f........f..e" + /* 12 */ "...fffff..f..." + /* 13 */ "..........f..." + /* 14 */ "..........f..." + /* 15 */ "...e...e..f..e" + + // Level 2 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ "lnlnl.lnlnl..." + /* 1 */ ".............." + /* 2 */ ".............." + /* 3 */ "e...e.e...e..." + /* 4 */ ".............." + /* 5 */ "..........e..l" + /* 6 */ ".............n" + /* 7 */ ".e...........l" + /* 8 */ ".............n" + /* 9 */ "..........e..l" + /* 10 */ ".............." + /* 11 */ ".e........e..l" + /* 12 */ "...e...e.....n" + /* 13 */ ".............l" + /* 14 */ ".............n" + /* 15 */ "...lnlnl..e..l" + + // Level 3 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ "lnlnl.lnlnl..." + /* 2 */ "lnlnl.lnlnl..." + /* 3 */ "lnlnl.lnlnl..." + /* 4 */ ".............." + /* 5 */ "..........lll." + /* 6 */ "..........nnn." + /* 7 */ "ll........lll." + /* 8 */ "nn........nnn." + /* 9 */ "ll........lll." + /* 10 */ "nn............" + /* 11 */ "ll........lll." + /* 12 */ "...lnlnl..nnn." + /* 13 */ "...lnlnl..lll." + /* 14 */ "...lnlnl..nnn." + /* 15 */ "..........lll.", + + // Connectors: + "-1: 5, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Marketplace +}; // g_SandFlatRoofVillagePrefabs + + + + + + +const cPrefab::sDef g_SandFlatRoofVillageStartingPrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Well: + // The data has been exported from the gallery Desert, area index 44, ID 275, created by Aloe_vera + { + // Size: + 5, 16, 5, // SizeX = 5, SizeY = 16, SizeZ = 5 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 15, 4, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 1: 0\n" /* stone */ + "b: 24: 0\n" /* sandstone */ + "c: 8: 0\n" /* water */ + "d:128: 2\n" /* sandstonestairs */ + "e:128: 0\n" /* sandstonestairs */ + "f:128: 1\n" /* sandstonestairs */ + "g:128: 3\n" /* sandstonestairs */ + "h:128: 6\n" /* sandstonestairs */ + "i:128: 4\n" /* sandstonestairs */ + "j:128: 5\n" /* sandstonestairs */ + "k:128: 7\n" /* sandstonestairs */ + "l: 44: 1\n" /* step */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "abbba" + /* 2 */ "abbba" + /* 3 */ "abbba" + /* 4 */ "aaaaa" + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 4 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 5 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 6 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 7 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 8 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcbcb" + /* 2 */ "bbcbb" + /* 3 */ "bcbcb" + /* 4 */ "bbbbb" + + // Level 9 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcbcb" + /* 2 */ "bbbbb" + /* 3 */ "bcbcb" + /* 4 */ "bbbbb" + + // Level 10 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcbcb" + /* 2 */ "bbbbb" + /* 3 */ "bcbcb" + /* 4 */ "bbbbb" + + // Level 11 + /* z\x* 01234 */ + /* 0 */ "ddddd" + /* 1 */ "ecccf" + /* 2 */ "ecbcf" + /* 3 */ "ecccf" + /* 4 */ "ggggf" + + // Level 12 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "..b.." + /* 3 */ "....." + /* 4 */ "....." + + // Level 13 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "..b.." + /* 3 */ "....." + /* 4 */ "....." + + // Level 14 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ ".hhh." + /* 2 */ ".ibj." + /* 3 */ ".kkj." + /* 4 */ "....." + + // Level 15 + /* z\x* 01234 */ + /* 0 */ "lllll" + /* 1 */ "lllll" + /* 2 */ "lllll" + /* 3 */ "lllll" + /* 4 */ "lllll", + + // Connectors: + "2: 4, 11, 2: 5\n" /* Type 2, direction X+ */ + "2: 2, 11, 4: 3\n" /* Type 2, direction Z+ */ + "2: 0, 11, 2: 4\n" /* Type 2, direction X- */ + "2: 2, 11, 0: 2\n" /* Type 2, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Well +}; + + + + + +// The prefab counts: + +const size_t g_SandFlatRoofVillagePrefabsCount = ARRAYCOUNT(g_SandFlatRoofVillagePrefabs); + +const size_t g_SandFlatRoofVillageStartingPrefabsCount = ARRAYCOUNT(g_SandFlatRoofVillageStartingPrefabs); + diff --git a/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.h b/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.h new file mode 100644 index 000000000..ea06de5b5 --- /dev/null +++ b/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.h @@ -0,0 +1,15 @@ + +// SandFlatRoofVillagePrefabs.h + +// Declares the prefabs in the group SandFlatRoofVillage + +#include "../Prefab.h" + + + + + +extern const cPrefab::sDef g_SandFlatRoofVillagePrefabs[]; +extern const cPrefab::sDef g_SandFlatRoofVillageStartingPrefabs[]; +extern const size_t g_SandFlatRoofVillagePrefabsCount; +extern const size_t g_SandFlatRoofVillageStartingPrefabsCount; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index 520d63029..862aa966f 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -7,6 +7,7 @@ #include "VillageGen.h" #include "Prefabs/PlainsVillagePrefabs.h" #include "Prefabs/SandVillagePrefabs.h" +#include "Prefabs/SandFlatRoofVillagePrefabs.h" #include "PieceGenerator.h" @@ -25,8 +26,8 @@ the roads and houses are then used as the following pieces. Only the houses are though, the roads are generated by code and their content is ignored. A special subclass of the cPiecePool class is used, so that the roads connect to each other and to the well only in predefined manners. -The well has connectors of type "1". The houses have connectors of type "-1". The roads have connectors of -both types, type "-1" at the far ends and type "1" on the long edges. +The well has connectors of type "2". The houses have connectors of type "-1". The roads have connectors of +both types' opposites, type "-2" at the far ends and type "1" on the long edges. When the village is about to be drawn into a chunk, it queries the heights for each piece intersecting the chunk. The pieces are shifted so that their pivot points lie on the surface, and the roads are drawn @@ -220,7 +221,10 @@ protected: // cVillageGen: /** The prefabs for the sand village. */ -static cVillagePiecePool g_SandVillage (g_SandVillagePrefabs, g_SandVillagePrefabsCount, g_SandVillageStartingPrefabs, g_SandVillageStartingPrefabsCount); +static cVillagePiecePool g_SandVillage(g_SandVillagePrefabs, g_SandVillagePrefabsCount, g_SandVillageStartingPrefabs, g_SandVillageStartingPrefabsCount); + +/** The prefabs for the flat-roofed sand village. */ +static cVillagePiecePool g_SandFlatRoofVillage(g_SandFlatRoofVillagePrefabs, g_SandFlatRoofVillagePrefabsCount, g_SandFlatRoofVillageStartingPrefabs, g_SandFlatRoofVillageStartingPrefabsCount); /** The prefabs for the plains village. */ static cVillagePiecePool g_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVillagePrefabsCount, g_PlainsVillageStartingPrefabs, g_PlainsVillageStartingPrefabsCount); @@ -254,6 +258,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ // If just one is not, no village is created, because it's likely that an unfriendly biome is too close cVillagePiecePool * VillagePrefabs = NULL; BLOCKTYPE RoadBlock = E_BLOCK_GRAVEL; + int rnd = (a_OriginX + 21 * a_OriginZ + 985) / 11; for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) { switch (Biomes[i]) @@ -262,7 +267,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ case biDesertM: { // These biomes allow sand villages - VillagePrefabs = &g_SandVillage; + VillagePrefabs = (rnd % 2 == 0) ? &g_SandVillage : &g_SandFlatRoofVillage; RoadBlock = E_BLOCK_SANDSTONE; break; } From 85fc0dbd97bbf72ba98dfb69351d5c8fa6a8ddfd Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 21 May 2014 23:17:09 +0200 Subject: [PATCH 132/214] Changed desert village roads to gravel. --- src/Generating/VillageGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index 862aa966f..a899d5837 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -268,7 +268,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ { // These biomes allow sand villages VillagePrefabs = (rnd % 2 == 0) ? &g_SandVillage : &g_SandFlatRoofVillage; - RoadBlock = E_BLOCK_SANDSTONE; + // RoadBlock = E_BLOCK_SANDSTONE; break; } case biPlains: From ebb1ef237a23ca1bd381afe0a19178e1c1af62ca Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 22 May 2014 08:57:57 +0200 Subject: [PATCH 133/214] Updated plains village prefabs. The DoublePlantBed had sponges in wrong places, plus a few cosmetic fixes. --- .../Prefabs/PlainsVillagePrefabs.cpp | 87 +++++++++---------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index 863720ab4..22aae5958 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -302,28 +302,28 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 0 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "aaaaaaamaaaaaaa" - /* 1 */ "abbcbbamabbcbba" - /* 2 */ "abbcbbamabbcbba" - /* 3 */ "abbcbbamabbcbba" - /* 4 */ "abbcbbamabbcbba" - /* 5 */ "abbcbbamabbcbba" - /* 6 */ "abbcbbamabbcbba" - /* 7 */ "abbcbbamabbcbba" - /* 8 */ "aaaaaaamaaaaaaa" + /* 0 */ "aaaaaaa.aaaaaaa" + /* 1 */ "abbcbba.abbcbba" + /* 2 */ "abbcbba.abbcbba" + /* 3 */ "abbcbba.abbcbba" + /* 4 */ "abbcbba.abbcbba" + /* 5 */ "abbcbba.abbcbba" + /* 6 */ "abbcbba.abbcbba" + /* 7 */ "abbcbba.abbcbba" + /* 8 */ "aaaaaaa.aaaaaaa" // Level 1 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "dmmmmmdmdmmmmmd" - /* 1 */ "meemeemmmeemeem" - /* 2 */ "memmmemmmeemeem" - /* 3 */ "memmmmmmmeemeem" - /* 4 */ "meemmemmmeemeem" - /* 5 */ "meemmemmmeemeem" - /* 6 */ "mmemmemmmeemeem" - /* 7 */ "mmememmmmeemeem" - /* 8 */ "dmmmmmdmdmmmmmd", + /* 0 */ "d.....d.d.....d" + /* 1 */ ".ee.ee...ee.ee." + /* 2 */ ".e...e...ee.ee." + /* 3 */ ".e.......ee.ee." + /* 4 */ ".ee..e...ee.ee." + /* 5 */ ".ee..e...ee.ee." + /* 6 */ "..e..e...ee.ee." + /* 7 */ "..e.e....ee.ee." + /* 8 */ "d.....d.d.....d", // Connectors: "-1: 7, 0, 8: 3\n" /* Type -1, direction Z+ */, @@ -779,7 +779,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "uh...hv" /* 9 */ "uh...hv" /* 10 */ "uh...hv" - /* 11 */ "ughhhhv" + /* 11 */ "ughhhgv" /* 12 */ "uw...xv" // Level 6 @@ -901,7 +901,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 2 */ "uhDDDhv" /* 3 */ "uhDDDhv" /* 4 */ "uhDDDhv" - /* 5 */ "uhhhhhv" + /* 5 */ "ughhhgv" /* 6 */ "uw...xv" /* 7 */ "......." /* 8 */ "......." @@ -1893,16 +1893,15 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "k: 85: 0\n" /* fence */ "l: 53: 0\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 64: 6\n" /* wooddoorblock */ + "n: 64: 2\n" /* wooddoorblock */ "o: 64: 0\n" /* wooddoorblock */ "p:102: 0\n" /* glasspane */ "q: 72: 0\n" /* woodplate */ - "r: 64:12\n" /* wooddoorblock */ - "s: 64: 8\n" /* wooddoorblock */ - "t: 53: 5\n" /* woodstairs */ - "u: 53: 4\n" /* woodstairs */ - "v: 50: 1\n" /* torch */ - "w: 50: 2\n" /* torch */, + "r: 64: 8\n" /* wooddoorblock */ + "s: 53: 5\n" /* woodstairs */ + "t: 53: 4\n" /* woodstairs */ + "u: 50: 1\n" /* torch */ + "v: 50: 2\n" /* torch */, // Block data: // Level 0 @@ -1973,7 +1972,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 2 */ ".p.q.pmmmm" /* 3 */ ".p...p...." /* 4 */ ".d...d...." - /* 5 */ ".r...s...." + /* 5 */ ".r...r...." /* 6 */ ".d...d...." /* 7 */ ".p...p...." /* 8 */ ".p...p...." @@ -1983,22 +1982,22 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 5 /* z\x* */ /* * 0123456789 */ - /* 0 */ "lt...ujmmm" + /* 0 */ "ls...tjmmm" /* 1 */ "lidddijmmm" /* 2 */ "ld...djmmm" /* 3 */ "ld...dj..." - /* 4 */ "ldv.wdj..." + /* 4 */ "ldu.vdj..." /* 5 */ "ld...dj..." - /* 6 */ "ldv.wdj..." + /* 6 */ "ldu.vdj..." /* 7 */ "ld...dj..." /* 8 */ "ld...dj..." /* 9 */ "lidddijmmm" - /* 10 */ "lt...ujmmm" + /* 10 */ "ls...tjmmm" // Level 6 /* z\x* */ /* * 0123456789 */ - /* 0 */ "mlt.ujmmmm" + /* 0 */ "mls.tjmmmm" /* 1 */ "mldddjmmmm" /* 2 */ "mld.djmmmm" /* 3 */ "mld.djm..." @@ -2008,7 +2007,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 7 */ "mld.djm..." /* 8 */ "mld.djm..." /* 9 */ "mldddjmmmm" - /* 10 */ "mlt.ujmmmm" + /* 10 */ "mls.tjmmmm" // Level 7 /* z\x* */ @@ -3052,16 +3051,16 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 3 */ "lllllllllllll..." /* 4 */ "eeeeeeeeeeeen..." /* 5 */ "qqqqqqqqqqren..." - /* 6 */ "mmmmmmmmmmren..." - /* 7 */ "mmmmmmmmmmren..." - /* 8 */ "mmmmmmmmmmren..." - /* 9 */ "mmmmmmmmmmren..." - /* 10 */ "mmmmmmmmmmren..." - /* 11 */ "mmmmmmmmmmren..." - /* 12 */ "mmmmmmmmmmren..." - /* 13 */ "mmmmmmmmmmren..." - /* 14 */ "mmmmmmmmmmren..." - /* 15 */ "mmmmmmmmmmren...", + /* 6 */ "..........ren..." + /* 7 */ "..........ren..." + /* 8 */ "mmmmmmmm..ren..." + /* 9 */ "mmmmmmmm..ren..." + /* 10 */ "mmmmmmmm..ren..." + /* 11 */ "mmmmmmmm..ren..." + /* 12 */ "mmmmmmmm..ren..." + /* 13 */ "mmmmmmmm..ren..." + /* 14 */ "mmmmmmmm..ren..." + /* 15 */ "mmmmmmmm..ren...", // Connectors: "-1: 9, 0, 0: 2\n" /* Type -1, direction Z- */, From 6aa7df367f8db7506a8a5ab853c26e3c9fd60253 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 22 May 2014 21:47:56 +0200 Subject: [PATCH 134/214] Villages have min and max density setting. Also made roads use 3+9 scheme, instead of 3+5, for the house connectors. Fixes #1020. --- src/Generating/ComposableGenerator.cpp | 10 +-- src/Generating/PieceGenerator.cpp | 9 +++ src/Generating/PieceGenerator.h | 5 ++ src/Generating/VillageGen.cpp | 92 ++++++++++++++++++++++---- src/Generating/VillageGen.h | 11 ++- 5 files changed, 110 insertions(+), 17 deletions(-) diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp index f264599c9..4dd626ed4 100644 --- a/src/Generating/ComposableGenerator.cpp +++ b/src/Generating/ComposableGenerator.cpp @@ -408,10 +408,12 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile) } else if (NoCaseCompare(*itr, "Villages") == 0) { - int GridSize = a_IniFile.GetValueSetI("Generator", "VillageGridSize", 384); - int MaxDepth = a_IniFile.GetValueSetI("Generator", "VillageMaxDepth", 3); - int MaxSize = a_IniFile.GetValueSetI("Generator", "VillageMaxSize", 128); - m_FinishGens.push_back(new cVillageGen(Seed, GridSize, MaxDepth, MaxSize, *m_BiomeGen, *m_HeightGen)); + int GridSize = a_IniFile.GetValueSetI("Generator", "VillageGridSize", 384); + int MaxDepth = a_IniFile.GetValueSetI("Generator", "VillageMaxDepth", 2); + int MaxSize = a_IniFile.GetValueSetI("Generator", "VillageMaxSize", 128); + int MinDensity = a_IniFile.GetValueSetI("Generator", "VillageMinDensity", 50); + int MaxDensity = a_IniFile.GetValueSetI("Generator", "VillageMaxDensity", 80); + m_FinishGens.push_back(new cVillageGen(Seed, GridSize, MaxDepth, MaxSize, MinDensity, MaxDensity, *m_BiomeGen, *m_HeightGen)); } else if (NoCaseCompare(*itr, "WaterLakes") == 0) { diff --git a/src/Generating/PieceGenerator.cpp b/src/Generating/PieceGenerator.cpp index c12559d3f..7d478f1a1 100644 --- a/src/Generating/PieceGenerator.cpp +++ b/src/Generating/PieceGenerator.cpp @@ -308,6 +308,15 @@ cPiece::cConnector cPlacedPiece::GetRotatedConnector(size_t a_Index) const +cPiece::cConnector cPlacedPiece::GetRotatedConnector(const cPiece::cConnector & a_Connector) const +{ + return m_Piece->RotateMoveConnector(a_Connector, m_NumCCWRotations, m_Coords.x, m_Coords.y, m_Coords.z); +} + + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cPieceGenerator: diff --git a/src/Generating/PieceGenerator.h b/src/Generating/PieceGenerator.h index 643ca58b6..e396643a9 100644 --- a/src/Generating/PieceGenerator.h +++ b/src/Generating/PieceGenerator.h @@ -110,6 +110,7 @@ public: virtual cPieces GetStartingPieces(void) = 0; /** Returns the relative weight with which the a_NewPiece is to be selected for placing under a_PlacedPiece through a_ExistingConnector. + a_ExistingConnector is the original connector, before any movement or rotation is applied to it. This allows the pool to tweak the piece's chances, based on the previous pieces in the tree and the connector used. The higher the number returned, the higher the chance the piece will be chosen. 0 means the piece will never be chosen. */ @@ -151,6 +152,10 @@ public: Undefined behavior if a_Index is out of range. */ cPiece::cConnector GetRotatedConnector(size_t a_Index) const; + /** Returns a copy of the specified connector, modified to account for the translation and rotation for + this placement. */ + cPiece::cConnector GetRotatedConnector(const cPiece::cConnector & a_Connector) const; + protected: const cPlacedPiece * m_Parent; const cPiece * m_Piece; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index a899d5837..bcce62af5 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -27,11 +27,16 @@ though, the roads are generated by code and their content is ignored. A special class is used, so that the roads connect to each other and to the well only in predefined manners. The well has connectors of type "2". The houses have connectors of type "-1". The roads have connectors of -both types' opposites, type "-2" at the far ends and type "1" on the long edges. +both types' opposites, type "-2" at the far ends and type "1" on the long edges. Additionally, there are +type "2" connectors along the long edges of the roads as well, so that the roads create T junctions. When the village is about to be drawn into a chunk, it queries the heights for each piece intersecting the chunk. The pieces are shifted so that their pivot points lie on the surface, and the roads are drawn directly by turning the surface blocks into gravel / sandstone. + +The village prefabs are stored in global piecepools (one pool per village type). In order to support +per-village density setting, the cVillage class itself implements the cPiecePool interface, relaying the +calls to the underlying cVillagePiecePool, after processing the density check. */ class cVillagePiecePool : @@ -46,7 +51,7 @@ public: super(a_PieceDefs, a_NumPieceDefs, a_StartingPieceDefs, a_NumStartingPieceDefs) { // Add the road pieces: - for (int len = 19; len < 60; len += 8) + for (int len = 27; len < 60; len += 12) { cBlockArea BA; BA.Create(len, 1, 3, cBlockArea::baTypes | cBlockArea::baMetas); @@ -56,14 +61,14 @@ public: RoadPiece->AddConnector(len - 1, 0, 1, BLOCK_FACE_XP, -2); // Add the road connectors: - for (int x = 1; x < len; x += 8) + for (int x = 1; x < len; x += 12) { RoadPiece->AddConnector(x, 0, 0, BLOCK_FACE_ZM, 2); RoadPiece->AddConnector(x, 0, 2, BLOCK_FACE_ZP, 2); } // Add the buildings connectors: - for (int x = 5; x < len; x += 8) + for (int x = 7; x < len; x += 12) { RoadPiece->AddConnector(x, 0, 0, BLOCK_FACE_ZM, 1); RoadPiece->AddConnector(x, 0, 2, BLOCK_FACE_ZP, 1); @@ -94,7 +99,8 @@ public: class cVillageGen::cVillage : - public cGridStructGen::cStructure + public cGridStructGen::cStructure, + protected cPiecePool { typedef cGridStructGen::cStructure super; @@ -104,7 +110,8 @@ public: int a_OriginX, int a_OriginZ, int a_MaxRoadDepth, int a_MaxSize, - cPrefabPiecePool & a_Prefabs, + int a_Density, + cPiecePool & a_Prefabs, cTerrainHeightGen & a_HeightGen, BLOCKTYPE a_RoadBlock ) : @@ -112,12 +119,13 @@ public: m_Seed(a_Seed), m_Noise(a_Seed), m_MaxSize(a_MaxSize), + m_Density(a_Density), m_Borders(a_OriginX - a_MaxSize, 0, a_OriginZ - a_MaxSize, a_OriginX + a_MaxSize, 255, a_OriginZ + a_MaxSize), m_Prefabs(a_Prefabs), m_HeightGen(a_HeightGen), m_RoadBlock(a_RoadBlock) { - cBFSPieceGenerator pg(m_Prefabs, a_Seed); + cBFSPieceGenerator pg(*this, a_Seed); // Generate the pieces at very negative Y coords, so that we can later test // Piece has negative Y coord -> hasn't been height-adjusted yet pg.PlacePieces(a_OriginX, -1000, a_OriginZ, a_MaxRoadDepth + 1, m_Pieces); @@ -133,11 +141,14 @@ protected: /** Maximum size, in X/Z blocks, of the village (radius from the origin) */ int m_MaxSize; + /** The density for this village. Used to refrain from populating all house connectors. Range [0, 100] */ + int m_Density; + /** Borders of the vilalge - no item may reach out of this cuboid. */ cCuboid m_Borders; /** Prefabs to use for buildings */ - cPrefabPiecePool & m_Prefabs; + cPiecePool & m_Prefabs; /** The underlying height generator, used for placing the structures on top of the terrain. */ cTerrainHeightGen & m_HeightGen; @@ -149,7 +160,7 @@ protected: BLOCKTYPE m_RoadBlock; - // cGrdStructGen::cStructure overrides: + // cGridStructGen::cStructure overrides: virtual void DrawIntoChunk(cChunkDesc & a_Chunk) override { // Iterate over all items @@ -211,6 +222,49 @@ protected: } } } + + + // cPiecePool overrides: + virtual cPieces GetPiecesWithConnector(int a_ConnectorType) + { + return m_Prefabs.GetPiecesWithConnector(a_ConnectorType); + } + + virtual cPieces GetStartingPieces(void) + { + return m_Prefabs.GetStartingPieces(); + } + + virtual int GetPieceWeight( + const cPlacedPiece & a_PlacedPiece, + const cPiece::cConnector & a_ExistingConnector, + const cPiece & a_NewPiece + ) override + { + // Check against the density: + if (a_ExistingConnector.m_Type == 1) + { + const Vector3i & Coords = a_PlacedPiece.GetRotatedConnector(a_ExistingConnector).m_Pos; + int rnd = (m_Noise.IntNoise3DInt(Coords.x, Coords.y, Coords.z) / 7) % 100; + if (rnd > m_Density) + { + return 0; + } + } + + // Density check passed, relay to m_Prefabs: + return m_Prefabs.GetPieceWeight(a_PlacedPiece, a_ExistingConnector, a_NewPiece); + } + + virtual void PiecePlaced(const cPiece & a_Piece) override + { + m_Prefabs.PiecePlaced(a_Piece); + } + + virtual void Reset(void) override + { + m_Prefabs.Reset(); + } } ; @@ -233,10 +287,13 @@ static cVillagePiecePool g_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVillage -cVillageGen::cVillageGen(int a_Seed, int a_GridSize, int a_MaxDepth, int a_MaxSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen) : +cVillageGen::cVillageGen(int a_Seed, int a_GridSize, int a_MaxDepth, int a_MaxSize, int a_MinDensity, int a_MaxDensity, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen) : super(a_Seed, a_GridSize, a_GridSize, a_MaxSize, a_MaxSize, 100), + m_Noise(a_Seed + 1000), m_MaxDepth(a_MaxDepth), m_MaxSize(a_MaxSize), + m_MinDensity(a_MinDensity), + m_MaxDensity(a_MaxDensity), m_BiomeGen(a_BiomeGen), m_HeightGen(a_HeightGen) { @@ -258,7 +315,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ // If just one is not, no village is created, because it's likely that an unfriendly biome is too close cVillagePiecePool * VillagePrefabs = NULL; BLOCKTYPE RoadBlock = E_BLOCK_GRAVEL; - int rnd = (a_OriginX + 21 * a_OriginZ + 985) / 11; + int rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 11; for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) { switch (Biomes[i]) @@ -288,12 +345,23 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ } // switch (Biomes[i]) } // for i - Biomes[] + // Choose density for the village, random between m_MinDensity and m_MaxDensity: + int Density; + if (m_MaxDensity > m_MinDensity) + { + Density = m_MinDensity + rnd % (m_MaxDensity - m_MinDensity); + } + else + { + Density = m_MinDensity; + } + // Create a village based on the chosen prefabs: if (VillagePrefabs == NULL) { return cStructurePtr(); } - return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, m_MaxDepth, m_MaxSize, *VillagePrefabs, m_HeightGen, RoadBlock)); + return cStructurePtr(new cVillage(m_Seed, a_OriginX, a_OriginZ, m_MaxDepth, m_MaxSize, Density, *VillagePrefabs, m_HeightGen, RoadBlock)); } diff --git a/src/Generating/VillageGen.h b/src/Generating/VillageGen.h index c6f8f024a..5faaae8a6 100644 --- a/src/Generating/VillageGen.h +++ b/src/Generating/VillageGen.h @@ -21,16 +21,25 @@ class cVillageGen : { typedef cGridStructGen super; public: - cVillageGen(int a_Seed, int a_GridSize, int a_MaxDepth, int a_MaxSize, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen); + cVillageGen(int a_Seed, int a_GridSize, int a_MaxDepth, int a_MaxSize, int a_MinDensity, int a_MaxDensity, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen); protected: class cVillage; // fwd: VillageGen.cpp + /** The noise used for generating random numbers */ + cNoise m_Noise; + /** Maximum depth of the generator tree*/ int m_MaxDepth; /** Maximum size, in X/Z blocks, of the village (radius from the origin) */ int m_MaxSize; + + /** Minimum density - percentage of allowed house connections. Range [0, 100] */ + int m_MinDensity; + + /** Maximum density - percentage of allowed house connections. Range [0, 100] */ + int m_MaxDensity; /** The underlying biome generator that defines whether the village is created or not */ cBiomeGen & m_BiomeGen; From da843a18811546ca51600a0f3e4438ae4ac5dee8 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 22 May 2014 22:19:44 +0200 Subject: [PATCH 135/214] Updated plains village prefabs. Expanded the hitboxes so that houses don't touch each other. Fixed minor visual defects. --- .../Prefabs/PlainsVillagePrefabs.cpp | 367 +++++++++--------- 1 file changed, 176 insertions(+), 191 deletions(-) diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index 22aae5958..28488be14 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -135,8 +135,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 12, 8, 7, // SizeX = 12, SizeY = 8, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 11, 7, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 12, 7, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -357,8 +357,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 12, 10, 11, // SizeX = 12, SizeY = 10, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 11, 9, 10, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 12, 9, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -649,8 +649,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 7, 16, 13, // SizeX = 7, SizeY = 16, SizeZ = 13 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 6, 15, 12, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 7, 15, 13, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -974,8 +974,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 7, 8, 9, // SizeX = 7, SizeY = 8, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 6, 7, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 7, 7, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1127,8 +1127,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 12, 9, 9, // SizeX = 12, SizeY = 9, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 11, 8, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 12, 8, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1308,8 +1308,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 7, 8, 7, // SizeX = 7, SizeY = 8, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 6, 7, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 7, 7, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1444,8 +1444,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 9, 8, 7, // SizeX = 9, SizeY = 8, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 8, 7, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 9, 7, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1580,8 +1580,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 11, 8, 7, // SizeX = 11, SizeY = 8, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 7, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 7, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1724,8 +1724,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 11, 8, 7, // SizeX = 11, SizeY = 8, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 7, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 7, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1872,18 +1872,18 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 9, ID 26, created by Aloe_vera { // Size: - 10, 8, 11, // SizeX = 10, SizeY = 8, SizeZ = 11 + 10, 7, 11, // SizeX = 10, SizeY = 7, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 9, 7, 10, // MaxX, MaxY, MaxZ + 0, -1, -1, // MinX, MinY, MinZ + 10, 6, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 4: 0\n" /* cobblestone */ - "d: 5: 0\n" /* wood */ + "a: 4: 0\n" /* cobblestone */ + "b: 3: 0\n" /* dirt */ + "c: 5: 0\n" /* wood */ + "d: 2: 0\n" /* grass */ "e: 67: 2\n" /* stairs */ "f: 43: 0\n" /* doubleslab */ "g: 67: 0\n" /* stairs */ @@ -1907,125 +1907,110 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 0 /* z\x* */ /* * 0123456789 */ - /* 0 */ "aaaaaaaaaa" - /* 1 */ "aaaaaaaaaa" - /* 2 */ "aaaaaaaaaa" - /* 3 */ "aaaaaaaaaa" - /* 4 */ "aaaaaaaaaa" - /* 5 */ "aaaaaaaaaa" - /* 6 */ "aaaaaaaaaa" - /* 7 */ "aaaaaaaaaa" - /* 8 */ "aaaaaaaaaa" - /* 9 */ "aaaaaaaaaa" - /* 10 */ "aaaaaaaaaa" + /* 0 */ "mmmmmmmmmm" + /* 1 */ "maaaaammmm" + /* 2 */ "maaaaammmm" + /* 3 */ "maaaaabbbb" + /* 4 */ "aaaaaabbbb" + /* 5 */ "aaaaaabbbb" + /* 6 */ "aaaaaabbbb" + /* 7 */ "maaaaabbbb" + /* 8 */ "maaaaabbbb" + /* 9 */ "maaaaammmm" + /* 10 */ "mmmmmmmmmm" // Level 1 /* z\x* */ /* * 0123456789 */ - /* 0 */ "bbbbbbbbbb" - /* 1 */ "baaaaabbbb" - /* 2 */ "baaaaabbbb" - /* 3 */ "baaaaaaaaa" - /* 4 */ "aaaaaaaaaa" - /* 5 */ "aaaaaaaaaa" - /* 6 */ "aaaaaaaaaa" - /* 7 */ "baaaaaaaaa" - /* 8 */ "baaaaaaaaa" - /* 9 */ "baaaaabbbb" - /* 10 */ "bbbbbbbbbb" + /* 0 */ "......mmmm" + /* 1 */ ".aaaaammmm" + /* 2 */ ".acccammmm" + /* 3 */ ".acccadddd" + /* 4 */ "eafffadddd" + /* 5 */ "gaffffdddd" + /* 6 */ "hafffadddd" + /* 7 */ ".afffadddd" + /* 8 */ ".afffadddd" + /* 9 */ ".aaaaammmm" + /* 10 */ "......mmmm" // Level 2 /* z\x* */ /* * 0123456789 */ /* 0 */ "......mmmm" - /* 1 */ ".cccccmmmm" - /* 2 */ ".cdddcmmmm" - /* 3 */ ".cdddcbbbb" - /* 4 */ "ecfffcbbbb" - /* 5 */ "gcffffbbbb" - /* 6 */ "hcfffcbbbb" - /* 7 */ ".cfffcbbbb" - /* 8 */ ".cfffcbbbb" - /* 9 */ ".cccccmmmm" + /* 1 */ ".icccimmmm" + /* 2 */ ".cjklcmmmm" + /* 3 */ ".c...ckkkk" + /* 4 */ ".c...c...k" + /* 5 */ ".n...o...k" + /* 6 */ ".c...c...k" + /* 7 */ ".cff.c...k" + /* 8 */ ".c...ckkkk" + /* 9 */ ".icccimmmm" /* 10 */ "......mmmm" // Level 3 /* z\x* */ /* * 0123456789 */ /* 0 */ "......mmmm" - /* 1 */ ".idddimmmm" - /* 2 */ ".djkldmmmm" - /* 3 */ ".d...dkkkk" - /* 4 */ ".d...d...k" - /* 5 */ ".n...o...k" - /* 6 */ ".d...d...k" - /* 7 */ ".dff.d...k" - /* 8 */ ".d...dkkkk" - /* 9 */ ".idddimmmm" - /* 10 */ "......mmmm" - - // Level 4 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "......mmmm" /* 1 */ ".ipppimmmm" /* 2 */ ".p.q.pmmmm" /* 3 */ ".p...p...." - /* 4 */ ".d...d...." + /* 4 */ ".c...c...." /* 5 */ ".r...r...." - /* 6 */ ".d...d...." + /* 6 */ ".c...c...." /* 7 */ ".p...p...." /* 8 */ ".p...p...." /* 9 */ ".ipppimmmm" /* 10 */ "......mmmm" - // Level 5 + // Level 4 /* z\x* */ /* * 0123456789 */ /* 0 */ "ls...tjmmm" - /* 1 */ "lidddijmmm" - /* 2 */ "ld...djmmm" - /* 3 */ "ld...dj..." - /* 4 */ "ldu.vdj..." - /* 5 */ "ld...dj..." - /* 6 */ "ldu.vdj..." - /* 7 */ "ld...dj..." - /* 8 */ "ld...dj..." - /* 9 */ "lidddijmmm" + /* 1 */ "licccijmmm" + /* 2 */ "lc...cjmmm" + /* 3 */ "lc...cj..." + /* 4 */ "lcu.vcj..." + /* 5 */ "lc...cj..." + /* 6 */ "lcu.vcj..." + /* 7 */ "lc...cj..." + /* 8 */ "lc...cj..." + /* 9 */ "licccijmmm" /* 10 */ "ls...tjmmm" + // Level 5 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "mls.tjmmmm" + /* 1 */ "mlcccjmmmm" + /* 2 */ "mlc.cjmmmm" + /* 3 */ "mlc.cjm..." + /* 4 */ "mlc.cjm..." + /* 5 */ "mlc.cjm..." + /* 6 */ "mlc.cjm..." + /* 7 */ "mlc.cjm..." + /* 8 */ "mlc.cjm..." + /* 9 */ "mlcccjmmmm" + /* 10 */ "mls.tjmmmm" + // Level 6 /* z\x* */ /* * 0123456789 */ - /* 0 */ "mls.tjmmmm" - /* 1 */ "mldddjmmmm" - /* 2 */ "mld.djmmmm" - /* 3 */ "mld.djm..." - /* 4 */ "mld.djm..." - /* 5 */ "mld.djm..." - /* 6 */ "mld.djm..." - /* 7 */ "mld.djm..." - /* 8 */ "mld.djm..." - /* 9 */ "mldddjmmmm" - /* 10 */ "mls.tjmmmm" - - // Level 7 - /* z\x* */ - /* * 0123456789 */ - /* 0 */ "mmldjmmmmm" - /* 1 */ "mmldjmmmmm" - /* 2 */ "mmldjmmmmm" - /* 3 */ "mmldjmm..." - /* 4 */ "mmldjmm..." - /* 5 */ "mmldjmm..." - /* 6 */ "mmldjmm..." - /* 7 */ "mmldjmm..." - /* 8 */ "mmldjmm..." - /* 9 */ "mmldjmmmmm" - /* 10 */ "mmldjmmmmm", + /* 0 */ "mmlcjmmmmm" + /* 1 */ "mmlcjmmmmm" + /* 2 */ "mmlcjmmmmm" + /* 3 */ "mmlcjmm..." + /* 4 */ "mmlcjmm..." + /* 5 */ "mmlcjmm..." + /* 6 */ "mmlcjmm..." + /* 7 */ "mmlcjmm..." + /* 8 */ "mmlcjmm..." + /* 9 */ "mmlcjmmmmm" + /* 10 */ "mmlcjmmmmm", // Connectors: - "-1: 0, 2, 5: 4\n" /* Type -1, direction X- */, + "-1: 0, 1, 5: 4\n" /* Type -1, direction X- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2056,8 +2041,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 11, 9, 9, // SizeX = 11, SizeY = 9, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 8, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 8, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -2230,17 +2215,17 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 11, 9, 13, // SizeX = 11, SizeY = 9, SizeZ = 13 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 8, 12, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 8, 13, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ "a: 3: 0\n" /* dirt */ "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ + "c: 4: 0\n" /* cobblestone */ + "d: 67: 0\n" /* stairs */ + "e: 67: 2\n" /* stairs */ + "f: 67: 1\n" /* stairs */ "g: 43: 0\n" /* doubleslab */ "h: 17: 0\n" /* tree */ "i: 5: 0\n" /* wood */ @@ -2262,52 +2247,52 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "aaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaab" + /* 2 */ "aaaaaaaaaab" + /* 3 */ "aaaaaaaaaab" + /* 4 */ "aaaaaaaaaab" /* 5 */ "aaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaa" - /* 8 */ "aaaaaaaaaaa" - /* 9 */ "aaaaaaaaaaa" - /* 10 */ "aaaaaaaaaaa" - /* 11 */ "aaaaaaaaaaa" - /* 12 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaab" + /* 7 */ "aaaaaaaaaab" + /* 8 */ "abaaaaaaabb" + /* 9 */ "aaaaaaaaabb" + /* 10 */ "aaaaaaaaabb" + /* 11 */ "abaaaaaaaba" + /* 12 */ "abaaaaaaabb" // Level 1 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "bbbbaaabbbb" - /* 1 */ "baaaaaaaaab" - /* 2 */ "baaaaaaaaab" - /* 3 */ "baaaaaaaaab" - /* 4 */ "baaaaaaaaab" - /* 5 */ "baaaaaaaaab" - /* 6 */ "baaaaaaaaab" - /* 7 */ "baaaaaaaaab" - /* 8 */ "bbaaaaaaabb" - /* 9 */ "bbaaaaaaabb" - /* 10 */ "bbaaaaaaabb" - /* 11 */ "bbaaaaaaabb" - /* 12 */ "bbaaaaaaabb" + /* 0 */ "mmmmcccmmmm" + /* 1 */ "mcccccccccm" + /* 2 */ "mcccccccccm" + /* 3 */ "mcccccccccm" + /* 4 */ "mcccccccccm" + /* 5 */ "mcccccccccm" + /* 6 */ "mcccccccccm" + /* 7 */ "mcccccccccm" + /* 8 */ "mmaaaaaaamm" + /* 9 */ "mmaaaaaaamm" + /* 10 */ "mmaaaaaaamm" + /* 11 */ "mmaaaaaaamm" + /* 12 */ "mmaaaaaaamm" // Level 2 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "....cde...." - /* 1 */ ".fffffffff." - /* 2 */ ".fggggffff." - /* 3 */ ".fggggffff." - /* 4 */ ".fggggffff." - /* 5 */ ".fggggffff." - /* 6 */ ".fggggffff." - /* 7 */ ".fffffffff." + /* 0 */ "....def...." + /* 1 */ ".ccccccccc." + /* 2 */ ".cggggcccc." + /* 3 */ ".cggggcccc." + /* 4 */ ".cggggcccc." + /* 5 */ ".cggggcccc." + /* 6 */ ".cggggcccc." + /* 7 */ ".ccccccccc." /* 8 */ "..bbbbbbb.." - /* 9 */ "mmbbbbbbbmm" - /* 10 */ "mmbbbbbbbmm" - /* 11 */ "mmbbbbbbbmm" - /* 12 */ "mmbbbbbbbmm" + /* 9 */ "..bbbbbbb.." + /* 10 */ "..bbbbbbb.." + /* 11 */ "..bbbbbbb.." + /* 12 */ "..bbbbbbb.." // Level 3 /* z\x* 1 */ @@ -2321,10 +2306,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ ".i.......i." /* 7 */ ".hiiijiiih." /* 8 */ "..l.....l.." - /* 9 */ "mml.....lmm" - /* 10 */ "mml.....lmm" - /* 11 */ "mml.....lmm" - /* 12 */ "mmlllllllmm" + /* 9 */ "..l.....l.." + /* 10 */ "..l.....l.." + /* 11 */ "..l.....l.." + /* 12 */ "..lllllll.." // Level 4 /* z\x* 1 */ @@ -2338,10 +2323,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ ".o.......o." /* 7 */ ".hooipiooh." /* 8 */ "..........." - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm" + /* 9 */ "..........." + /* 10 */ "..........." + /* 11 */ "..........." + /* 12 */ "..........." // Level 5 /* z\x* 1 */ @@ -2355,10 +2340,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ ".i.......i." /* 7 */ "uiiiiiiiiiu" /* 8 */ "kkkkkkkkkkk" - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm" + /* 9 */ "..........." + /* 10 */ "..........." + /* 11 */ "..........." + /* 12 */ "..........." // Level 6 /* z\x* 1 */ @@ -2372,10 +2357,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ "uiiiiiiiiiu" /* 7 */ "kkkkkkkkkkk" /* 8 */ "..........." - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm" + /* 9 */ "..........." + /* 10 */ "..........." + /* 11 */ "..........." + /* 12 */ "..........." // Level 7 /* z\x* 1 */ @@ -2389,10 +2374,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ "kkkkkkkkkkk" /* 7 */ "..........." /* 8 */ "..........." - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm" + /* 9 */ "..........." + /* 10 */ "..........." + /* 11 */ "..........." + /* 12 */ "..........." // Level 8 /* z\x* 1 */ @@ -2406,10 +2391,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 6 */ "..........." /* 7 */ "..........." /* 8 */ "..........." - /* 9 */ "mm.......mm" - /* 10 */ "mm.......mm" - /* 11 */ "mm.......mm" - /* 12 */ "mm.......mm", + /* 9 */ "..........." + /* 10 */ "..........." + /* 11 */ "..........." + /* 12 */ "...........", // Connectors: "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, @@ -2443,8 +2428,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 11, 9, 9, // SizeX = 11, SizeY = 9, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 8, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 8, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -2620,8 +2605,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 15, 10, 16, // SizeX = 15, SizeY = 10, SizeZ = 16 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 14, 9, 15, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 15, 9, 16, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -2891,8 +2876,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 16, 7, 16, // SizeX = 16, SizeY = 7, SizeZ = 16 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 15, 6, 15, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 16, 6, 16, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -3094,8 +3079,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 11, 8, 11, // SizeX = 11, SizeY = 8, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 7, 10, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 7, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -3277,8 +3262,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 15, 8, 11, // SizeX = 15, SizeY = 8, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 14, 7, 10, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 15, 7, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -3458,7 +3443,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 9, 18, 13, // SizeX = 9, SizeY = 18, SizeZ = 13 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ + -1, 0, 0, // MinX, MinY, MinZ 8, 17, 12, // MaxX, MaxY, MaxZ // Block definitions: @@ -3808,8 +3793,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = 15, 10, 9, // SizeX = 15, SizeY = 10, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 14, 9, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 15, 9, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ From f03cbb5e04d8dc4ccbb51cf63200ff3ac597f0f9 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 23 May 2014 11:22:48 +0200 Subject: [PATCH 136/214] Fixed profiling flags for MSVC. The profiler output contained no useful symbols before, because there were no symbols in the PDBs. --- SetFlags.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SetFlags.cmake b/SetFlags.cmake index 4eed529bd..fe867f9af 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -118,8 +118,8 @@ endmacro() macro(enable_profile) # Declare the flags used for profiling builds: if (MSVC) - set (CXX_PROFILING "") - set (LNK_PROFILING "/PROFILE") + set (CXX_PROFILING "/Zi") + set (LNK_PROFILING "/PROFILE /DEBUG") else() set (CXX_PROFILING "-pg") set (LNK_PROFILING "-pg") From 941cb88ae456f0d8b91f6b5dc835c2536eef15f6 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 23 May 2014 12:33:30 +0200 Subject: [PATCH 137/214] Fixed datatype conversion warning. --- src/Entities/Entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 15f456332..2567b7adc 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1018,10 +1018,10 @@ void cEntity::TickInVoid(cChunk & a_Chunk) -void cEntity::DetectCacti() +void cEntity::DetectCacti(void) { int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT; - float w = m_Width / 2; + double w = m_Width / 2; if ( (((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) || (((GetPosX() - (X - 1)) - 1 < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) || From a4c964c888748e7099308dc56578244112148cdd Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 23 May 2014 13:01:06 +0200 Subject: [PATCH 138/214] Auto-enlargement for cGridStructGen cache. --- src/Generating/GridStructGen.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Generating/GridStructGen.cpp b/src/Generating/GridStructGen.cpp index 3bbc89054..bfa6bccb1 100644 --- a/src/Generating/GridStructGen.cpp +++ b/src/Generating/GridStructGen.cpp @@ -22,6 +22,15 @@ cGridStructGen::cGridStructGen( m_MaxStructureSizeZ(a_MaxStructureSizeZ), m_MaxCacheSize(a_MaxCacheSize) { + size_t NumStructuresPerQuery = (size_t)((m_MaxStructureSizeX / m_GridSizeX + 1) * (m_MaxStructureSizeZ / m_GridSizeZ + 1)); + if (NumStructuresPerQuery > m_MaxCacheSize) + { + m_MaxCacheSize = NumStructuresPerQuery * 4; + LOGINFO( + "cGridStructGen: The cache size is too small (%u), increasing the cache size to %u to avoid inefficiency.", + (unsigned)a_MaxCacheSize, (unsigned)m_MaxCacheSize + ); + } } From 97865bff7ce1595ae43be65082c1a02fed4ea8c4 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 23 May 2014 13:01:50 +0200 Subject: [PATCH 139/214] Fixed Mineshaft system size. --- src/Generating/MineShafts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generating/MineShafts.cpp b/src/Generating/MineShafts.cpp index 391e4c04f..81ae6481d 100644 --- a/src/Generating/MineShafts.cpp +++ b/src/Generating/MineShafts.cpp @@ -1283,7 +1283,7 @@ cStructGenMineShafts::cStructGenMineShafts( int a_Seed, int a_GridSize, int a_MaxSystemSize, int a_ChanceCorridor, int a_ChanceCrossing, int a_ChanceStaircase ) : - super(a_Seed, a_GridSize, a_GridSize, 120 + a_MaxSystemSize * 10, 120 + a_MaxSystemSize * 10, 100), + super(a_Seed, a_GridSize, a_GridSize, a_MaxSystemSize, a_MaxSystemSize, 100), m_Noise(a_Seed), m_GridSize(a_GridSize), m_MaxSystemSize(a_MaxSystemSize), From 41692da30c9985ea1b5aa7430cb582997293bdd7 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 23 May 2014 15:01:27 +0100 Subject: [PATCH 140/214] Ignore CTest files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c544f394d..859ef28ea 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ world_nether CMakeFiles/ cmake_install.cmake CMakeCache.txt +CTestTestfile.cmake Makefile *.a From 8f964886e0ccbf51dac07227f0ac4c739b47d3a5 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 24 May 2014 13:33:40 +0100 Subject: [PATCH 141/214] Implemented style changes --- src/BlockArea.cpp | 2 +- src/Chunk.cpp | 4 +- src/Chunk.h | 4 +- src/ChunkData.cpp | 61 +++++++------- src/ChunkData.h | 120 ++++++++++++++------------- src/ChunkDataCallback.h | 8 +- tests/ChunkData/ArraytoCoord.cpp | 90 +++++++-------------- tests/ChunkData/Coordinates.cpp | 38 ++++----- tests/ChunkData/Copies.cpp | 135 +++++++++---------------------- 9 files changed, 188 insertions(+), 274 deletions(-) diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 87236957a..11bd76e6c 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -1908,7 +1908,7 @@ void cBlockArea::cChunkReader::ChunkData(const cChunkData & a_BlockBuffer) if (m_Area.m_BlockLight != NULL) { - a_BlockBuffer.CopyLight(m_Area.m_BlockLight); + a_BlockBuffer.CopyBlockLight(m_Area.m_BlockLight); } if (m_Area.m_BlockSkyLight != NULL) diff --git a/src/Chunk.cpp b/src/Chunk.cpp index d85b44607..e5f8f1e29 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -284,7 +284,7 @@ void cChunk::SetAllData( m_ChunkData.SetBlocks(a_BlockTypes); m_ChunkData.SetMeta(a_BlockMeta); - m_ChunkData.SetLight(a_BlockLight); + m_ChunkData.SetBlockLight(a_BlockLight); m_ChunkData.SetSkyLight(a_BlockSkyLight); m_IsLightValid = (a_BlockLight != NULL) && (a_BlockSkyLight != NULL); @@ -326,7 +326,7 @@ void cChunk::SetLight( // TODO: We might get cases of wrong lighting when a chunk changes in the middle of a lighting calculation. // Postponing until we see how bad it is :) - m_ChunkData.SetLight(a_BlockLight); + m_ChunkData.SetBlockLight(a_BlockLight); m_ChunkData.SetSkyLight(a_SkyLight); diff --git a/src/Chunk.h b/src/Chunk.h index 2de45919e..d95537acf 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -67,7 +67,7 @@ public: cChunkMap * a_ChunkMap, cWorld * a_World, // Parent objects cChunk * a_NeighborXM, cChunk * a_NeighborXP, cChunk * a_NeighborZM, cChunk * a_NeighborZP // Neighbor chunks ); - cChunk(cChunk& other); + cChunk(cChunk & other); ~cChunk(); bool IsValid(void) const {return m_IsValid; } // Returns true if the chunk block data is valid (loaded / generated) @@ -156,7 +156,7 @@ public: void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta ); // Doesn't force block updates on neighbors, use for simple changes such as grass growing etc. BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const; - BLOCKTYPE GetBlock(Vector3i a_cords) const { return GetBlock(a_cords.x,a_cords.y,a_cords.z);} + BLOCKTYPE GetBlock(Vector3i a_cords) const { return GetBlock(a_cords.x, a_cords.y, a_cords.z);} void GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta); void GetBlockInfo (int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight); diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 86b0c431c..098f436f8 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -5,7 +5,7 @@ cChunkData cChunkData::Copy() const { cChunkData copy; - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { if (m_Sections[i] != NULL) { @@ -22,13 +22,16 @@ cChunkData cChunkData::Copy() const void cChunkData::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) const { - for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; - if (a_Idx > 0) a_Idx = a_Idx > length ? a_Idx - length : 0; + if (a_Idx > 0) + { + a_Idx = std::max(a_Idx - length, (size_t) 0); + } if (a_Idx == 0) { - size_t tocopy = length > segment_length ? segment_length : length; + size_t tocopy = std::min(segment_length, length); length -= tocopy; if (m_Sections[i] != NULL) { @@ -56,7 +59,7 @@ void cChunkData::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const { - for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) @@ -82,9 +85,9 @@ void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const -void cChunkData::CopyLight(NIBBLETYPE * a_dest) const +void cChunkData::CopyBlockLight(NIBBLETYPE * a_dest) const { - for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) @@ -112,7 +115,7 @@ void cChunkData::CopyLight(NIBBLETYPE * a_dest) const void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const { - for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) @@ -140,7 +143,7 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const void cChunkData::SetBlocks(const BLOCKTYPE * a_src) { - for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; if (m_Sections[i] != NULL) @@ -153,6 +156,9 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src) } else { + // j counts how many of leading zeros the buffer has + // if j == segment_length then the buffer is all zeros so there is no point + // creating the buffer. size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); @@ -180,11 +186,6 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src) sizeof(m_Sections[i]->m_BlockSkyLight) ); } - else - { - Free(m_Sections[i]); - m_Sections[i] = 0; - } } } } @@ -194,7 +195,7 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src) void cChunkData::SetMeta(const NIBBLETYPE * a_src) { - for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) @@ -207,6 +208,9 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src) } else { + // j counts how many of leading zeros the buffer has + // if j == segment_length then the buffer is all zeros so there is no point + // creating the buffer. size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); @@ -234,11 +238,6 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src) sizeof(m_Sections[i]->m_BlockSkyLight) ); } - else - { - Free(m_Sections[i]); - m_Sections[i] = 0; - } } } } @@ -246,10 +245,10 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src) -void cChunkData::SetLight(const NIBBLETYPE * a_src) +void cChunkData::SetBlockLight(const NIBBLETYPE * a_src) { if (!a_src) return; - for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) @@ -262,6 +261,9 @@ void cChunkData::SetLight(const NIBBLETYPE * a_src) } else { + // j counts how many of leading zeros the buffer has + // if j == segment_length then the buffer is all zeros so there is no point + // creating the buffer. size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); @@ -289,11 +291,6 @@ void cChunkData::SetLight(const NIBBLETYPE * a_src) sizeof(m_Sections[i]->m_BlockSkyLight) ); } - else - { - Free(m_Sections[i]); - m_Sections[i] = 0; - } } } } @@ -304,7 +301,7 @@ void cChunkData::SetLight(const NIBBLETYPE * a_src) void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) { if (!a_src) return; - for (size_t i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) @@ -317,6 +314,9 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) } else { + // j counts how many of leading zeros the buffer has + // if j == segment_length then the buffer is all zeros so there is no point + // creating the buffer. size_t j = 0; // do nothing whilst 0 for (; j < segment_length && a_src[i * segment_length + j] == 0xFF; j++); @@ -344,11 +344,6 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) sizeof(m_Sections[i]->m_BlockLight) ); } - else - { - Free(m_Sections[i]); - m_Sections[i] = 0; - } } } } diff --git a/src/ChunkData.h b/src/ChunkData.h index 9c852ee24..5a149f95f 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -8,8 +8,7 @@ #include "ChunkDef.h" -#define CHUNK_SECTION_HEIGHT 16 -#define CHUNK_SECTION_NUM (256 / CHUNK_SECTION_HEIGHT) + #if __cplusplus < 201103L // auto_ptr style interface for memory management @@ -23,8 +22,8 @@ public: cChunkData() #if __cplusplus < 201103L - // auto_ptr style interface for memory management - : IsOwner(true) + // auto_ptr style interface for memory management + : IsOwner(true) #endif { memset(m_Sections, 0, sizeof(m_Sections)); @@ -32,72 +31,75 @@ public: ~cChunkData() { #if __cplusplus < 201103L - // auto_ptr style interface for memory management - if (!IsOwner) return; + // auto_ptr style interface for memory management + if (!IsOwner) + { + return; + } #endif - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { if (m_Sections[i] == NULL) Free(m_Sections[i]);; } } #if __cplusplus < 201103L - // auto_ptr style interface for memory management - cChunkData(const cChunkData& other) : - IsOwner(true) - { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + // auto_ptr style interface for memory management + cChunkData(const cChunkData& other) : + IsOwner(true) { - m_Sections[i] = other.m_Sections[i]; - } - other.IsOwner = false; - } - - cChunkData& operator=(const cChunkData& other) - { - if (&other != this) - { - if (IsOwner) - { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) - { - if (m_Sections[i]) Free(m_Sections[i]);; - } - } - IsOwner = true; - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { m_Sections[i] = other.m_Sections[i]; } other.IsOwner = false; } - return *this; - - } - #else - // unique_ptr style interface for memory management - cChunkData(cChunkData&& other) - { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + + cChunkData& operator=(const cChunkData& other) { - m_Sections[i] = other.m_Sections[i]; - other.m_Sections[i] = 0; - } - } - - cChunkData& operator=(cChunkData&& other) - { - if (&other != this) - { - for (int i = 0; i < CHUNK_SECTION_NUM; i++) + if (&other != this) + { + if (IsOwner) + { + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + if (m_Sections[i]) Free(m_Sections[i]);; + } + } + IsOwner = true; + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + m_Sections[i] = other.m_Sections[i]; + } + other.IsOwner = false; + } + return *this; + + } + #else + // unique_ptr style interface for memory management + cChunkData(cChunkData&& other) + { + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - Free(m_Sections[i]);; m_Sections[i] = other.m_Sections[i]; - other.m_Sections[i] = 0; + other.m_Sections[i] = NULL; } } - return *this; - } + + cChunkData& operator=(cChunkData&& other) + { + if (&other != this) + { + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + Free(m_Sections[i]);; + m_Sections[i] = other.m_Sections[i]; + other.m_Sections[i] = NULL; + } + } + return *this; + } #endif BLOCKTYPE GetBlock(int a_X, int a_Y, int a_Z) const @@ -150,7 +152,10 @@ public: NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const { - if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) + if ( + (a_RelX < cChunkDef::Width) && (a_RelX > -1) && + (a_RelY < cChunkDef::Height) && (a_RelY > -1) && + (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; if (m_Sections[Section] != NULL) @@ -244,16 +249,19 @@ public: cChunkData Copy() const; void CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx = 0, size_t length = cChunkDef::NumBlocks) const; void CopyMeta (NIBBLETYPE * a_dest) const; - void CopyLight (NIBBLETYPE * a_dest) const; + void CopyBlockLight (NIBBLETYPE * a_dest) const; void CopySkyLight (NIBBLETYPE * a_dest) const; void SetBlocks (const BLOCKTYPE * a_src); void SetMeta (const NIBBLETYPE * a_src); - void SetLight (const NIBBLETYPE * a_src); + void SetBlockLight (const NIBBLETYPE * a_src); void SetSkyLight (const NIBBLETYPE * a_src); private: + static const size_t CHUNK_SECTION_HEIGHT = 16; + static const size_t CHUNK_SECTION_COUNT = (256 / CHUNK_SECTION_HEIGHT); + #if __cplusplus < 201103L // auto_ptr style interface for memory management mutable bool IsOwner; @@ -266,7 +274,7 @@ private: NIBBLETYPE m_BlockSkyLight[CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; }; - sChunkSection *m_Sections[CHUNK_SECTION_NUM]; + sChunkSection *m_Sections[CHUNK_SECTION_COUNT]; sChunkSection * Allocate() const; void Free(sChunkSection * ptr) const; diff --git a/src/ChunkDataCallback.h b/src/ChunkDataCallback.h index 340582885..e916d6486 100644 --- a/src/ChunkDataCallback.h +++ b/src/ChunkDataCallback.h @@ -62,7 +62,7 @@ protected: /** A simple implementation of the cChunkDataCallback interface that collects all block data into a single buffer */ class cChunkDataArrayCollector : -public cChunkDataCallback + public cChunkDataCallback { public: @@ -75,7 +75,7 @@ protected: { a_ChunkBuffer.CopyBlocks(m_BlockData); a_ChunkBuffer.CopyMeta(m_BlockData + cChunkDef::NumBlocks); - a_ChunkBuffer.CopyLight(m_BlockData + 3 * cChunkDef::NumBlocks / 2); + a_ChunkBuffer.CopyBlockLight(m_BlockData + 3 * cChunkDef::NumBlocks / 2); a_ChunkBuffer.CopySkyLight(m_BlockData + 2 * cChunkDef::NumBlocks); } }; @@ -83,7 +83,7 @@ protected: /** A simple implementation of the cChunkDataCallback interface that collects all block data into a separate buffers */ class cChunkDataSeparateCollector : -public cChunkDataCallback + public cChunkDataCallback { public: @@ -98,7 +98,7 @@ protected: { a_ChunkBuffer.CopyBlocks(m_BlockTypes); a_ChunkBuffer.CopyMeta(m_BlockMetas); - a_ChunkBuffer.CopyLight(m_BlockLight); + a_ChunkBuffer.CopyBlockLight(m_BlockLight); a_ChunkBuffer.CopySkyLight(m_BlockSkyLight); } } ; diff --git a/tests/ChunkData/ArraytoCoord.cpp b/tests/ChunkData/ArraytoCoord.cpp index fe82a3a7b..1138fb5b6 100644 --- a/tests/ChunkData/ArraytoCoord.cpp +++ b/tests/ChunkData/ArraytoCoord.cpp @@ -10,107 +10,77 @@ int main(int argc, char** argv) // Test first segment cChunkData buffer; - BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - SrcBlockBuffer[7+4*16+5*16*16] = 0xCD; + SrcBlockBuffer[7 + (4 * 16) + (5 * 16 * 16)] = 0xCD; buffer.SetBlocks(SrcBlockBuffer); testassert(buffer.GetBlock(7,5,4) == 0xCD); - delete SrcBlockBuffer; - SrcBlockBuffer = NULL; - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - SrcNibbleBuffer[(6+1*16+2*16*16)/2] = 0xE; + NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); + SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xE; buffer.SetMeta(SrcNibbleBuffer); - testassert(buffer.GetMeta(6,2,1) == 0xE); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; + testassert(buffer.GetMeta(6, 2, 1) == 0xE); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - SrcNibbleBuffer[(6+1*16+2*16*16)/2] = 0xE; - buffer.SetLight(SrcNibbleBuffer); - testassert(buffer.GetBlockLight(6,2,1) == 0xE); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); + SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xE; + buffer.SetBlockLight(SrcNibbleBuffer); + testassert(buffer.GetBlockLight(6, 2, 1) == 0xE); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - SrcNibbleBuffer[(6+1*16+2*16*16)/2] = 0xE; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); + SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xE; buffer.SetSkyLight(SrcNibbleBuffer); - testassert(buffer.GetSkyLight(6,2,1) == 0xE); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; + testassert(buffer.GetSkyLight(6, 2, 1) == 0xE); } { // test following segment cChunkData buffer; - BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - SrcBlockBuffer[7+4*16+24*16*16] = 0xCD; + SrcBlockBuffer[7 + (4 * 16) + (24 * 16 * 16)] = 0xCD; buffer.SetBlocks(SrcBlockBuffer); - testassert(buffer.GetBlock(7,24,4) == 0xCD); - delete SrcBlockBuffer; - SrcBlockBuffer = NULL; + testassert(buffer.GetBlock(7, 24, 4) == 0xCD); - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - SrcNibbleBuffer[(6+1*16+24*16*16)/2] = 0xE; + NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); + SrcNibbleBuffer[(6 + (1 * 16) + (24 * 16 * 16)) / 2] = 0xE; buffer.SetMeta(SrcNibbleBuffer); - testassert(buffer.GetMeta(6,24,1) == 0xE); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; + testassert(buffer.GetMeta(6, 24, 1) == 0xE); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); SrcNibbleBuffer[(6+1*16+24*16*16)/2] = 0xE; - buffer.SetLight(SrcNibbleBuffer); + buffer.SetBlockLight(SrcNibbleBuffer); testassert(buffer.GetBlockLight(6,24,1) == 0xE); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - SrcNibbleBuffer[(6+1*16+24*16*16)/2] = 0xE; + memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 / 2); + SrcNibbleBuffer[(6 + (1 * 16) + (24 * 16 * 16))/2] = 0xE; buffer.SetSkyLight(SrcNibbleBuffer); - testassert(buffer.GetSkyLight(6,24,1) == 0xE); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; + testassert(buffer.GetSkyLight(6, 24, 1) == 0xE); } { // test zeros cChunkData buffer; - BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); buffer.SetBlocks(SrcBlockBuffer); - testassert(buffer.GetBlock(7,24,4) == 0x00); - delete SrcBlockBuffer; - SrcBlockBuffer = NULL; + testassert(buffer.GetBlock(7, 24, 4) == 0x00); - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); buffer.SetMeta(SrcNibbleBuffer); - testassert(buffer.GetMeta(6,24,1) == 0x0); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; + testassert(buffer.GetMeta(6, 24, 1) == 0x0); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - buffer.SetLight(SrcNibbleBuffer); + buffer.SetBlockLight(SrcNibbleBuffer); testassert(buffer.GetBlockLight(6,24,1) == 0x0); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); buffer.SetSkyLight(SrcNibbleBuffer); - testassert(buffer.GetSkyLight(6,24,1) == 0xF); - delete SrcNibbleBuffer; - SrcNibbleBuffer = NULL; + testassert(buffer.GetSkyLight(6, 24, 1) == 0xF); } } diff --git a/tests/ChunkData/Coordinates.cpp b/tests/ChunkData/Coordinates.cpp index c0c46000e..f02b68d40 100644 --- a/tests/ChunkData/Coordinates.cpp +++ b/tests/ChunkData/Coordinates.cpp @@ -10,18 +10,18 @@ int main(int argc, char** argv) cChunkData buffer; // Empty chunks - buffer.SetBlock(0,0,0, 0xAB); - testassert(buffer.GetBlock(0,0,0) == 0xAB); - buffer.SetMeta(0,16,0, 0xC); - testassert(buffer.GetMeta(0,16,0) == 0xC); + buffer.SetBlock(0, 0, 0, 0xAB); + testassert(buffer.GetBlock(0, 0, 0) == 0xAB); + buffer.SetMeta(0, 16, 0, 0xC); + testassert(buffer.GetMeta(0, 16, 0) == 0xC); // loaded but not written segments - testassert(buffer.GetBlock(1,0,0) == 0x0); - testassert(buffer.GetMeta(1,16,0) == 0x0); + testassert(buffer.GetBlock(1, 0, 0) == 0x0); + testassert(buffer.GetMeta(1, 16, 0) == 0x0); // Notloaded segments - testassert(buffer.GetBlock(0,32,0) == 0x0); - testassert(buffer.GetMeta(0,48,0) == 0x0); + testassert(buffer.GetBlock(0, 32, 0) == 0x0); + testassert(buffer.GetMeta(0, 48, 0) == 0x0); // Out of Range CheckAsserts( @@ -108,35 +108,35 @@ int main(int argc, char** argv) cChunkData buffer; // Zero's - buffer.SetBlock(0,0,0, 0x0); - buffer.SetBlock(0,0,1, 0xAB); - testassert(buffer.GetBlock(0,0,0) == 0x0); - testassert(buffer.GetBlock(0,0,1) == 0xAB); + buffer.SetBlock(0, 0, 0, 0x0); + buffer.SetBlock(0, 0, 1, 0xAB); + testassert(buffer.GetBlock(0, 0, 0) == 0x0); + testassert(buffer.GetBlock(0, 0, 1) == 0xAB); - buffer.SetMeta(0,16,0, 0x0); - buffer.SetMeta(0,16,1, 0xC); - testassert(buffer.GetMeta(0,16,0) == 0x0); - testassert(buffer.GetMeta(0,16,1) == 0xC); + buffer.SetMeta(0, 16, 0, 0x0); + buffer.SetMeta(0, 16, 1, 0xC); + testassert(buffer.GetMeta(0, 16, 0) == 0x0); + testassert(buffer.GetMeta(0, 16, 1) == 0xC); } { // Operator = cChunkData buffer; - buffer.SetBlock(0,0,0,0x42); + buffer.SetBlock(0, 0, 0, 0x42); cChunkData copy; #if __cplusplus < 201103L copy = buffer; #else copy = std::move(buffer); #endif - testassert(copy.GetBlock(0,0,0) == 0x42); + testassert(copy.GetBlock(0, 0, 0) == 0x42); #if __cplusplus < 201103L copy = copy; #else copy = std::move(copy); #endif - testassert(copy.GetBlock(0,0,0) == 0x42); + testassert(copy.GetBlock(0, 0, 0) == 0x42); } return 0; diff --git a/tests/ChunkData/Copies.cpp b/tests/ChunkData/Copies.cpp index 145ffd8e0..b10ddb759 100644 --- a/tests/ChunkData/Copies.cpp +++ b/tests/ChunkData/Copies.cpp @@ -9,14 +9,14 @@ int main(int argc, char** argv) { cChunkData buffer; - buffer.SetBlock(3,1,4,0xDE); - buffer.SetMeta(3,1,4,0xA); + buffer.SetBlock(3, 1, 4, 0xDE); + buffer.SetMeta(3, 1, 4, 0xA); cChunkData copy = buffer.Copy(); - testassert(copy.GetBlock(3,1,4) == 0xDE); - testassert(copy.GetMeta(3,1,4) == 0xA); + testassert(copy.GetBlock(3, 1, 4) == 0xDE); + testassert(copy.GetMeta(3, 1, 4) == 0xA); - BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; for (int i = 0; i < 16 * 16 * 256; i += 4) { SrcBlockBuffer[i+0] = 0xDE; @@ -26,30 +26,20 @@ int main(int argc, char** argv) } buffer.SetBlocks(SrcBlockBuffer); - BLOCKTYPE * DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + BLOCKTYPE DstBlockBuffer[16 * 16 * 256]; buffer.CopyBlocks(DstBlockBuffer); - testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); - delete SrcBlockBuffer; - delete DstBlockBuffer; - SrcBlockBuffer = NULL; - DstBlockBuffer = NULL; + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) - 1) == 0); - SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); buffer.SetBlocks(SrcBlockBuffer); - DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; buffer.CopyBlocks(DstBlockBuffer); - testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); - delete SrcBlockBuffer; - delete DstBlockBuffer; - SrcBlockBuffer = NULL; - DstBlockBuffer = NULL; + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) - 1) == 0); } { cChunkData buffer; - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) { SrcNibbleBuffer[i+0] = 0xEF; @@ -59,30 +49,21 @@ int main(int argc, char** argv) } buffer.SetMeta(SrcNibbleBuffer); - NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + NIBBLETYPE DstNibbleBuffer[16 * 16 * 256/ 2]; buffer.CopyMeta(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); buffer.SetMeta(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; buffer.CopyMeta(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); + } { cChunkData buffer; - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) { SrcNibbleBuffer[i+0] = 0xDE; @@ -91,32 +72,22 @@ int main(int argc, char** argv) SrcNibbleBuffer[i+3] = 0xEF; } - buffer.SetLight(SrcNibbleBuffer); - NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + buffer.SetBlockLight(SrcNibbleBuffer); + NIBBLETYPE DstNibbleBuffer[16 * 16 * 256 / 2]; + buffer.CopyBlockLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) - 1) == 0); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - buffer.SetLight(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + buffer.SetBlockLight(SrcNibbleBuffer); + buffer.CopyBlockLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) - 1) == 0); } { cChunkData buffer; - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; + NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) { SrcNibbleBuffer[i+0] = 0xAD; @@ -126,68 +97,38 @@ int main(int argc, char** argv) } buffer.SetSkyLight(SrcNibbleBuffer); - NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + NIBBLETYPE DstNibbleBuffer[16 * 16 * 256/ 2]; buffer.CopySkyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); + memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 / 2); buffer.SetSkyLight(SrcNibbleBuffer); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; buffer.CopySkyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); } { cChunkData buffer; - BLOCKTYPE * SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - BLOCKTYPE * DstBlockBuffer = new BLOCKTYPE[16 * 16 * 256]; + BLOCKTYPE DstBlockBuffer[16 * 16 * 256]; buffer.CopyBlocks(DstBlockBuffer); - testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) -1) == 0); - delete SrcBlockBuffer; - delete DstBlockBuffer; - SrcBlockBuffer = NULL; - DstBlockBuffer = NULL; + testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) - 1) == 0); - NIBBLETYPE * SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - NIBBLETYPE * DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); + NIBBLETYPE DstNibbleBuffer[16 * 16 * 256 / 2]; buffer.CopyMeta(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; - buffer.CopyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); + buffer.CopyBlockLight(DstNibbleBuffer); + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); - SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); - DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2]; + memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 / 2); buffer.CopySkyLight(DstNibbleBuffer); - testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0); - delete SrcNibbleBuffer; - delete DstNibbleBuffer; - SrcNibbleBuffer = NULL; - DstNibbleBuffer = NULL; + testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); } } From 7fac63cffbe226ab025435a1e01e5f2430e52806 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 24 May 2014 13:37:25 +0100 Subject: [PATCH 142/214] Moved accessors to cpp file --- src/ChunkData.cpp | 230 +++++++++++++++++++++++++++++++++++++++++++++- src/ChunkData.h | 227 +++------------------------------------------ 2 files changed, 241 insertions(+), 216 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 098f436f8..162803292 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -2,7 +2,235 @@ #include "Globals.h" #include "ChunkData.h" -cChunkData cChunkData::Copy() const +cChunkData::cChunkData() +#if __cplusplus < 201103L + // auto_ptr style interface for memory management + : IsOwner(true) +#endif +{ + memset(m_Sections, 0, sizeof(m_Sections)); +} + + +cChunkData::~cChunkData() +{ + #if __cplusplus < 201103L + // auto_ptr style interface for memory management + if (!IsOwner) + { + return; + } + #endif + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + if (m_Sections[i] == NULL) Free(m_Sections[i]);; + } +} + +#if __cplusplus < 201103L + // auto_ptr style interface for memory management + cChunkData::cChunkData(const cChunkData& other) : + IsOwner(true) + { + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + m_Sections[i] = other.m_Sections[i]; + } + other.IsOwner = false; + } + + cChunkData::cChunkData& operator=(const cChunkData& other) + { + if (&other != this) + { + if (IsOwner) + { + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + if (m_Sections[i]) Free(m_Sections[i]);; + } + } + IsOwner = true; + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + m_Sections[i] = other.m_Sections[i]; + } + other.IsOwner = false; + } + return *this; + + } +#else + // unique_ptr style interface for memory management + cChunkData::cChunkData(cChunkData&& other) + { + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + m_Sections[i] = other.m_Sections[i]; + other.m_Sections[i] = NULL; + } + } + + cChunkData::cChunkData& operator=(cChunkData&& other) + { + if (&other != this) + { + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + Free(m_Sections[i]);; + m_Sections[i] = other.m_Sections[i]; + other.m_Sections[i] = NULL; + } + } + return *this; + } +#endif + +BLOCKTYPE cChunkData::GetBlock(int a_X, int a_Y, int a_Z) const +{ + ASSERT((a_X >= 0) && (a_X < cChunkDef::Width)); + ASSERT((a_Y >= 0) && (a_Y < cChunkDef::Height)); + ASSERT((a_Z >= 0) && (a_Z < cChunkDef::Width)); + int Section = a_Y / CHUNK_SECTION_HEIGHT; + if (m_Sections[Section] != NULL) + { + int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * CHUNK_SECTION_HEIGHT), a_Z); + return m_Sections[Section]->m_BlockTypes[Index]; + } + else + { + return 0; + } +} + +void cChunkData::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) +{ + if ( + (a_RelX >= cChunkDef::Width) || (a_RelX < 0) || + (a_RelY >= cChunkDef::Height) || (a_RelY < 0) || + (a_RelZ >= cChunkDef::Width) || (a_RelZ < 0) + ) + { + ASSERT(!"cChunkData::SetMeta(): index out of range!"); + return; + } + + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if (m_Sections[Section] == NULL) + { + if (a_Block == 0x00) + { + return; + } + m_Sections[Section] = Allocate(); + if (m_Sections[Section] == NULL) + { + ASSERT(!"Failed to allocate a new section in Chunkbuffer"); + return; + } + ZeroSection(m_Sections[Section]); + } + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + m_Sections[Section]->m_BlockTypes[Index] = a_Block; +} + +NIBBLETYPE cChunkData::GetMeta(int a_RelX, int a_RelY, int a_RelZ) const +{ + if ( + (a_RelX < cChunkDef::Width) && (a_RelX > -1) && + (a_RelY < cChunkDef::Height) && (a_RelY > -1) && + (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) + { + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if (m_Sections[Section] != NULL) + { + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f; + } + else + { + return 0; + } + } + ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); + return 0; +} + +bool cChunkData::SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble) +{ + if ( + (a_RelX >= cChunkDef::Width) || (a_RelX < 0) || + (a_RelY >= cChunkDef::Height) || (a_RelY < 0) || + (a_RelZ >= cChunkDef::Width) || (a_RelZ < 0) + ) + { + ASSERT(!"cChunkData::SetMeta(): index out of range!"); + return false; + } + + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if (m_Sections[Section] == NULL) + { + if ((a_Nibble & 0xf) == 0x00) + { + return false; + } + m_Sections[Section] = Allocate(); + if (m_Sections[Section] == NULL) + { + ASSERT(!"Failed to allocate a new section in Chunkbuffer"); + return false; + } + ZeroSection(m_Sections[Section]); + } + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + NIBBLETYPE oldval = m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4) & 0xf; + m_Sections[Section]->m_BlockMeta[Index / 2] = static_cast( + (m_Sections[Section]->m_BlockMeta[Index / 2] & (0xf0 >> ((Index & 1) * 4))) | // The untouched nibble + ((a_Nibble & 0x0f) << ((Index & 1) * 4)) // The nibble being set + ); + return oldval == a_Nibble; +} + +NIBBLETYPE cChunkData::GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const +{ + if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) + { + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if (m_Sections[Section] != NULL) + { + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; + } + else + { + return 0; + } + } + ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); + return 0; +} + +NIBBLETYPE cChunkData::GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const +{ + if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) + { + int Section = a_RelY / CHUNK_SECTION_HEIGHT; + if (m_Sections[Section] != NULL) + { + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; + } + else + { + return 0xF; + } + } + ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); + return 0; +} + +cChunkData cChunkData::cChunkData::Copy() const { cChunkData copy; for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) diff --git a/src/ChunkData.h b/src/ChunkData.h index 5a149f95f..16fcc4d37 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -20,231 +20,28 @@ class cChunkData { public: - cChunkData() - #if __cplusplus < 201103L - // auto_ptr style interface for memory management - : IsOwner(true) - #endif - { - memset(m_Sections, 0, sizeof(m_Sections)); - } - ~cChunkData() - { - #if __cplusplus < 201103L - // auto_ptr style interface for memory management - if (!IsOwner) - { - return; - } - #endif - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) - { - if (m_Sections[i] == NULL) Free(m_Sections[i]);; - } - } + cChunkData(); + ~cChunkData(); #if __cplusplus < 201103L // auto_ptr style interface for memory management - cChunkData(const cChunkData& other) : - IsOwner(true) - { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) - { - m_Sections[i] = other.m_Sections[i]; - } - other.IsOwner = false; - } - - cChunkData& operator=(const cChunkData& other) - { - if (&other != this) - { - if (IsOwner) - { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) - { - if (m_Sections[i]) Free(m_Sections[i]);; - } - } - IsOwner = true; - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) - { - m_Sections[i] = other.m_Sections[i]; - } - other.IsOwner = false; - } - return *this; - - } + cChunkData(const cChunkData& other); + cChunkData& operator=(const cChunkData& other); #else // unique_ptr style interface for memory management - cChunkData(cChunkData&& other) - { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) - { - m_Sections[i] = other.m_Sections[i]; - other.m_Sections[i] = NULL; - } - } - - cChunkData& operator=(cChunkData&& other) - { - if (&other != this) - { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) - { - Free(m_Sections[i]);; - m_Sections[i] = other.m_Sections[i]; - other.m_Sections[i] = NULL; - } - } - return *this; - } + cChunkData(cChunkData&& other); + cChunkData& operator=(cChunkData&& other); #endif - BLOCKTYPE GetBlock(int a_X, int a_Y, int a_Z) const - { - ASSERT((a_X >= 0) && (a_X < cChunkDef::Width)); - ASSERT((a_Y >= 0) && (a_Y < cChunkDef::Height)); - ASSERT((a_Z >= 0) && (a_Z < cChunkDef::Width)); - int Section = a_Y / CHUNK_SECTION_HEIGHT; - if (m_Sections[Section] != NULL) - { - int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * CHUNK_SECTION_HEIGHT), a_Z); - return m_Sections[Section]->m_BlockTypes[Index]; - } - else - { - return 0; - } - } - - void SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) - { - if ( - (a_RelX >= cChunkDef::Width) || (a_RelX < 0) || - (a_RelY >= cChunkDef::Height) || (a_RelY < 0) || - (a_RelZ >= cChunkDef::Width) || (a_RelZ < 0) - ) - { - ASSERT(!"cChunkData::SetMeta(): index out of range!"); - return; - } + BLOCKTYPE GetBlock(int a_X, int a_Y, int a_Z) const; + void SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block); - int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if (m_Sections[Section] == NULL) - { - if (a_Block == 0x00) - { - return; - } - m_Sections[Section] = Allocate(); - if (m_Sections[Section] == NULL) - { - ASSERT(!"Failed to allocate a new section in Chunkbuffer"); - return; - } - ZeroSection(m_Sections[Section]); - } - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); - m_Sections[Section]->m_BlockTypes[Index] = a_Block; - } - - NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const - { - if ( - (a_RelX < cChunkDef::Width) && (a_RelX > -1) && - (a_RelY < cChunkDef::Height) && (a_RelY > -1) && - (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) - { - int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if (m_Sections[Section] != NULL) - { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); - return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f; - } - else - { - return 0; - } - } - ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); - return 0; - } + NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const; + bool SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble); - bool SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble) - { - if ( - (a_RelX >= cChunkDef::Width) || (a_RelX < 0) || - (a_RelY >= cChunkDef::Height) || (a_RelY < 0) || - (a_RelZ >= cChunkDef::Width) || (a_RelZ < 0) - ) - { - ASSERT(!"cChunkData::SetMeta(): index out of range!"); - return false; - } - - int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if (m_Sections[Section] == NULL) - { - if ((a_Nibble & 0xf) == 0x00) - { - return false; - } - m_Sections[Section] = Allocate(); - if (m_Sections[Section] == NULL) - { - ASSERT(!"Failed to allocate a new section in Chunkbuffer"); - return false; - } - ZeroSection(m_Sections[Section]); - } - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); - NIBBLETYPE oldval = m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4) & 0xf; - m_Sections[Section]->m_BlockMeta[Index / 2] = static_cast( - (m_Sections[Section]->m_BlockMeta[Index / 2] & (0xf0 >> ((Index & 1) * 4))) | // The untouched nibble - ((a_Nibble & 0x0f) << ((Index & 1) * 4)) // The nibble being set - ); - return oldval == a_Nibble; - } + NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const; - NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const - { - if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) - { - int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if (m_Sections[Section] != NULL) - { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); - return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; - } - else - { - return 0; - } - } - ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); - return 0; - } - - NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const - { - if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) - { - int Section = a_RelY / CHUNK_SECTION_HEIGHT; - if (m_Sections[Section] != NULL) - { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); - return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; - } - else - { - return 0xF; - } - } - ASSERT(!"cChunkData::GetMeta(): coords out of chunk range!"); - return 0; - } + NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const; cChunkData Copy() const; void CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx = 0, size_t length = cChunkDef::NumBlocks) const; From 96a22cd82c350b1205985a9b8e01f5e6c11f069a Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 24 May 2014 15:03:39 +0200 Subject: [PATCH 143/214] Added Japanese village prefabs. --- src/Generating/Prefab.cpp | 9 + src/Generating/Prefab.h | 3 + .../Prefabs/JapaneseVillagePrefabs.cpp | 2404 +++++++++++++++++ .../Prefabs/JapaneseVillagePrefabs.h | 15 + src/Generating/VillageGen.cpp | 15 +- 5 files changed, 2442 insertions(+), 4 deletions(-) create mode 100644 src/Generating/Prefabs/JapaneseVillagePrefabs.cpp create mode 100644 src/Generating/Prefabs/JapaneseVillagePrefabs.h diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index 506e1c2cc..05979507a 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -292,6 +292,15 @@ int cPrefab::GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cC +void cPrefab::SetDefaultWeight(int a_DefaultWeight) +{ + m_DefaultWeight = a_DefaultWeight; +} + + + + + void cPrefab::AddConnector(int a_RelX, int a_RelY, int a_RelZ, eBlockFace a_Direction, int a_Type) { m_Connectors.push_back(cConnector(a_RelX, a_RelY, a_RelZ, a_Type, a_Direction)); diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h index 2b89a204c..adc0e688e 100644 --- a/src/Generating/Prefab.h +++ b/src/Generating/Prefab.h @@ -104,6 +104,9 @@ public: PiecePool implementations can use this for their GetPieceWeight() implementations. */ int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector) const; + /** Sets the (unmodified) DefaultWeight property for this piece. */ + void SetDefaultWeight(int a_DefaultWeight); + /** Returns the unmodified DefaultWeight property for the piece. */ int GetDefaultWeight(void) const { return m_DefaultWeight; } diff --git a/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp b/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp new file mode 100644 index 000000000..2b129f520 --- /dev/null +++ b/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp @@ -0,0 +1,2404 @@ + +// JapaneseVillagePrefabs.cpp + +// Defines the prefabs in the group JapaneseVillage + +// NOTE: This file has been generated automatically by GalExport! +// Any manual changes will be overwritten by the next automatic export! + +#include "Globals.h" +#include "JapaneseVillagePrefabs.h" + + + + + +const cPrefab::sDef g_JapaneseVillagePrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Arch: + // The data has been exported from the gallery Plains, area index 144, ID 488, created by Aloe_vera + { + // Size: + 11, 7, 5, // SizeX = 11, SizeY = 7, SizeZ = 5 + + // Hitbox (relative to bounding box): + -1, 0, 0, // MinX, MinY, MinZ + 11, 6, 4, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 2: 0\n" /* grass */ + "b: 13: 0\n" /* gravel */ + "c:113: 0\n" /* netherbrickfence */ + "d: 50: 5\n" /* torch */ + "e: 44: 8\n" /* step */ + "f: 44: 0\n" /* step */ + "g: 43: 0\n" /* doubleslab */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaabbbaaaa" + /* 1 */ "aaaabbbaaaa" + /* 2 */ "aaaabbbaaaa" + /* 3 */ "aaaabbbaaaa" + /* 4 */ "aaaabbbaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..c.....c.." + /* 1 */ "..c.....c.." + /* 2 */ "..c.....c.." + /* 3 */ "..c.....c.." + /* 4 */ "..c.....c.." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..c.....c.." + /* 1 */ "..........." + /* 2 */ "..c.....c.." + /* 3 */ "..........." + /* 4 */ "..c.....c.." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..d.....d.." + /* 1 */ "..........." + /* 2 */ "..c.....c.." + /* 3 */ "..........." + /* 4 */ "..d.....d.." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...eeeee..." + /* 1 */ "..........." + /* 2 */ "..c.....c.." + /* 3 */ "..........." + /* 4 */ "...eeeee..." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..f.....f.." + /* 1 */ ".egfffffge." + /* 2 */ ".egeeeeege." + /* 3 */ ".egfffffge." + /* 4 */ "..f.....f.." + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "gf.......fg" + /* 3 */ "..........." + /* 4 */ "...........", + + // Connectors: + "2: 5, 1, 4: 3\n" /* Type 2, direction Z+ */ + "2: 5, 1, 0: 2\n" /* Type 2, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Arch + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Forge: + // The data has been exported from the gallery Plains, area index 79, ID 145, created by Aloe_vera + { + // Size: + 16, 11, 14, // SizeX = 16, SizeY = 11, SizeZ = 14 + + // Hitbox (relative to bounding box): + 0, 0, -1, // MinX, MinY, MinZ + 16, 10, 14, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 4: 0\n" /* cobblestone */ + "b: 17: 1\n" /* tree */ + "c: 67: 0\n" /* stairs */ + "d: 5: 2\n" /* wood */ + "e: 67: 2\n" /* stairs */ + "f:113: 0\n" /* netherbrickfence */ + "g:118: 2\n" /* cauldronblock */ + "h: 67: 6\n" /* stairs */ + "i: 67: 4\n" /* stairs */ + "j: 87: 0\n" /* netherstone */ + "k: 67: 7\n" /* stairs */ + "l: 54: 5\n" /* chest */ + "m: 19: 0\n" /* sponge */ + "n: 61: 2\n" /* furnace */ + "o:101: 0\n" /* ironbars */ + "p: 51: 0\n" /* fire */ + "q: 50: 4\n" /* torch */ + "r: 50: 2\n" /* torch */ + "s: 35: 0\n" /* wool */ + "t: 67: 3\n" /* stairs */ + "u: 50: 3\n" /* torch */ + "v: 44: 8\n" /* step */ + "w: 43: 0\n" /* doubleslab */ + "x: 44: 0\n" /* step */ + "y: 17: 5\n" /* tree */ + "z: 17: 9\n" /* tree */, + + // Block data: + // Level 0 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "mmmmmmmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmmmmmmm" + /* 2 */ "mmaaaaaaaaaaaamm" + /* 3 */ "mmaaaaaaaaaaaamm" + /* 4 */ "mmaaaaaaaaaaaamm" + /* 5 */ "mmaaaaaaaaaaaamm" + /* 6 */ "mmaaaaaaaaaaaamm" + /* 7 */ "mmaaaaaaaaaaaamm" + /* 8 */ "mmaaaaaaaaaaaamm" + /* 9 */ "mmaaaaaaaaaaaamm" + /* 10 */ "mmaaaaaaaaaaaamm" + /* 11 */ "mmaaaaaaaaaaaamm" + /* 12 */ "mmmmmmmmmmmmmmmm" + /* 13 */ "mmmmmmmmmmmmmmmm" + + // Level 1 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ ".....bbbbbbbbb.." + /* 3 */ ".....cdddddddb.." + /* 4 */ ".....cddaaaadb.." + /* 5 */ "..beeedaaaaadb.." + /* 6 */ "..bddddaaaaadb.." + /* 7 */ "..bddddaaaaadb.." + /* 8 */ "..bddddaaaaadb.." + /* 9 */ "..bddddaaaaadb.." + /* 10 */ "..bddddddddddb.." + /* 11 */ "..bbbbbbbbbbbb.." + /* 12 */ "................" + /* 13 */ "................" + + // Level 2 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ ".....bfffbfffb.." + /* 3 */ ".............a.." + /* 4 */ ".............a.." + /* 5 */ "..b.....ghh..a.." + /* 6 */ "..f.....haa..b.." + /* 7 */ "..f.....ija..b.." + /* 8 */ "..f.....kaa..a.." + /* 9 */ "..f..........a.." + /* 10 */ "..fl.........a.." + /* 11 */ "..bffffbbffffb.." + /* 12 */ "................" + /* 13 */ "................" + + // Level 3 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ ".....bfffbfffb.." + /* 3 */ ".............a.." + /* 4 */ ".............a.." + /* 5 */ "..b......nn..a.." + /* 6 */ "..f.....oaa..b.." + /* 7 */ "..f.....opa..b.." + /* 8 */ "..f.....oaa..a.." + /* 9 */ "..f..........a.." + /* 10 */ "..f..........a.." + /* 11 */ "..bffffbbffffb.." + /* 12 */ "................" + /* 13 */ "................" + + // Level 4 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ ".........q...q.." + /* 2 */ "....rbsssbsssb.." + /* 3 */ ".............a.." + /* 4 */ "..q..........a.." + /* 5 */ "..b......ce..a.." + /* 6 */ "..s......ea..b.." + /* 7 */ "..s......aa..b.." + /* 8 */ "..s......ta..a.." + /* 9 */ "..s..........a.." + /* 10 */ "..s..........a.." + /* 11 */ ".rbssssbbssssb.." + /* 12 */ "..u....uu....u.." + /* 13 */ "................" + + // Level 5 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ ".vwxxxxxxxxxxwv." + /* 1 */ "vvvvvvvvvvvvvvvv" + /* 2 */ "wvbyybyyybbyybvw" + /* 3 */ "xvz..........zvx" + /* 4 */ "xvz..........zvx" + /* 5 */ "xvb..........zvx" + /* 6 */ "xvz.......a..bvx" + /* 7 */ "xvz......ca..bvx" + /* 8 */ "xvz.......a..zvx" + /* 9 */ "xvz..........zvx" + /* 10 */ "xvz..........zvx" + /* 11 */ "wvbyyyyyyyyyybvw" + /* 12 */ "vvvvvvvvvvvvvvvv" + /* 13 */ ".vwxxxxxxxxxxwv." + + // Level 6 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "wx............xw" + /* 1 */ "x..............x" + /* 2 */ "..xxxxxxxxxxxx.." + /* 3 */ "..xwwwwwwwwwwx.." + /* 4 */ "..xwvvvvvvvvvx.." + /* 5 */ "..xwv.......vx.." + /* 6 */ "..xwv.....a.vx.." + /* 7 */ "..xwv.....a.vx.." + /* 8 */ "..xwv.....a.vx.." + /* 9 */ "..xwvvvvvvvvvx.." + /* 10 */ "..xwwwwwwwwwwx.." + /* 11 */ "..xxxxxxxxxxxx.." + /* 12 */ "x..............x" + /* 13 */ "wx............xw" + + // Level 7 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "................" + /* 4 */ "....xxxxxxxx...." + /* 5 */ "....xxxxxxxx...." + /* 6 */ "....xwwwwwax...." + /* 7 */ "....xwvvvvax...." + /* 8 */ "....xwwwwwax...." + /* 9 */ "....xxxxxxxx...." + /* 10 */ "................" + /* 11 */ "................" + /* 12 */ "................" + /* 13 */ "................" + + // Level 8 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "................" + /* 4 */ "................" + /* 5 */ "................" + /* 6 */ "..........a....." + /* 7 */ ".......xx.a....." + /* 8 */ "..........a....." + /* 9 */ "................" + /* 10 */ "................" + /* 11 */ "................" + /* 12 */ "................" + /* 13 */ "................" + + // Level 9 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "................" + /* 4 */ "................" + /* 5 */ "................" + /* 6 */ "..........a....." + /* 7 */ "..........a....." + /* 8 */ "..........a....." + /* 9 */ "................" + /* 10 */ "................" + /* 11 */ "................" + /* 12 */ "................" + /* 13 */ "................" + + // Level 10 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "................" + /* 4 */ "................" + /* 5 */ "................" + /* 6 */ "..........a....." + /* 7 */ "..........a....." + /* 8 */ "..........a....." + /* 9 */ "................" + /* 10 */ "................" + /* 11 */ "................" + /* 12 */ "................" + /* 13 */ "................", + + // Connectors: + "-1: 0, 1, 3: 4\n" /* Type -1, direction X- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Forge + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseMid: + // The data has been exported from the gallery Plains, area index 62, ID 119, created by Aloe_vera + { + // Size: + 10, 9, 9, // SizeX = 10, SizeY = 9, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, -1, // MinX, MinY, MinZ + 10, 8, 9, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b:135: 2\n" /* 135 */ + "c:135: 0\n" /* 135 */ + "d: 17: 9\n" /* tree */ + "e:135: 3\n" /* 135 */ + "f: 85: 0\n" /* fence */ + "g: 17: 1\n" /* tree */ + "h:171: 0\n" /* carpet */ + "i: 50: 5\n" /* torch */ + "j: 35: 0\n" /* wool */ + "k: 17: 5\n" /* tree */ + "l:124: 0\n" /* redstonelampon */ + "m: 19: 0\n" /* sponge */ + "n: 69: 9\n" /* lever */ + "o: 44: 8\n" /* step */ + "p: 43: 0\n" /* doubleslab */ + "q: 44: 0\n" /* step */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "maaaaaaaaa" + /* 1 */ "maaaaaaaaa" + /* 2 */ "aaaaaaaaaa" + /* 3 */ "aaaaaaaaaa" + /* 4 */ "aaaaaaaaaa" + /* 5 */ "aaaaaaaaaa" + /* 6 */ "aaaaaaaaaa" + /* 7 */ "maaaaaaaaa" + /* 8 */ "maaaaaaaaa" + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".aaaaaaaaa" + /* 1 */ ".aaaaaaaaa" + /* 2 */ "baaaaaaaaa" + /* 3 */ "caaaaaaaaa" + /* 4 */ "caadaaaaaa" + /* 5 */ "caaaaaaaaa" + /* 6 */ "eaaaaaaaaa" + /* 7 */ ".aaaaaaaaa" + /* 8 */ ".aaaaaaaaa" + + // Level 2 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".fffffffff" + /* 1 */ ".f.......f" + /* 2 */ ".f.ggggg.f" + /* 3 */ "...ghhhg.f" + /* 4 */ "....hhhg.f" + /* 5 */ "...ghhhg.f" + /* 6 */ ".f.ggggg.f" + /* 7 */ ".f.......f" + /* 8 */ ".fffffffff" + + // Level 3 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".....i...i" + /* 1 */ ".........." + /* 2 */ ".i.jjgjj.." + /* 3 */ "...g...j.." + /* 4 */ ".......g.i" + /* 5 */ "...g...j.." + /* 6 */ ".i.jjgjj.." + /* 7 */ ".........." + /* 8 */ ".....i...i" + + // Level 4 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".........." + /* 2 */ "...jjgjj.." + /* 3 */ "...g...j.." + /* 4 */ "...j...g.." + /* 5 */ "...g...j.." + /* 6 */ "...jjgjj.." + /* 7 */ ".........." + /* 8 */ ".........." + + // Level 5 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ "...f...f.." + /* 2 */ "..fgkgkgf." + /* 3 */ "..fd...d.." + /* 4 */ "...d.lng.." + /* 5 */ "..fd...d.." + /* 6 */ "..fgkgkgf." + /* 7 */ "...f...f.." + /* 8 */ ".........." + + // Level 6 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "...ooooo.." + /* 1 */ "..opppppo." + /* 2 */ ".opgjjjgpo" + /* 3 */ ".opjgggjpo" + /* 4 */ ".opjgggjpo" + /* 5 */ ".opjgggjpo" + /* 6 */ ".opgjjjgpo" + /* 7 */ "..opppppo." + /* 8 */ "...ooooo.." + + // Level 7 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".opq...qpo" + /* 1 */ ".pq.....qp" + /* 2 */ ".q.qqqqq.q" + /* 3 */ "...qpppq.." + /* 4 */ "...qpppq.." + /* 5 */ "...qpppq.." + /* 6 */ ".q.qqqqq.q" + /* 7 */ ".pq.....qp" + /* 8 */ ".opq...qpo" + + // Level 8 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".q.......q" + /* 1 */ ".........." + /* 2 */ ".........." + /* 3 */ ".........." + /* 4 */ ".....q...." + /* 5 */ ".........." + /* 6 */ ".........." + /* 7 */ ".........." + /* 8 */ ".q.......q", + + // Connectors: + "-1: 0, 1, 4: 4\n" /* Type -1, direction X- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseMid + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseSmall: + // The data has been exported from the gallery Plains, area index 68, ID 131, created by Aloe_vera + { + // Size: + 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + -1, 0, 0, // MinX, MinY, MinZ + 7, 5, 7, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b: 17: 1\n" /* tree */ + "c: 35: 0\n" /* wool */ + "d: 50: 4\n" /* torch */ + "e: 85: 0\n" /* fence */ + "f: 44: 8\n" /* step */ + "g: 43: 0\n" /* doubleslab */ + "h: 44: 0\n" /* step */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "maaaaam" + /* 2 */ "maaaaam" + /* 3 */ "maaaaam" + /* 4 */ "maaaaam" + /* 5 */ "maaaaam" + /* 6 */ "mmmmmmm" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".bcc.b." + /* 2 */ ".c...c." + /* 3 */ ".c...c." + /* 4 */ ".c...c." + /* 5 */ ".bcccb." + /* 6 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ ".....d." + /* 1 */ ".bee.b." + /* 2 */ ".c...c." + /* 3 */ ".e...e." + /* 4 */ ".c...c." + /* 5 */ ".beeeb." + /* 6 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ ".fffff." + /* 1 */ "fbcccbf" + /* 2 */ "fc...cf" + /* 3 */ "fc...cf" + /* 4 */ "fc...cf" + /* 5 */ "fbcccbf" + /* 6 */ ".fffff." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "gh...hg" + /* 1 */ "hhhhhhh" + /* 2 */ ".hgggh." + /* 3 */ ".hgggh." + /* 4 */ ".hgggh." + /* 5 */ "hhhhhhh" + /* 6 */ "gh...hg" + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "......." + /* 3 */ "...h..." + /* 4 */ "......." + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseSmall + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseSmallDouble: + // The data has been exported from the gallery Plains, area index 72, ID 135, created by Aloe_vera + { + // Size: + 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + -1, 0, 0, // MinX, MinY, MinZ + 11, 5, 7, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b: 17: 1\n" /* tree */ + "c: 35: 0\n" /* wool */ + "d:171:12\n" /* carpet */ + "e:135: 1\n" /* 135 */ + "f:126: 2\n" /* woodenslab */ + "g:135: 2\n" /* 135 */ + "h: 50: 4\n" /* torch */ + "i: 85: 0\n" /* fence */ + "j: 44: 8\n" /* step */ + "k: 43: 0\n" /* doubleslab */ + "l: 44: 0\n" /* step */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "maaaaaaaaam" + /* 2 */ "maaaaaaaaam" + /* 3 */ "maaaaaaaaam" + /* 4 */ "maaaaaaaaam" + /* 5 */ "maaaaaaaaam" + /* 6 */ "mmmmmmmmmmm" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".bcc.bcccb." + /* 2 */ ".cddd.dddc." + /* 3 */ ".ceddcdfdc." + /* 4 */ ".cggdcdddc." + /* 5 */ ".bcccbcccb." + /* 6 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ ".h...h...h." + /* 1 */ ".bii.biiib." + /* 2 */ ".c.......c." + /* 3 */ ".i...i...i." + /* 4 */ ".c...i...c." + /* 5 */ ".biiibiiib." + /* 6 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ ".jjjjjjjjj." + /* 1 */ "jbiiibiiibj" + /* 2 */ "jc.......cj" + /* 3 */ "jc...c...cj" + /* 4 */ "jc...c...cj" + /* 5 */ "jbcccbcccbj" + /* 6 */ ".jjjjjjjjj." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "kl...l...lk" + /* 1 */ "lllllllllll" + /* 2 */ ".lkkklkkkl." + /* 3 */ ".lkjklkkkl." + /* 4 */ ".lkkklkkkl." + /* 5 */ "lllllllllll" + /* 6 */ "kl...l...lk" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "...l...l..." + /* 4 */ "..........." + /* 5 */ "..........." + /* 6 */ "...........", + + // Connectors: + "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseSmallDouble + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseWide: + // The data has been exported from the gallery Plains, area index 64, ID 121, created by STR_Warrior + { + // Size: + 11, 6, 11, // SizeX = 11, SizeY = 6, SizeZ = 11 + + // Hitbox (relative to bounding box): + -1, 0, -1, // MinX, MinY, MinZ + 11, 5, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b: 17: 1\n" /* tree */ + "c: 35: 0\n" /* wool */ + "d:171: 0\n" /* carpet */ + "e:126: 1\n" /* woodenslab */ + "f: 64: 5\n" /* wooddoorblock */ + "g: 85: 0\n" /* fence */ + "h: 50: 1\n" /* torch */ + "i: 50: 2\n" /* torch */ + "j: 64:12\n" /* wooddoorblock */ + "k:126:11\n" /* woodenslab */ + "l: 17: 5\n" /* tree */ + "m: 19: 0\n" /* sponge */ + "n:126: 3\n" /* woodenslab */ + "o:125: 3\n" /* woodendoubleslab */ + "p: 5: 3\n" /* wood */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmaaaaaaamm" + /* 2 */ "maaaaaaaaam" + /* 3 */ "maaaaaaaaam" + /* 4 */ "maaaaaaaaam" + /* 5 */ "maaaaaaaaam" + /* 6 */ "maaaaaaaaam" + /* 7 */ "maaaaaaaaam" + /* 8 */ "maaaaaaaaam" + /* 9 */ "mmaaaaaaamm" + /* 10 */ "mmmmmmmmmmm" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..bcbcbcb.." + /* 2 */ ".b.d.....b." + /* 3 */ ".cded....c." + /* 4 */ ".bded....b." + /* 5 */ ".c.d.....c." + /* 6 */ ".b.......b." + /* 7 */ ".c.......c." + /* 8 */ ".b.......b." + /* 9 */ "..bcbfbcb.." + /* 10 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..bgbgbgb.." + /* 2 */ ".b.......b." + /* 3 */ ".g.......g." + /* 4 */ ".bh.....ib." + /* 5 */ ".g.......g." + /* 6 */ ".b.......b." + /* 7 */ ".g.......g." + /* 8 */ ".b.......b." + /* 9 */ "..bgbjbgb.." + /* 10 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...kkkkk..." + /* 1 */ "..bcbcbcb.." + /* 2 */ ".b.......b." + /* 3 */ "kc.......ck" + /* 4 */ "kb.......bk" + /* 5 */ "kc.......ck" + /* 6 */ "kb.......bk" + /* 7 */ "kc.......ck" + /* 8 */ ".b.......b." + /* 9 */ "..bcblbcb.." + /* 10 */ "...kkkkk..." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ ".kn.....nk." + /* 1 */ "konnnnnnnok" + /* 2 */ "nnnnnnnnnnn" + /* 3 */ ".nnpppppnn." + /* 4 */ ".nnpkkkpnn." + /* 5 */ ".nnpkkkpnn." + /* 6 */ ".nnpkkkpnn." + /* 7 */ ".nnpppppnn." + /* 8 */ "nnnnnnnnnnn" + /* 9 */ "kknnnnnnnok" + /* 10 */ ".kn.....nk." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "n.........n" + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "..........." + /* 4 */ "....nnn...." + /* 5 */ "....non...." + /* 6 */ "....nnn...." + /* 7 */ "..........." + /* 8 */ "..........." + /* 9 */ "..........." + /* 10 */ "n.........n", + + // Connectors: + "-1: 5, 1, 10: 3\n" /* Type -1, direction Z+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseWide + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseWithGarden: + // The data has been exported from the gallery Plains, area index 67, ID 130, created by Aloe_vera + { + // Size: + 16, 9, 16, // SizeX = 16, SizeY = 9, SizeZ = 16 + + // Hitbox (relative to bounding box): + -1, 0, 0, // MinX, MinY, MinZ + 16, 8, 16, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 5: 2\n" /* wood */ + "c: 2: 0\n" /* grass */ + "d:113: 0\n" /* netherbrickfence */ + "e: 17: 1\n" /* tree */ + "f: 35: 0\n" /* wool */ + "g:126: 2\n" /* woodenslab */ + "h: 31: 2\n" /* tallgrass */ + "i:125: 2\n" /* woodendoubleslab */ + "j: 38: 3\n" /* rose */ + "k: 38: 2\n" /* rose */ + "l: 38: 1\n" /* rose */ + "m: 19: 0\n" /* sponge */ + "n: 17: 2\n" /* tree */ + "o: 50: 4\n" /* torch */ + "p: 85: 0\n" /* fence */ + "q:140: 0\n" /* flowerpotblock */ + "r: 50: 3\n" /* torch */ + "s: 44: 8\n" /* step */ + "t: 50: 1\n" /* torch */ + "u: 50: 2\n" /* torch */ + "v: 43: 0\n" /* doubleslab */ + "w: 44: 0\n" /* step */ + "x: 18:10\n" /* leaves */, + + // Block data: + // Level 0 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "mmmmmmmmmaammmmm" + /* 1 */ "aabbbbbbbbbbaaam" + /* 2 */ "aabbbbbbbbbbaaam" + /* 3 */ "aabbbbbbbbbbaaam" + /* 4 */ "aabbbbbbbbbbaaam" + /* 5 */ "aabbbbbbbbbbaaam" + /* 6 */ "aabbbbbbbbbbaaam" + /* 7 */ "aabbbbbbbbbbaaam" + /* 8 */ "aabbbbbbbbbbaaam" + /* 9 */ "aabbbbbbbbbbaaam" + /* 10 */ "aaaaaaaaaaaaaaam" + /* 11 */ "aaaaaaaaaaaaaaam" + /* 12 */ "aaaaaaaaaaaaaaam" + /* 13 */ "aaaaaaaaaaaaaaam" + /* 14 */ "aaaaaaaaaaaaaaam" + /* 15 */ "mmmmmmmmmmmmmmmm" + + // Level 1 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "mmmmmmmmmccmmmmm" + /* 1 */ "ccbbbbbbbbbbcccm" + /* 2 */ "ccbbbbbbbbbbcccm" + /* 3 */ "ccbbbbbbbbbbcccm" + /* 4 */ "ccbbbbbbbbbbcccm" + /* 5 */ "ccbbbbbbbbbbcccm" + /* 6 */ "ccbbbbbbbbbbcccm" + /* 7 */ "ccbbbbbbbbbbcccm" + /* 8 */ "ccbbbbbbbbbbcccm" + /* 9 */ "ccbbbbbbbbbbcccm" + /* 10 */ "cccccccccccccccm" + /* 11 */ "cccccccccccccccm" + /* 12 */ "cccccccccccccccm" + /* 13 */ "cccccccccccccacm" + /* 14 */ "cccccccccccccccm" + /* 15 */ "mmmmmmmmmmmmmmmm" + + // Level 2 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "ddeffeffe..eddd." + /* 2 */ "d.fbbgggg..f..d." + /* 3 */ "d.fbgggggggf.hd." + /* 4 */ "d.fbgggggggf..d." + /* 5 */ "d.eggggggggehhd." + /* 6 */ "d.fgiiggiigf.hd." + /* 7 */ "d.fgiiggiigf..d." + /* 8 */ "d.fggggggggf..d." + /* 9 */ "d.efffeefffe.hd." + /* 10 */ "d.............d." + /* 11 */ "djhhk.jhh..hh.d." + /* 12 */ "d.jlk.hj.h....d." + /* 13 */ "d..jh.hh..h..nd." + /* 14 */ "ddddddddddddddd." + /* 15 */ "................" + + // Level 3 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "........o..o...." + /* 1 */ "..eppeffe..e...." + /* 2 */ "..pqq......p...." + /* 3 */ "..pq.......p...." + /* 4 */ "..pq.......p...." + /* 5 */ "..e........e...." + /* 6 */ "..p........p...." + /* 7 */ "..p........p...." + /* 8 */ "..p........p...." + /* 9 */ "..epppeepppe...." + /* 10 */ "......rr........" + /* 11 */ "................" + /* 12 */ "................" + /* 13 */ ".............n.." + /* 14 */ "................" + /* 15 */ "................" + + // Level 4 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "..ssssssssss...." + /* 1 */ ".seffeffeffes..." + /* 2 */ ".sf..r.....fs..." + /* 3 */ ".sf........fs..." + /* 4 */ ".sf........fs..." + /* 5 */ ".set......ues..." + /* 6 */ ".sf........fs..." + /* 7 */ ".sf........fs..." + /* 8 */ ".sf........fs..." + /* 9 */ ".sefffeefffes..." + /* 10 */ "..ssssssssss...." + /* 11 */ "................" + /* 12 */ "................" + /* 13 */ ".............n.." + /* 14 */ "................" + /* 15 */ "................" + + // Level 5 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ ".vw........wv..." + /* 1 */ ".wwwwwwwwwwww..." + /* 2 */ "..wvvvvvvvvw...." + /* 3 */ "..wvvvvvvvvw...." + /* 4 */ "..wvvvvvvvvw...." + /* 5 */ "..wvvvvvvvvw...." + /* 6 */ "..wvvvvvvvvw...." + /* 7 */ "..wvvvvvvvvw...." + /* 8 */ "..wvvvvvvvvw...." + /* 9 */ ".wwwwwwwwwwww..." + /* 10 */ ".vw........wv..." + /* 11 */ "............xxx." + /* 12 */ "...........xxxxx" + /* 13 */ "...........xxnxx" + /* 14 */ "...........xxxxx" + /* 15 */ "............xxx." + + // Level 6 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "....wwwwww......" + /* 4 */ "....wvvvvw......" + /* 5 */ "....wvvvvw......" + /* 6 */ "....wvvvvw......" + /* 7 */ "....wwwwww......" + /* 8 */ "................" + /* 9 */ "................" + /* 10 */ "................" + /* 11 */ "............xxx." + /* 12 */ "...........xxxxx" + /* 13 */ "...........xxnxx" + /* 14 */ "...........xxxxx" + /* 15 */ "............xxx." + + // Level 7 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "................" + /* 4 */ "................" + /* 5 */ "......ww........" + /* 6 */ "................" + /* 7 */ "................" + /* 8 */ "................" + /* 9 */ "................" + /* 10 */ "................" + /* 11 */ "................" + /* 12 */ "............xxx." + /* 13 */ "............xnx." + /* 14 */ "............xx.." + /* 15 */ "................" + + // Level 8 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "................" + /* 4 */ "................" + /* 5 */ "................" + /* 6 */ "................" + /* 7 */ "................" + /* 8 */ "................" + /* 9 */ "................" + /* 10 */ "................" + /* 11 */ "................" + /* 12 */ ".............x.." + /* 13 */ "............xxx." + /* 14 */ ".............x.." + /* 15 */ "................", + + // Connectors: + "-1: 9, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseWithGarden + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseWithSakura1: + // The data has been exported from the gallery Plains, area index 75, ID 141, created by Aloe_vera + { + // Size: + 13, 7, 15, // SizeX = 13, SizeY = 7, SizeZ = 15 + + // Hitbox (relative to bounding box): + -1, 0, 0, // MinX, MinY, MinZ + 13, 6, 15, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 17: 5\n" /* tree */ + "d: 5: 2\n" /* wood */ + "e: 17: 9\n" /* tree */ + "f:113: 0\n" /* netherbrickfence */ + "g: 17: 1\n" /* tree */ + "h: 35: 0\n" /* wool */ + "i: 31: 2\n" /* tallgrass */ + "j: 54: 2\n" /* chest */ + "k: 38: 6\n" /* rose */ + "l: 38: 2\n" /* rose */ + "m: 19: 0\n" /* sponge */ + "n: 50: 4\n" /* torch */ + "o: 85: 0\n" /* fence */ + "p: 44: 8\n" /* step */ + "q: 35: 6\n" /* wool */ + "r: 43: 0\n" /* doubleslab */ + "s: 44: 0\n" /* step */, + + // Block data: + // Level 0 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "aaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaaaa" + /* 11 */ "aaaaaaaaaaaaa" + /* 12 */ "aaaaaaaaaaaaa" + /* 13 */ "aaaaaaaaaaaaa" + /* 14 */ "aaaaaaaaaaaaa" + + // Level 1 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "bbbbbbbbbbbbb" + /* 1 */ "bbbbbbbbbbbbb" + /* 2 */ "bbbaccdabbbbb" + /* 3 */ "bbbedddebbbbb" + /* 4 */ "bbbedddebbbbb" + /* 5 */ "bbbedddebbbbb" + /* 6 */ "bbbacccabbbbb" + /* 7 */ "bbbbbbbbbbbbb" + /* 8 */ "bbbbbbbbbbbbb" + /* 9 */ "bbbbbbbbbbbbb" + /* 10 */ "bbbbbbbbbbabb" + /* 11 */ "bbbbbbbbbbbbb" + /* 12 */ "bbbbbbbbbbbbb" + /* 13 */ "bbbbbbbbbbbbb" + /* 14 */ "bbbbbbbbbbbbb" + + // Level 2 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "ffff...ffffff" + /* 1 */ "f...........f" + /* 2 */ "f..ghh.g..i.f" + /* 3 */ "f..h...h..i.f" + /* 4 */ "f..h...h....f" + /* 5 */ "fi.h..jh..i.f" + /* 6 */ "f..ghhhg....f" + /* 7 */ "f.........i.f" + /* 8 */ "fii.........f" + /* 9 */ "f.k..k.i....f" + /* 10 */ "fl.i..i...g.f" + /* 11 */ "f.i..i.k....f" + /* 12 */ "f.l.k.......f" + /* 13 */ "f.....l.....f" + /* 14 */ "fffffffffffff" + + // Level 3 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ ".......n....." + /* 2 */ "...goo.g....." + /* 3 */ "...h...h....." + /* 4 */ "...o...o....." + /* 5 */ "...h...h....." + /* 6 */ "...gooog....." + /* 7 */ "............." + /* 8 */ "............." + /* 9 */ "............." + /* 10 */ "..........g.." + /* 11 */ "............." + /* 12 */ "............." + /* 13 */ "............." + /* 14 */ "............." + + // Level 4 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "...ppppp....." + /* 2 */ "..pghhhgp...." + /* 3 */ "..ph...hp...." + /* 4 */ "..ph...hp...." + /* 5 */ "..ph...hp...." + /* 6 */ "..pghhhgp...." + /* 7 */ "...ppppp....." + /* 8 */ "............." + /* 9 */ "..........q.." + /* 10 */ ".........qgq." + /* 11 */ "..........q.." + /* 12 */ "............." + /* 13 */ "............." + /* 14 */ "............." + + // Level 5 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "..rs...sr...." + /* 2 */ "..sssssss...." + /* 3 */ "...srrrs....." + /* 4 */ "...srrrs....." + /* 5 */ "...srrrs....." + /* 6 */ "..sssssss...." + /* 7 */ "..rs...sr...." + /* 8 */ "............." + /* 9 */ ".........qqq." + /* 10 */ ".........qqq." + /* 11 */ ".........qqq." + /* 12 */ "............." + /* 13 */ "............." + /* 14 */ "............." + + // Level 6 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ ".....s......." + /* 5 */ "............." + /* 6 */ "............." + /* 7 */ "............." + /* 8 */ "............." + /* 9 */ "............." + /* 10 */ "..........q.." + /* 11 */ "............." + /* 12 */ "............." + /* 13 */ "............." + /* 14 */ ".............", + + // Connectors: + "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HouseWithSakura1 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Restaurant: + // The data has been exported from the gallery Plains, area index 61, ID 117, created by Aloe_vera + { + // Size: + 15, 10, 15, // SizeX = 15, SizeY = 10, SizeZ = 15 + + // Hitbox (relative to bounding box): + -1, 0, -1, // MinX, MinY, MinZ + 14, 9, 15, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b:135: 0\n" /* 135 */ + "c:135: 2\n" /* 135 */ + "d:135: 1\n" /* 135 */ + "e: 17: 9\n" /* tree */ + "f:135: 3\n" /* 135 */ + "g: 85: 0\n" /* fence */ + "h: 17: 1\n" /* tree */ + "i:171: 0\n" /* carpet */ + "j:171:12\n" /* carpet */ + "k:126: 1\n" /* woodenslab */ + "l: 50: 5\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 35: 0\n" /* wool */ + "o: 50: 3\n" /* torch */ + "p: 50: 1\n" /* torch */ + "q: 50: 4\n" /* torch */ + "r: 35:14\n" /* wool */ + "s: 44: 8\n" /* step */ + "t: 43: 0\n" /* doubleslab */ + "u: 44: 0\n" /* step */ + "v: 17: 5\n" /* tree */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "mmmmaaaaaaammmm" + /* 1 */ "maaaaaaaaaaaaam" + /* 2 */ "maaaaaaaaaaaaam" + /* 3 */ "maaaaaaaaaaaaam" + /* 4 */ "aaaaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaaaaaa" + /* 11 */ "maaaaaaaaaaaaam" + /* 12 */ "maaaaaaaaaaaaam" + /* 13 */ "maaaaaaaaaaaaam" + /* 14 */ "mmmmaaaaaaammmm" + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "....bcccccd...." + /* 1 */ ".aaaaaaaaaaaaa." + /* 2 */ ".aaaaaaaaaaaaa." + /* 3 */ ".aaaaaaaaaaaaa." + /* 4 */ "caaaaaaaaaaaaac" + /* 5 */ "baaaaaaaaaaaaad" + /* 6 */ "baaaaaaaaaaaaad" + /* 7 */ "baaaaaaaaaaeaad" + /* 8 */ "baaaaaaaaaaaaad" + /* 9 */ "baaaaaaaaaaaaad" + /* 10 */ "faaaaaaaaaaaaaf" + /* 11 */ ".aaaaaaaaaaaaa." + /* 12 */ ".aaaaaaaaaaaaa." + /* 13 */ ".aaaaaaaaaaaaa." + /* 14 */ "....bfffffd...." + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".gggg.....gggg." + /* 2 */ ".g...........g." + /* 3 */ ".g.hhhhhhhhh.g." + /* 4 */ ".g.hiiijiiih.g." + /* 5 */ "...hikijikih..." + /* 6 */ "...hiiijiiihg.." + /* 7 */ "...hjjjjjjj...." + /* 8 */ "...hiiijiiihg.." + /* 9 */ "...hikijikih..." + /* 10 */ ".g.hiiijiiih.g." + /* 11 */ ".g.hhhhhhhhh.g." + /* 12 */ ".g...........g." + /* 13 */ ".gggg.....gggg." + /* 14 */ "..............." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".l..g.....g..l." + /* 2 */ "..............." + /* 3 */ "...hnnnhnnnh..." + /* 4 */ ".g.n.......n.g." + /* 5 */ "...n.......n..." + /* 6 */ "...n.......hl.." + /* 7 */ "...h..........." + /* 8 */ "...n.......hl.." + /* 9 */ "...n.......n..." + /* 10 */ ".g.n.......n.g." + /* 11 */ "...hnnnhnnnh..." + /* 12 */ "..............." + /* 13 */ ".l..g.....g..l." + /* 14 */ "..............." + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "....g.....g...." + /* 2 */ "..............." + /* 3 */ "...hn.nhn.nh..." + /* 4 */ ".g.n...o...n.g." + /* 5 */ "...n.......n..." + /* 6 */ "...n.......h..." + /* 7 */ "...hp......e..." + /* 8 */ "...n.......h..." + /* 9 */ "...n.......n..." + /* 10 */ ".g.n...q...n.g." + /* 11 */ "...hn.nhn.nh..." + /* 12 */ "..............." + /* 13 */ "....g.....g...." + /* 14 */ "..............." + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "....g.....g...." + /* 2 */ "....ggggggg...." + /* 3 */ "...hnnnhnnnh..." + /* 4 */ ".ggn.......ngg." + /* 5 */ "..gn.......ng.." + /* 6 */ "..gn.......hg.." + /* 7 */ "..gh..r.r..ng.." + /* 8 */ "..gn.......hg.." + /* 9 */ "..gn.......ng.." + /* 10 */ ".ggn.......ngg." + /* 11 */ "...hnnnhnnnh..." + /* 12 */ "....ggggggg...." + /* 13 */ "....g.....g...." + /* 14 */ "..............." + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "...stuuuuuts..." + /* 2 */ "..sttttttttts.." + /* 3 */ ".sthvvvhvvvhts." + /* 4 */ ".tte.......ett." + /* 5 */ ".ute.......etu." + /* 6 */ ".ute.......htu." + /* 7 */ ".uth..g.g..etu." + /* 8 */ ".ute.......htu." + /* 9 */ ".ute.......etu." + /* 10 */ ".tte.......ett." + /* 11 */ ".sthvvvhvvvhts." + /* 12 */ "..sttttttttts.." + /* 13 */ "...stuuuuuts..." + /* 14 */ "..............." + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".stu.......uts." + /* 2 */ ".tu.........ut." + /* 3 */ ".u.uuuuuuuuu.u." + /* 4 */ "...utttttttu..." + /* 5 */ "...utttttttu..." + /* 6 */ "...utttttttu..." + /* 7 */ "...utttttttu..." + /* 8 */ "...utttttttu..." + /* 9 */ "...utttttttu..." + /* 10 */ "...utttttttu..." + /* 11 */ ".u.uuuuuuuuu.u." + /* 12 */ ".tu.........ut." + /* 13 */ ".stu.......uts." + /* 14 */ "..............." + + // Level 8 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".u...........u." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ ".....uuuuu....." + /* 6 */ ".....utttu....." + /* 7 */ ".....utttu....." + /* 8 */ ".....utttu....." + /* 9 */ ".....uuuuu....." + /* 10 */ "..............." + /* 11 */ "..............." + /* 12 */ "..............." + /* 13 */ ".u...........u." + /* 14 */ "..............." + + // Level 9 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ ".......u......." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "..............." + /* 11 */ "..............." + /* 12 */ "..............." + /* 13 */ "..............." + /* 14 */ "...............", + + // Connectors: + "-1: 14, 1, 7: 5\n" /* Type -1, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Restaurant + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // SakuraDouble: + // The data has been exported from the gallery Plains, area index 76, ID 142, created by Aloe_vera + { + // Size: + 12, 8, 6, // SizeX = 12, SizeY = 8, SizeZ = 6 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 11, 7, 5, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 17: 1\n" /* tree */ + "d: 35: 6\n" /* wool */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "aaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaa" + + // Level 1 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "bbbbbbbbbbbb" + /* 1 */ "bbbbbbbbbbbb" + /* 2 */ "bbabbbbbbbbb" + /* 3 */ "bbbbbbbbbabb" + /* 4 */ "bbbbbbbbbbbb" + /* 5 */ "bbbbbbbbbbbb" + + // Level 2 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "..c........." + /* 3 */ ".........c.." + /* 4 */ "............" + /* 5 */ "............" + + // Level 3 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "..c........." + /* 3 */ ".........c.." + /* 4 */ "............" + /* 5 */ "............" + + // Level 4 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "..d........." + /* 1 */ "ddddd......." + /* 2 */ "ddcdd...ddd." + /* 3 */ "ddddd...dcd." + /* 4 */ "..d.....ddd." + /* 5 */ "............" + + // Level 5 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ ".ddd........" + /* 1 */ ".ddd....ddd." + /* 2 */ "ddddd..ddddd" + /* 3 */ ".ddd...ddcdd" + /* 4 */ ".ddd...ddddd" + /* 5 */ "........ddd." + + // Level 6 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "..d......d.." + /* 2 */ ".ddd....ddd." + /* 3 */ "..d....ddddd" + /* 4 */ "........ddd." + /* 5 */ ".........d.." + + // Level 7 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ ".........d.." + /* 4 */ "............" + /* 5 */ "............", + + // Connectors: + "-1: 0, 2, 2: 4\n" /* Type -1, direction X- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // SakuraDouble + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // SakuraSmall: + // The data has been exported from the gallery Plains, area index 145, ID 489, created by Aloe_vera + { + // Size: + 5, 7, 5, // SizeX = 5, SizeY = 7, SizeZ = 5 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 6, 4, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 17: 1\n" /* tree */ + "d: 35: 6\n" /* wool */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aaaaa" + /* 2 */ "aaaaa" + /* 3 */ "aaaaa" + /* 4 */ "aaaaa" + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bbbbb" + /* 2 */ "bbabb" + /* 3 */ "bbbbb" + /* 4 */ "bbbbb" + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "..c.." + /* 3 */ "....." + /* 4 */ "....." + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "..c.." + /* 3 */ "....." + /* 4 */ "....." + + // Level 4 + /* z\x* 01234 */ + /* 0 */ "..d.." + /* 1 */ "ddddd" + /* 2 */ "ddcdd" + /* 3 */ "ddddd" + /* 4 */ "..d.." + + // Level 5 + /* z\x* 01234 */ + /* 0 */ ".ddd." + /* 1 */ ".ddd." + /* 2 */ "ddddd" + /* 3 */ ".ddd." + /* 4 */ ".ddd." + + // Level 6 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "..d.." + /* 2 */ ".ddd." + /* 3 */ "..d.." + /* 4 */ ".....", + + // Connectors: + "-1: 2, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // SakuraSmall +}; // g_JapaneseVillagePrefabs + + + + + + +const cPrefab::sDef g_JapaneseVillageStartingPrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HighTemple: + // The data has been exported from the gallery Plains, area index 70, ID 133, created by Aloe_vera + { + // Size: + 11, 19, 11, // SizeX = 11, SizeY = 19, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 18, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b:135: 0\n" /* 135 */ + "c:135: 2\n" /* 135 */ + "d:135: 1\n" /* 135 */ + "e: 17: 9\n" /* tree */ + "f:135: 3\n" /* 135 */ + "g: 85: 0\n" /* fence */ + "h: 17: 1\n" /* tree */ + "i:171: 0\n" /* carpet */ + "j: 50: 5\n" /* torch */ + "k: 35: 0\n" /* wool */ + "l: 17: 5\n" /* tree */ + "m: 19: 0\n" /* sponge */ + "n:124: 0\n" /* redstonelampon */ + "o: 69: 9\n" /* lever */ + "p: 44: 8\n" /* step */ + "q: 43: 0\n" /* doubleslab */ + "r: 44: 0\n" /* step */ + "s: 50: 4\n" /* torch */ + "t: 50: 1\n" /* torch */ + "u: 50: 3\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmaaaaammm" + /* 1 */ "maaaaaaaaam" + /* 2 */ "maaaaaaaaam" + /* 3 */ "aaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaa" + /* 8 */ "maaaaaaaaam" + /* 9 */ "maaaaaaaaam" + /* 10 */ "mmmaaaaammm" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...bcccd..." + /* 1 */ ".aaaaaaaaa." + /* 2 */ ".aaaaaaaaa." + /* 3 */ "caaaaaaaaac" + /* 4 */ "baaaaaaaaad" + /* 5 */ "baaeaaaaaad" + /* 6 */ "baaaaaaaaad" + /* 7 */ "faaaaaaaaaf" + /* 8 */ ".aaaaaaaaa." + /* 9 */ ".aaaaaaaaa." + /* 10 */ "...bfffd..." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ggg...ggg." + /* 2 */ ".g.......g." + /* 3 */ ".g.hhhhh.g." + /* 4 */ "...hiiih..." + /* 5 */ "....iiih..." + /* 6 */ "...hiiih..." + /* 7 */ ".g.hhhhh.g." + /* 8 */ ".g.......g." + /* 9 */ ".ggg...ggg." + /* 10 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".j.g...g.j." + /* 2 */ "..........." + /* 3 */ ".g.kkhkk.g." + /* 4 */ "...h...k..." + /* 5 */ ".......h..." + /* 6 */ "...h...k..." + /* 7 */ ".g.kkhkk.g." + /* 8 */ "..........." + /* 9 */ ".j.g...g.j." + /* 10 */ "..........." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "...g...g..." + /* 2 */ "..........." + /* 3 */ ".g.kkhkk.g." + /* 4 */ "...h...k..." + /* 5 */ "...k...h..." + /* 6 */ "...h...k..." + /* 7 */ ".g.kkhkk.g." + /* 8 */ "..........." + /* 9 */ "...g...g..." + /* 10 */ "..........." + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "...g...g..." + /* 2 */ "...ggggg..." + /* 3 */ ".gghlhlhgg." + /* 4 */ "..ge...eg.." + /* 5 */ "..ge.nohg.." + /* 6 */ "..ge...eg.." + /* 7 */ ".gghlhlhgg." + /* 8 */ "...ggggg..." + /* 9 */ "...g...g..." + /* 10 */ "..........." + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..pqrrrqp.." + /* 2 */ ".pqqqqqqqp." + /* 3 */ ".qqhkkkhqq." + /* 4 */ ".rqkhhhkqr." + /* 5 */ ".rqkhhhkqr." + /* 6 */ ".rqkhhhkqr." + /* 7 */ ".qqhkkkhqq." + /* 8 */ ".pqqqqqqqp." + /* 9 */ "..pqrrrqp.." + /* 10 */ "..........." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".qr.....rq." + /* 2 */ ".........r." + /* 3 */ "...hhhhh..." + /* 4 */ "...hiiih..." + /* 5 */ "....iiih..." + /* 6 */ "...hiiih..." + /* 7 */ "...hhhhh..." + /* 8 */ ".r.......r." + /* 9 */ ".qr.....rq." + /* 10 */ "..........." + + // Level 8 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "...kkhkk..." + /* 4 */ "...h...k..." + /* 5 */ ".......h..." + /* 6 */ "...h...k..." + /* 7 */ "...kkhkk..." + /* 8 */ "..........." + /* 9 */ "..........." + /* 10 */ "..........." + + // Level 9 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ ".....s....." + /* 3 */ "...kkhkk..." + /* 4 */ "...h...k..." + /* 5 */ "...k...ht.." + /* 6 */ "...h...k..." + /* 7 */ "...kkhkk..." + /* 8 */ ".....u....." + /* 9 */ "..........." + /* 10 */ "..........." + + // Level 10 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "...ggggg..." + /* 3 */ "..ghlhlhg.." + /* 4 */ "..ge...eg.." + /* 5 */ "..ge.nohg.." + /* 6 */ "..ge...eg.." + /* 7 */ "..ghlhlhg.." + /* 8 */ "...ggggg..." + /* 9 */ "..........." + /* 10 */ "..........." + + // Level 11 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..prrrrrp.." + /* 2 */ ".pqqqqqqqp." + /* 3 */ ".qqhkkkhqq." + /* 4 */ ".rqkhhhkqr." + /* 5 */ ".rqkhhhkqr." + /* 6 */ ".rqkhhhkqr." + /* 7 */ ".qqhkkkhqr." + /* 8 */ ".pqqqqqqqp." + /* 9 */ "..pqrrrqp.." + /* 10 */ "..........." + + // Level 12 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".qr.....rq." + /* 2 */ ".r.......r." + /* 3 */ "...hhhhh..." + /* 4 */ "...hiiih..." + /* 5 */ "....iiih..." + /* 6 */ "...hiiih..." + /* 7 */ "...hhhhh..." + /* 8 */ ".r.......r." + /* 9 */ ".qr.....rq." + /* 10 */ "..........." + + // Level 13 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "...kkhkk..." + /* 4 */ "...h...k..." + /* 5 */ ".......h..." + /* 6 */ "...h...k..." + /* 7 */ "...kkhkk..." + /* 8 */ "..........." + /* 9 */ "..........." + /* 10 */ "..........." + + // Level 14 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ ".....s....." + /* 3 */ "...kkhkk..." + /* 4 */ "...h...k..." + /* 5 */ "...k...ht.." + /* 6 */ "...h...k..." + /* 7 */ "...kkhkk..." + /* 8 */ ".....u....." + /* 9 */ "..........." + /* 10 */ "..........." + + // Level 15 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "...ggggg..." + /* 3 */ "..ghlhlhg.." + /* 4 */ "..ge...eg.." + /* 5 */ "..ge.nohg.." + /* 6 */ "..ge...eg.." + /* 7 */ "..ghlhlhg.." + /* 8 */ "...ggggg..." + /* 9 */ "..........." + /* 10 */ "..........." + + // Level 16 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..pqrrrqp.." + /* 2 */ ".pqqqqqqqp." + /* 3 */ ".qqrrrrrqq." + /* 4 */ ".rqrrrrrqr." + /* 5 */ ".rqrrrrrqr." + /* 6 */ ".rqrrrrrqr." + /* 7 */ ".qqrrrrrqq." + /* 8 */ ".pqqqqqqqp." + /* 9 */ "..pqrrrqp.." + /* 10 */ "..........." + + // Level 17 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".qr.....rq." + /* 2 */ ".rr.....rr." + /* 3 */ "...rrrrr..." + /* 4 */ "...rqqqr..." + /* 5 */ "...rqqqr..." + /* 6 */ "...rqqqr..." + /* 7 */ "...rrrrr..." + /* 8 */ ".rr.....rr." + /* 9 */ ".qr.....rq." + /* 10 */ "..........." + + // Level 18 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "..........." + /* 4 */ "..........." + /* 5 */ ".....r....." + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "..........." + /* 9 */ "..........." + /* 10 */ "...........", + + // Connectors: + "2: 0, 1, 5: 4\n" /* Type 2, direction X- */ + "2: 5, 1, 0: 2\n" /* Type 2, direction Z- */ + "2: 10, 1, 5: 5\n" /* Type 2, direction X+ */ + "2: 5, 1, 10: 3\n" /* Type 2, direction Z+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // HighTemple + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Well: + // The data has been exported from the gallery Plains, area index 143, ID 487, created by STR_Warrior + { + // Size: + 7, 14, 7, // SizeX = 7, SizeY = 14, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 13, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 1: 0\n" /* stone */ + "b: 4: 0\n" /* cobblestone */ + "c: 8: 0\n" /* water */ + "d: 3: 0\n" /* dirt */ + "e: 2: 0\n" /* grass */ + "f: 13: 0\n" /* gravel */ + "g: 67: 1\n" /* stairs */ + "h: 67: 2\n" /* stairs */ + "i: 67: 0\n" /* stairs */ + "j: 67: 3\n" /* stairs */ + "k: 85: 0\n" /* fence */ + "l: 44: 8\n" /* step */ + "m: 19: 0\n" /* sponge */ + "n: 44: 0\n" /* step */ + "o: 43: 0\n" /* doubleslab */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaaaaa" + /* 3 */ "aaaaaaa" + /* 4 */ "aaaaaaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcc.ba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "eefffee" + /* 1 */ "ebbbbbe" + /* 2 */ "fbcccbf" + /* 3 */ "fbcccbf" + /* 4 */ "fbcccbf" + /* 5 */ "ebbbbbe" + /* 6 */ "eefffee" + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".bghib." + /* 2 */ ".j...j." + /* 3 */ ".i...g." + /* 4 */ ".h...h." + /* 5 */ ".bgjib." + /* 6 */ "......." + + // Level 10 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".k...k." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ ".k...k." + /* 6 */ "......." + + // Level 11 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".k...k." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ ".k...k." + /* 6 */ "......." + + // Level 12 + /* z\x* 0123456 */ + /* 0 */ ".lnnnl." + /* 1 */ "loooool" + /* 2 */ "nooooon" + /* 3 */ "nooooon" + /* 4 */ "nooooon" + /* 5 */ "loooool" + /* 6 */ ".lnnnl." + + // Level 13 + /* z\x* 0123456 */ + /* 0 */ "n.....n" + /* 1 */ "......." + /* 2 */ "..nnn.." + /* 3 */ "..non.." + /* 4 */ "..nnn.." + /* 5 */ "......." + /* 6 */ "n.....n", + + // Connectors: + "2: 0, 9, 3: 4\n" /* Type 2, direction X- */ + "2: 3, 9, 0: 2\n" /* Type 2, direction Z- */ + "2: 6, 9, 3: 5\n" /* Type 2, direction X+ */ + "2: 3, 9, 6: 3\n" /* Type 2, direction Z+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + }, // Well +}; + + + + + +// The prefab counts: + +const size_t g_JapaneseVillagePrefabsCount = ARRAYCOUNT(g_JapaneseVillagePrefabs); + +const size_t g_JapaneseVillageStartingPrefabsCount = ARRAYCOUNT(g_JapaneseVillageStartingPrefabs); + diff --git a/src/Generating/Prefabs/JapaneseVillagePrefabs.h b/src/Generating/Prefabs/JapaneseVillagePrefabs.h new file mode 100644 index 000000000..501b6c1cd --- /dev/null +++ b/src/Generating/Prefabs/JapaneseVillagePrefabs.h @@ -0,0 +1,15 @@ + +// JapaneseVillagePrefabs.h + +// Declares the prefabs in the group JapaneseVillage + +#include "../Prefab.h" + + + + + +extern const cPrefab::sDef g_JapaneseVillagePrefabs[]; +extern const cPrefab::sDef g_JapaneseVillageStartingPrefabs[]; +extern const size_t g_JapaneseVillagePrefabsCount; +extern const size_t g_JapaneseVillageStartingPrefabsCount; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index bcce62af5..62822c33b 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -5,6 +5,7 @@ #include "Globals.h" #include "VillageGen.h" +#include "Prefabs/JapaneseVillagePrefabs.h" #include "Prefabs/PlainsVillagePrefabs.h" #include "Prefabs/SandVillagePrefabs.h" #include "Prefabs/SandFlatRoofVillagePrefabs.h" @@ -59,6 +60,7 @@ public: cPrefab * RoadPiece = new cPrefab(BA, 1); RoadPiece->AddConnector(0, 0, 1, BLOCK_FACE_XM, -2); RoadPiece->AddConnector(len - 1, 0, 1, BLOCK_FACE_XP, -2); + RoadPiece->SetDefaultWeight(100); // Add the road connectors: for (int x = 1; x < len; x += 12) @@ -84,8 +86,8 @@ public: // cPrefabPiecePool overrides: virtual int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, const cPiece & a_NewPiece) override { - // Roads cannot branch T-wise (appending -2 connector to a +2 connector): - if ((a_ExistingConnector.m_Type == 2) && (a_PlacedPiece.GetDepth() > 0)) + // Roads cannot branch T-wise (appending -2 connector to a +2 connector on a 1-high piece): + if ((a_ExistingConnector.m_Type == 2) && (a_PlacedPiece.GetDepth() > 0) && (a_PlacedPiece.GetPiece().GetSize().y == 1)) { return 0; } @@ -283,6 +285,9 @@ static cVillagePiecePool g_SandFlatRoofVillage(g_SandFlatRoofVillagePrefabs, g_S /** The prefabs for the plains village. */ static cVillagePiecePool g_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVillagePrefabsCount, g_PlainsVillageStartingPrefabs, g_PlainsVillageStartingPrefabsCount); +/** The prefabs for the Japanese village. */ +static cVillagePiecePool g_JapaneseVillage(g_JapaneseVillagePrefabs, g_JapaneseVillagePrefabsCount, g_JapaneseVillageStartingPrefabs, g_JapaneseVillageStartingPrefabsCount); + @@ -316,6 +321,8 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ cVillagePiecePool * VillagePrefabs = NULL; BLOCKTYPE RoadBlock = E_BLOCK_GRAVEL; int rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 11; + cVillagePiecePool * PlainsVillage = (rnd % 2 == 0) ? &g_PlainsVillage : &g_JapaneseVillage; + cVillagePiecePool * DesertVillage = (rnd % 2 == 0) ? &g_SandVillage : &g_SandFlatRoofVillage; for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) { switch (Biomes[i]) @@ -324,7 +331,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ case biDesertM: { // These biomes allow sand villages - VillagePrefabs = (rnd % 2 == 0) ? &g_SandVillage : &g_SandFlatRoofVillage; + VillagePrefabs = DesertVillage; // RoadBlock = E_BLOCK_SANDSTONE; break; } @@ -334,7 +341,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ case biSunflowerPlains: { // These biomes allow plains-style villages - VillagePrefabs = &g_PlainsVillage; + VillagePrefabs = PlainsVillage; break; } default: From 944d29c0ae3929471a11ea11aa98441bc31f4d7d Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 24 May 2014 14:09:51 +0100 Subject: [PATCH 144/214] inject TestGlobals.h correctly --- src/ChunkData.cpp | 10 +++++++--- tests/ChunkData/CMakeLists.txt | 1 + tests/TestGlobals.h | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 162803292..79029f0cf 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -1,5 +1,9 @@ +#ifdef TEST_GLOBALS +#include "TestGlobals.h" +#else #include "Globals.h" +#endif #include "ChunkData.h" cChunkData::cChunkData() @@ -39,7 +43,7 @@ cChunkData::~cChunkData() other.IsOwner = false; } - cChunkData::cChunkData& operator=(const cChunkData& other) + cChunkData& cChunkData::operator=(const cChunkData& other) { if (&other != this) { @@ -71,7 +75,7 @@ cChunkData::~cChunkData() } } - cChunkData::cChunkData& operator=(cChunkData&& other) + cChunkData& cChunkData::operator=(cChunkData&& other) { if (&other != this) { @@ -230,7 +234,7 @@ NIBBLETYPE cChunkData::GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const return 0; } -cChunkData cChunkData::cChunkData::Copy() const +cChunkData cChunkData::Copy() const { cChunkData copy; for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) diff --git a/tests/ChunkData/CMakeLists.txt b/tests/ChunkData/CMakeLists.txt index 3f6653bb5..a2bd9fd22 100644 --- a/tests/ChunkData/CMakeLists.txt +++ b/tests/ChunkData/CMakeLists.txt @@ -4,6 +4,7 @@ enable_testing() include_directories(${CMAKE_SOURCE_DIR}/src/) +add_definitions(-DTEST_GLOBALS=1) add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkData.cpp) diff --git a/tests/TestGlobals.h b/tests/TestGlobals.h index bb25bd20a..ea43de733 100644 --- a/tests/TestGlobals.h +++ b/tests/TestGlobals.h @@ -126,9 +126,9 @@ class cAssertFailure #define UNUSED(X) (void)(X) // Logging functions -void LOGERROR(const char* a_Format, ...) FORMATSTRING(1,2); +void inline LOGERROR(const char* a_Format, ...) FORMATSTRING(1,2); -void LOGERROR(const char* a_Format, ...) +void inline LOGERROR(const char* a_Format, ...) { va_list argList; va_start(argList, a_Format); From f3a8560f89492be4f221dcea9afcb9942ff92935 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 21:48:12 +0100 Subject: [PATCH 145/214] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a16062574..07517751c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MCServer +MCServer [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) ======== **Current Protocol Supported:** Minecraft v1.2 -> v1.7 @@ -34,5 +34,7 @@ For other stuff, including plugins and discussion, check the [forums](http://for Earn bitcoins for commits or donate to reward the MCServer developers: [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) +[![Support via Gittip](https://rawgithub.com/twolfson/gittip-badge/0.2.0/dist/gittip.png)](https://www.gittip.com/USERNAME/) + Travis CI: [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) From bc4d7b3d35a66466fc82174dacbdb3d19eab217a Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 21:48:38 +0100 Subject: [PATCH 146/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 07517751c..9b39f7d1d 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ For other stuff, including plugins and discussion, check the [forums](http://for Earn bitcoins for commits or donate to reward the MCServer developers: [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) -[![Support via Gittip](https://rawgithub.com/twolfson/gittip-badge/0.2.0/dist/gittip.png)](https://www.gittip.com/USERNAME/) +[![Support via Gittip](https://rawgithub.com/twolfson/gittip-badge/0.2.0/dist/gittip.png)](https://www.gittip.com/on/github/mc-server/) Travis CI: [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) From 86086aa3573f606924aae77fcc2c07249a7ad899 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 21:49:45 +0100 Subject: [PATCH 147/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b39f7d1d..8a3de6465 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ For other stuff, including plugins and discussion, check the [forums](http://for Earn bitcoins for commits or donate to reward the MCServer developers: [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) -[![Support via Gittip](https://rawgithub.com/twolfson/gittip-badge/0.2.0/dist/gittip.png)](https://www.gittip.com/on/github/mc-server/) +[![Support via Gittip](http://img.shields.io/gittip/mc-server.svg)](https://www.gittip.com/on/github/mc-server/) Travis CI: [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) From 078b5f6506a1265d9c970882622692037d8698d0 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 21:55:02 +0100 Subject: [PATCH 148/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a3de6465..61ffdaa5f 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ For other stuff, including plugins and discussion, check the [forums](http://for Earn bitcoins for commits or donate to reward the MCServer developers: [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) -[![Support via Gittip](http://img.shields.io/gittip/mc-server.svg)](https://www.gittip.com/on/github/mc-server/) +[![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) Travis CI: [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) From bd68b71dd7c4357e448abefe20d7dc08ad8dc370 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 21:55:55 +0100 Subject: [PATCH 149/214] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 61ffdaa5f..0b1038be0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MCServer [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) +MCServer [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) ======== **Current Protocol Supported:** Minecraft v1.2 -> v1.7 @@ -34,7 +34,7 @@ For other stuff, including plugins and discussion, check the [forums](http://for Earn bitcoins for commits or donate to reward the MCServer developers: [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) -[![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) +Support Via Gittip: [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) Travis CI: [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) From 0d7dd5fe7679669046129892de5d9e9abec2320a Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 21:56:56 +0100 Subject: [PATCH 150/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b1038be0..752c55325 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MCServer [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) +MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) ======== **Current Protocol Supported:** Minecraft v1.2 -> v1.7 From deb69f150d3cdd0abc97905868370dad48cce468 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 22:00:16 +0100 Subject: [PATCH 151/214] Standardised a badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 752c55325..b867c399c 100644 --- a/README.md +++ b/README.md @@ -36,5 +36,5 @@ Earn bitcoins for commits or donate to reward the MCServer developers: [![tip fo Support Via Gittip: [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) -Travis CI: [![Build Status](https://travis-ci.org/mc-server/MCServer.png?branch=master)](https://travis-ci.org/mc-server/MCServer) +Travis CI: [![Build Status]((http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) From ecb358a36e193316b7a00857ae0b7e9ae2707665 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 22:02:19 +0100 Subject: [PATCH 152/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b867c399c..5748e4083 100644 --- a/README.md +++ b/README.md @@ -36,5 +36,5 @@ Earn bitcoins for commits or donate to reward the MCServer developers: [![tip fo Support Via Gittip: [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) -Travis CI: [![Build Status]((http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) +Travis CI: [![Build Status]((http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer)) From cc2b84ed9e5ab106bc016df57c0dfca863318ec4 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 22:03:31 +0100 Subject: [PATCH 153/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5748e4083..5f82c2b11 100644 --- a/README.md +++ b/README.md @@ -36,5 +36,5 @@ Earn bitcoins for commits or donate to reward the MCServer developers: [![tip fo Support Via Gittip: [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) -Travis CI: [![Build Status]((http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer)) +Travis CI: [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) From 2eca98a41a03c1f0478f93028f0c7c232689b6f4 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sat, 24 May 2014 22:04:15 +0100 Subject: [PATCH 154/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f82c2b11..e7c0730bc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) +MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) ======== **Current Protocol Supported:** Minecraft v1.2 -> v1.7 From 27a9fa31108aef4313a45f4c716f2f1551537236 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 24 May 2014 23:28:48 +0100 Subject: [PATCH 155/214] Updated Core --- MCServer/Plugins/Core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core index 5c8557d4f..3790f78d3 160000 --- a/MCServer/Plugins/Core +++ b/MCServer/Plugins/Core @@ -1 +1 @@ -Subproject commit 5c8557d4fdfa580c100510cde07a1a778ea2e244 +Subproject commit 3790f78d3f7503ff33a423b8e73e81a275562783 From 43eaa573fd09a0cbf2f8f6333bb3217717f8438b Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 25 May 2014 10:03:53 +0100 Subject: [PATCH 156/214] Updated the installation instructions in the README. --- README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e7c0730bc..22871efe4 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,23 @@ MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) ======== -**Current Protocol Supported:** Minecraft v1.2 -> v1.7 - MCServer is a performant C++ Minecraft server designed for use in memory and cpu-limited places, or just to make regular server perform better. MCServer can run on PCs, Macs, and *nix. This includes android phones and tablets as well as Raspberry Pis. +**MCServer Currently Supports:** Minecraft v1.2 -> v1.7 + Installation ------------ -To install MCServer, you can either download the repository and compile it, or download a pre-compiled version. +Normally, you will want to download a pre-compiled version of MCServer from one of the buildservers: -If you've cloned the repository using Git, you need to pull down the submodules (core plugins, some dependencies). This can be achieved with `git submodule init` and then on a regular basis (to keep up to date) `git submodule update`. + * [Linux and Raspberry Pi](http://ci.bearbin.net) (Bearbin's CI Server) + * [Windows](http://mc-server.xoft.cz) (xoft's nightly build service) -If you downloaded a ZIP file of the sources instead, you will need to download PolarSSL, too, from https://github.com/polarssl/polarssl , and unpack it into the `lib/polarssl` folder. You will also need to manually download all the plugins that you want included. +You simply need to download and extract these files before you can use the server. -Compilation instructions are available in the COMPILING file. - -Linux builds can be downloaded from [Bearbin's CI Service](http://ci.bearbin.net) and Windows builds from xoft's [nightly build service](http://mc-server.xoft.cz). - -After you've extracted the files, simply run the MCServer executable. +If you're a more advanced user, you may want to compile the server yourself for more performance. See the [COMPILING.md](https://github.com/mc-server/MCServer/blob/master/COMPILING.md) file for more details. Contributing ------------ @@ -30,7 +27,7 @@ MCServer is licensed under the Apache license V2, and we welcome anybody to fork Other Stuff ----------- -For other stuff, including plugins and discussion, check the [forums](http://forum.mc-server.org) and [wiki](http://wiki.mc-server.org/). +For other stuff, including plugins and discussion, check the [forums](http://forum.mc-server.org) and [Plugin API](http://mc-server.xoft.cz/LuaAPI/). Earn bitcoins for commits or donate to reward the MCServer developers: [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) From bcdced34ab6be6767c121ac4cfef0fce7f9bc5bf Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 25 May 2014 10:06:41 +0100 Subject: [PATCH 157/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22871efe4..c9a8f5eff 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ MCServer is a performant C++ Minecraft server designed for use in memory and cpu MCServer can run on PCs, Macs, and *nix. This includes android phones and tablets as well as Raspberry Pis. -**MCServer Currently Supports:** Minecraft v1.2 -> v1.7 +We currently support the protocol from Minecraft 1.2 all the way up to Minecraft 1.7.9. Installation ------------ From 34d69bd5899d0e54574bddf16215fa23bcaa9832 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 25 May 2014 10:08:26 +0100 Subject: [PATCH 158/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c9a8f5eff..a4a8b3273 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) ======== -MCServer is a performant C++ Minecraft server designed for use in memory and cpu-limited places, or just to make regular server perform better. +MCServer is a Minecraft server that is written in C++ and designed to be efficient with memory and CPU, as well as having a flexible Lua Plugin API. MCServer can run on PCs, Macs, and *nix. This includes android phones and tablets as well as Raspberry Pis. From 882e8e044c56878cd144b93ea67182204581489c Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 25 May 2014 10:21:58 +0100 Subject: [PATCH 159/214] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a4a8b3273..22befc822 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Contributing MCServer is licensed under the Apache license V2, and we welcome anybody to fork and submit a Pull Request back with their changes, and if you want to join as a permanent member we can add you to the team. +Check out the [CONTRIBUTING.md](https://github.com/mc-server/MCServer/blob/master/CONTRIBUTING.md) file for more infos. + Other Stuff ----------- From 50e29aba776dd6ad6296e5989faaf4642b4b6705 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 25 May 2014 18:32:42 +0100 Subject: [PATCH 160/214] A fix that is better than #950. --- src/GroupManager.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index 3586560bf..ba25d95ba 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -45,8 +45,14 @@ cGroupManager::cGroupManager() { LOGD("-- Loading Groups --"); - LoadGroups(); - CheckUsers(); + if (!LoadGroups()) + { + LOGWARNING("ERROR: Groups could not load!"); + } + if (!CheckUsers()) + { + LOGWARNING("ERROR: User file could not be found!"); + } LOGD("-- Groups Successfully Loaded --"); } @@ -70,13 +76,13 @@ void cGroupManager::GenerateDefaultUsersIni(cIniFile & a_IniFile) -void cGroupManager::CheckUsers(void) +bool cGroupManager::CheckUsers() { cIniFile IniFile; if (!IniFile.ReadFile("users.ini")) { GenerateDefaultUsersIni(IniFile); - return; + return true; } int NumKeys = IniFile.GetNumKeys(); @@ -97,13 +103,15 @@ void cGroupManager::CheckUsers(void) } } // for itr - Split[] } // for i - ini file keys + // Always return true for now, just but we can handle writefile fails later. + return true } -void cGroupManager::LoadGroups() +bool cGroupManager::LoadGroups() { cIniFile IniFile; if (!IniFile.ReadFile("groups.ini")) @@ -180,6 +188,8 @@ void cGroupManager::LoadGroups() } } } + // Always return true, we can handle writefile fails later. + return true } From 6ce73ada6fc1cde9cd3ee25afdca11484e77cbb0 Mon Sep 17 00:00:00 2001 From: worktycho Date: Sun, 25 May 2014 19:17:01 +0100 Subject: [PATCH 161/214] Update GroupManager.h --- src/GroupManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GroupManager.h b/src/GroupManager.h index 9e1689a76..d42b55c4a 100644 --- a/src/GroupManager.h +++ b/src/GroupManager.h @@ -16,8 +16,8 @@ class cGroupManager public: bool ExistsGroup(const AString & a_Name); cGroup * GetGroup(const AString & a_Name); - void LoadGroups(void); - void CheckUsers(void); + bool LoadGroups(); + bool CheckUsers(); /** Writes the default header to the specified ini file, and saves it as "users.ini". */ static void GenerateDefaultUsersIni(cIniFile & a_IniFile); From a352ec38958f2884d6fe12fa7320947c65d1a65f Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 25 May 2014 19:46:16 +0100 Subject: [PATCH 162/214] SEMICOLONS! --- src/GroupManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index ba25d95ba..523697b07 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -104,7 +104,7 @@ bool cGroupManager::CheckUsers() } // for itr - Split[] } // for i - ini file keys // Always return true for now, just but we can handle writefile fails later. - return true + return true; } @@ -189,7 +189,7 @@ bool cGroupManager::LoadGroups() } } // Always return true, we can handle writefile fails later. - return true + return true; } From 1a742a2b52d32bd22cd57b4d462bee312717e010 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 25 May 2014 23:50:16 +0200 Subject: [PATCH 163/214] Added support for Miners' Village. The village contains both prefabs that snap to ground and prefabs that connect strictly via connectors. Fixes #1027. --- src/Generating/PieceGenerator.cpp | 13 +- src/Generating/PieceGenerator.h | 21 +- src/Generating/Prefab.cpp | 6 +- src/Generating/Prefab.h | 12 + .../Prefabs/JapaneseVillagePrefabs.cpp | 808 ++- src/Generating/Prefabs/NetherFortPrefabs.cpp | 102 + .../Prefabs/PlainsVillagePrefabs.cpp | 5093 ++++++++++------- .../Prefabs/SandFlatRoofVillagePrefabs.cpp | 115 +- src/Generating/Prefabs/SandVillagePrefabs.cpp | 545 +- src/Generating/VillageGen.cpp | 45 +- 10 files changed, 4482 insertions(+), 2278 deletions(-) diff --git a/src/Generating/PieceGenerator.cpp b/src/Generating/PieceGenerator.cpp index 7d478f1a1..1880a20d5 100644 --- a/src/Generating/PieceGenerator.cpp +++ b/src/Generating/PieceGenerator.cpp @@ -286,7 +286,8 @@ cPlacedPiece::cPlacedPiece(const cPlacedPiece * a_Parent, const cPiece & a_Piece m_Parent(a_Parent), m_Piece(&a_Piece), m_Coords(a_Coords), - m_NumCCWRotations(a_NumCCWRotations) + m_NumCCWRotations(a_NumCCWRotations), + m_HasBeenMovedToGround(false) { m_Depth = (m_Parent == NULL) ? 0 : (m_Parent->GetDepth() + 1); m_HitBox = a_Piece.RotateMoveHitBox(a_NumCCWRotations, a_Coords.x, a_Coords.y, a_Coords.z); @@ -317,6 +318,16 @@ cPiece::cConnector cPlacedPiece::GetRotatedConnector(const cPiece::cConnector & +void cPlacedPiece::MoveToGroundBy(int a_OffsetY) +{ + m_Coords.y += a_OffsetY; + m_HasBeenMovedToGround = true; +} + + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cPieceGenerator: diff --git a/src/Generating/PieceGenerator.h b/src/Generating/PieceGenerator.h index e396643a9..21c155c96 100644 --- a/src/Generating/PieceGenerator.h +++ b/src/Generating/PieceGenerator.h @@ -139,11 +139,13 @@ class cPlacedPiece public: cPlacedPiece(const cPlacedPiece * a_Parent, const cPiece & a_Piece, const Vector3i & a_Coords, int a_NumCCWRotations); - const cPiece & GetPiece (void) const { return *m_Piece; } - const Vector3i & GetCoords (void) const { return m_Coords; } - int GetNumCCWRotations(void) const { return m_NumCCWRotations; } - const cCuboid & GetHitBox (void) const { return m_HitBox; } - int GetDepth (void) const { return m_Depth; } + const cPlacedPiece * GetParent (void) const { return m_Parent; } + const cPiece & GetPiece (void) const { return *m_Piece; } + const Vector3i & GetCoords (void) const { return m_Coords; } + int GetNumCCWRotations (void) const { return m_NumCCWRotations; } + const cCuboid & GetHitBox (void) const { return m_HitBox; } + int GetDepth (void) const { return m_Depth; } + bool HasBeenMovedToGround(void) const { return m_HasBeenMovedToGround; } /** Returns the coords as a modifiable object. */ Vector3i & GetCoords(void) { return m_Coords; } @@ -156,6 +158,11 @@ public: this placement. */ cPiece::cConnector GetRotatedConnector(const cPiece::cConnector & a_Connector) const; + /** Moves the placed piece Y-wise by the specified offset. + Sets m_HasBeenMovedToGround to true, too. + Used eg. by village houses. */ + void MoveToGroundBy(int a_OffsetY); + protected: const cPlacedPiece * m_Parent; const cPiece * m_Piece; @@ -163,6 +170,10 @@ protected: int m_NumCCWRotations; cCuboid m_HitBox; // Hitbox of the placed piece, in world coords int m_Depth; // Depth in the generated piece tree + + /** Set to true once the piece has been moved Y-wise. + Used eg. by village houses. */ + bool m_HasBeenMovedToGround; }; typedef std::vector cPlacedPieces; diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index 05979507a..e41907325 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -127,7 +127,8 @@ cPrefab::cPrefab(const cPrefab::sDef & a_Def) : m_MergeStrategy(a_Def.m_MergeStrategy), m_ShouldExtendFloor(a_Def.m_ShouldExtendFloor), m_DefaultWeight(a_Def.m_DefaultWeight), - m_AddWeightIfSame(a_Def.m_AddWeightIfSame) + m_AddWeightIfSame(a_Def.m_AddWeightIfSame), + m_MoveToGround(a_Def.m_MoveToGround) { m_BlockArea[0].Create(m_Size); CharMap cm; @@ -149,7 +150,8 @@ cPrefab::cPrefab(const cBlockArea & a_Image, int a_AllowedRotations) : m_MergeStrategy(cBlockArea::msOverwrite), m_ShouldExtendFloor(false), m_DefaultWeight(1), - m_AddWeightIfSame(0) + m_AddWeightIfSame(0), + m_MoveToGround(false) { m_HitBox.p1.Set(0, 0, 0); m_HitBox.p2.Set(m_Size.x - 1, m_Size.y - 1, m_Size.z - 1); diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h index adc0e688e..8b4e4b4ef 100644 --- a/src/Generating/Prefab.h +++ b/src/Generating/Prefab.h @@ -82,6 +82,10 @@ public: Can be positive or negative. This is used e. g. to make nether bridges prefer spanning multiple segments or to penalize turrets next to each other. */ int m_AddWeightIfSame; + + /** If true, the piece will be moved Y-wise so that its first connector is sitting on the terrain. + This is used e. g. for village houses. */ + bool m_MoveToGround; }; @@ -115,6 +119,10 @@ public: /** Adds the specified connector to the list of connectors this piece supports. */ void AddConnector(int a_RelX, int a_RelY, int a_RelZ, eBlockFace a_Direction, int a_Type); + + /** Returns whether the prefab should be moved Y-wise to ground before drawing, rather than staying + at the coords governed by the connectors. */ + bool ShouldMoveToGround(void) const { return m_MoveToGround; } protected: /** Packs complete definition of a single block, for per-letter assignment. */ @@ -169,6 +177,10 @@ protected: Can be positive or negative. This is used e. g. to make nether bridges prefer spanning multiple segments or to penalize turrets next to each other. */ int m_AddWeightIfSame; + + /** If true, the piece will be moved Y-wise so that its first connector is sitting on the terrain. + This is used e. g. for village houses. */ + bool m_MoveToGround; // cPiece overrides: diff --git a/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp b/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp index 2b129f520..5ec222f84 100644 --- a/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp +++ b/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp @@ -122,6 +122,9 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Arch @@ -385,10 +388,165 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Forge + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Garden2: + // The data has been exported from the gallery Plains, area index 147, ID 491, created by Aloe_vera + { + // Size: + 16, 5, 16, // SizeX = 16, SizeY = 5, SizeZ = 16 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 15, 4, 15, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 8: 0\n" /* water */ + "c: 2: 0\n" /* grass */ + "d: 17: 1\n" /* tree */ + "e: 13: 0\n" /* gravel */ + "f: 31: 2\n" /* tallgrass */ + "g: 18: 5\n" /* leaves */ + "h: 38: 7\n" /* rose */ + "i: 17: 9\n" /* tree */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "aaaaaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaaaaaaa" + /* 11 */ "aaaaaaaaaaaaaaaa" + /* 12 */ "aaaaaaaaaaaaaaaa" + /* 13 */ "aaaaaaaaaaaaaaaa" + /* 14 */ "aaaaaaaaaaaaaaaa" + /* 15 */ "aaaaaaaaaaaaaaaa" + + // Level 1 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "aaaaaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaaaaa" + /* 6 */ "aaaabbaaaaaaaaaa" + /* 7 */ "aaabbbaaaaaaaaaa" + /* 8 */ "aaabbaaaaaaaaaaa" + /* 9 */ "aaaabaaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaaaaaaa" + /* 11 */ "aaaaaaaaaaaaaaaa" + /* 12 */ "aaaaaaaaaaaaaaaa" + /* 13 */ "aaaaaaaaaaaaaaaa" + /* 14 */ "aaaaaaaaaaaaaaaa" + /* 15 */ "aaaaaaaaaaaaaaaa" + + // Level 2 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "cccccccccccccccc" + /* 1 */ "ccdccccccccdcccc" + /* 2 */ "cccccceecccccdcc" + /* 3 */ "ccccccceeccccccc" + /* 4 */ "cccccccceccccccc" + /* 5 */ "cccbbbbceccccccc" + /* 6 */ "cccbbbbceecccccc" + /* 7 */ "ccbbbbbcceeeeccc" + /* 8 */ "ccbbbbbccccceecc" + /* 9 */ "ccbbbbcccccccecc" + /* 10 */ "ccccbcccccccceec" + /* 11 */ "ccccccccccccccec" + /* 12 */ "ccccccccaaacccec" + /* 13 */ "cccccccccaccccec" + /* 14 */ "ccccccccccccceec" + /* 15 */ "cccccccccccceecc" + + // Level 3 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "......f...gg.g.." + /* 1 */ "..gg.....gggggg." + /* 2 */ "ffgg......ghgggg" + /* 3 */ ".............gg." + /* 4 */ "...........f...." + /* 5 */ "...........h.ff." + /* 6 */ ".............fh." + /* 7 */ "...............f" + /* 8 */ "................" + /* 9 */ ".......ff.f....." + /* 10 */ ".f.....ffggf...." + /* 11 */ ".......gggg.f..." + /* 12 */ ".f......iddg...." + /* 13 */ ".....f..gdgg...." + /* 14 */ "....ff...gg....." + /* 15 */ "................" + + // Level 4 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "...........g.g.." + /* 2 */ ".............gg." + /* 3 */ "................" + /* 4 */ "................" + /* 5 */ "................" + /* 6 */ "................" + /* 7 */ "................" + /* 8 */ "................" + /* 9 */ "................" + /* 10 */ ".........g......" + /* 11 */ "........ggg....." + /* 12 */ "........ggg....." + /* 13 */ ".........g......" + /* 14 */ "................" + /* 15 */ "................", + + // Connectors: + "-1: 12, 3, 15: 3\n" /* Type -1, direction Z+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // Garden2 + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // HouseMid: // The data has been exported from the gallery Plains, area index 62, ID 119, created by Aloe_vera @@ -558,6 +716,9 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // HouseMid @@ -666,10 +827,137 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // HouseSmall + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseSmallDblWithDoor: + // The data has been exported from the gallery Plains, area index 113, ID 265, created by Aloe_vera + { + // Size: + 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + -1, 0, 0, // MinX, MinY, MinZ + 11, 5, 7, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b: 17: 9\n" /* tree */ + "c: 17: 1\n" /* tree */ + "d: 35: 0\n" /* wool */ + "e: 64: 7\n" /* wooddoorblock */ + "f:171:12\n" /* carpet */ + "g:135: 1\n" /* 135 */ + "h:126: 2\n" /* woodenslab */ + "i:135: 2\n" /* 135 */ + "j: 50: 4\n" /* torch */ + "k: 64:12\n" /* wooddoorblock */ + "l: 85: 0\n" /* fence */ + "m: 19: 0\n" /* sponge */ + "n: 44: 8\n" /* step */ + "o: 43: 0\n" /* doubleslab */ + "p: 44: 0\n" /* step */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "maaaaaaaaam" + /* 2 */ "maaaabaaaam" + /* 3 */ "maaaabaaaam" + /* 4 */ "maaaabaaaam" + /* 5 */ "maaaaaaaaam" + /* 6 */ "mmmmmmmmmmm" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".cdedcdddc." + /* 2 */ ".dfff.fffd." + /* 3 */ ".dgffdfhfd." + /* 4 */ ".diifdfffd." + /* 5 */ ".cdddcdddc." + /* 6 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ ".j...j...j." + /* 1 */ ".cdkdclllc." + /* 2 */ ".d.......l." + /* 3 */ ".l...l...l." + /* 4 */ ".d...l...l." + /* 5 */ ".clllclllc." + /* 6 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ ".nnnnnnnnn." + /* 1 */ "ncdddcdddcn" + /* 2 */ "nd...d...dn" + /* 3 */ "nd...d...dn" + /* 4 */ "nd...d...dn" + /* 5 */ "ncdddcdddcn" + /* 6 */ ".nnnnnnnnn." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "op.......po" + /* 1 */ "ppppppppppp" + /* 2 */ ".pooooooop." + /* 3 */ ".ponndnnop." + /* 4 */ ".pooooooop." + /* 5 */ "ppppppppppp" + /* 6 */ "op.......po" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "...ppppp..." + /* 4 */ "..........." + /* 5 */ "..........." + /* 6 */ "...........", + + // Connectors: + "-1: 3, 1, -1: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // HouseSmallDblWithDoor + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // HouseSmallDouble: // The data has been exported from the gallery Plains, area index 72, ID 135, created by Aloe_vera @@ -784,10 +1072,126 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // HouseSmallDouble + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseSmallWithDoor: + // The data has been exported from the gallery Plains, area index 112, ID 264, created by Aloe_vera + { + // Size: + 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7 + + // Hitbox (relative to bounding box): + -1, 0, 0, // MinX, MinY, MinZ + 7, 5, 7, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b: 17: 1\n" /* tree */ + "c: 35: 0\n" /* wool */ + "d: 64: 7\n" /* wooddoorblock */ + "e: 50: 4\n" /* torch */ + "f: 64:12\n" /* wooddoorblock */ + "g: 85: 0\n" /* fence */ + "h: 44: 8\n" /* step */ + "i: 43: 0\n" /* doubleslab */ + "j: 44: 0\n" /* step */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "maaaaam" + /* 2 */ "maaaaam" + /* 3 */ "maaaaam" + /* 4 */ "maaaaam" + /* 5 */ "maaaaam" + /* 6 */ "mmmmmmm" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".bcdcb." + /* 2 */ ".c...c." + /* 3 */ ".c...c." + /* 4 */ ".c...c." + /* 5 */ ".bcccb." + /* 6 */ "......." + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ ".....e." + /* 1 */ ".bcfcb." + /* 2 */ ".g...g." + /* 3 */ ".g...g." + /* 4 */ ".g...g." + /* 5 */ ".bgggb." + /* 6 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ ".hhhhh." + /* 1 */ "hbcccbh" + /* 2 */ "hc...ch" + /* 3 */ "hc...ch" + /* 4 */ "hc...ch" + /* 5 */ "hbcccbh" + /* 6 */ ".hhhhh." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "ij...ji" + /* 1 */ "jjjjjjj" + /* 2 */ ".jiiij." + /* 3 */ ".jiiij." + /* 4 */ ".jiiij." + /* 5 */ "jjjjjjj" + /* 6 */ "ij...ji" + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "......." + /* 3 */ "...j..." + /* 4 */ "......." + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // HouseSmallWithDoor + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // HouseWide: // The data has been exported from the gallery Plains, area index 64, ID 121, created by STR_Warrior @@ -929,6 +1333,9 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // HouseWide @@ -1172,6 +1579,9 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // HouseWithGarden @@ -1363,10 +1773,375 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // HouseWithSakura1 + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseWithSpa: + // The data has been exported from the gallery Plains, area index 73, ID 139, created by Aloe_vera + { + // Size: + 16, 8, 14, // SizeX = 16, SizeY = 8, SizeZ = 14 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 15, 7, 13, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 2\n" /* wood */ + "b: 3: 0\n" /* dirt */ + "c: 2: 0\n" /* grass */ + "d: 8: 0\n" /* water */ + "e:135: 3\n" /* 135 */ + "f:135: 1\n" /* 135 */ + "g:113: 0\n" /* netherbrickfence */ + "h: 17: 1\n" /* tree */ + "i: 35: 0\n" /* wool */ + "j:171:12\n" /* carpet */ + "k: 64: 6\n" /* wooddoorblock */ + "l:126: 2\n" /* woodenslab */ + "m: 19: 0\n" /* sponge */ + "n:135: 2\n" /* 135 */ + "o: 64: 7\n" /* wooddoorblock */ + "p: 50: 4\n" /* torch */ + "q: 85: 0\n" /* fence */ + "r: 64:12\n" /* wooddoorblock */ + "s: 50: 3\n" /* torch */ + "t: 44: 8\n" /* step */ + "u: 43: 0\n" /* doubleslab */ + "v: 44: 0\n" /* step */, + + // Block data: + // Level 0 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ ".aaaaaaaaaaaaaa." + /* 2 */ ".aaaaaaaaaaaaaa." + /* 3 */ ".aaaaaaaaaaaaaa." + /* 4 */ ".aaaaaaaaaaaaaa." + /* 5 */ ".aaaaaaaaaaaaaa." + /* 6 */ ".aaaaaaaaaaaaaa." + /* 7 */ ".aaaaaabbbbbbbbb" + /* 8 */ ".aaaaaabbbbbbbbb" + /* 9 */ ".aaaaaabbbbbbbbb" + /* 10 */ ".aaaaaabbbbbbbbb" + /* 11 */ ".aaaaaabbbbbbbbb" + /* 12 */ ".aaaaaabbbbbbbbb" + /* 13 */ ".......bbbbbbbbb" + + // Level 1 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "mmmmmmmmmmmmmmmm" + /* 1 */ "maaaaaaaaaaaaaam" + /* 2 */ "maaaaaaaaaaaaaam" + /* 3 */ "maaaaaaaaaaaaaam" + /* 4 */ "maaaaaaaaaaaaaam" + /* 5 */ "maaaaaaaaaaaaaam" + /* 6 */ "maaaaaaaaaaaaaam" + /* 7 */ "maaaaaaaaaaccccc" + /* 8 */ "maaaaaaacccccccc" + /* 9 */ "maaaaaaacccccccc" + /* 10 */ "maaaaaaacccccccc" + /* 11 */ "maaaaaaccccccccc" + /* 12 */ "maaaaaaccccccccc" + /* 13 */ "mmmmmmmccccccccc" + + // Level 2 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ ".aaaaaaaaaaaaaa." + /* 2 */ ".aaaaaaaaaaaaaa." + /* 3 */ ".aaaaaaaaaaaaaa." + /* 4 */ ".aaaaaaaaaaaaaa." + /* 5 */ ".aaaaaaaaaaaaaa." + /* 6 */ ".aaddaaaaaaaaaa." + /* 7 */ ".aaddaaeeef....." + /* 8 */ ".aaddaaf........" + /* 9 */ ".aaddaaf........" + /* 10 */ ".aaddaae........" + /* 11 */ ".aaddaa........." + /* 12 */ ".aaaaaa........." + /* 13 */ "................" + + // Level 3 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ ".ggggghiiihiiih." + /* 2 */ ".geee.ijjjjjjji." + /* 3 */ ".gf...kjjjijlji." + /* 4 */ ".gf...innjijjji." + /* 5 */ ".g....hiiohiiih." + /* 6 */ ".g....g........." + /* 7 */ ".g.............." + /* 8 */ ".g.............." + /* 9 */ ".g.............." + /* 10 */ ".g....g........." + /* 11 */ ".g....g........." + /* 12 */ ".gggggg........." + /* 13 */ "................" + + // Level 4 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "......p...p...p." + /* 1 */ ".g....hqqqhqqqh." + /* 2 */ "......i.......i." + /* 3 */ "......r...q...q." + /* 4 */ "......i...q...i." + /* 5 */ "......hqqrhqqqh." + /* 6 */ "......g...s....." + /* 7 */ "................" + /* 8 */ "................" + /* 9 */ "................" + /* 10 */ "................" + /* 11 */ "................" + /* 12 */ ".g....g........." + /* 13 */ "................" + + // Level 5 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ ".tttttttttttttt." + /* 1 */ "tggggghqqqhqqqht" + /* 2 */ "tg....i.......it" + /* 3 */ "tg....i...i...it" + /* 4 */ "tg....i...i...it" + /* 5 */ "tg....hiiihiiiht" + /* 6 */ "tg....gtttttttt." + /* 7 */ "tg....gt........" + /* 8 */ "tg....gt........" + /* 9 */ "tg....gt........" + /* 10 */ "tg....gt........" + /* 11 */ "tg....gt........" + /* 12 */ "tggggggt........" + /* 13 */ ".tttttt........." + + // Level 6 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "uv............vu" + /* 1 */ "vvvvvvvvvvvvvvvv" + /* 2 */ ".vuuuuuuuuuuuuv." + /* 3 */ ".vuuuuuutuuuuuv." + /* 4 */ ".vuuuuuuuuuuuuv." + /* 5 */ ".vuuuuvvvvvvvvvv" + /* 6 */ ".vuuuuv.......vu" + /* 7 */ ".vuuuuv........." + /* 8 */ ".vuuuuv........." + /* 9 */ ".vuuuuv........." + /* 10 */ ".vuuuuv........." + /* 11 */ ".vuuuuv........." + /* 12 */ "vvvvvvvv........" + /* 13 */ "uv....vu........" + + // Level 7 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" + /* 2 */ "................" + /* 3 */ "...vvvvvvvvvv..." + /* 4 */ "...vv..........." + /* 5 */ "...vv..........." + /* 6 */ "...vv..........." + /* 7 */ "...vv..........." + /* 8 */ "...vv..........." + /* 9 */ "...vv..........." + /* 10 */ "...vv..........." + /* 11 */ "................" + /* 12 */ "................" + /* 13 */ "................", + + // Connectors: + "", + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // HouseWithSpa + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MediumSakuraTree: + // The data has been exported from the gallery Plains, area index 146, ID 490, created by STR_Warrior + { + // Size: + 7, 10, 7, // SizeX = 7, SizeY = 10, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 9, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 31: 1\n" /* tallgrass */ + "d: 38: 7\n" /* rose */ + "e: 17: 1\n" /* tree */ + "f: 38: 0\n" /* rose */ + "g: 38: 8\n" /* rose */ + "h: 38: 5\n" /* rose */ + "i: 35: 6\n" /* wool */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaaaaa" + /* 3 */ "aaaaaaa" + /* 4 */ "aaaaaaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "bbbbbbb" + /* 1 */ "bbbbbbb" + /* 2 */ "bbbbbbb" + /* 3 */ "bbbabbb" + /* 4 */ "bbbbbbb" + /* 5 */ "bbbbbbb" + /* 6 */ "bbbbbbb" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..c.c.." + /* 2 */ ".dccdc." + /* 3 */ "..cefc." + /* 4 */ ".ccfgh." + /* 5 */ "..ccc.." + /* 6 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "......." + /* 3 */ "...e..." + /* 4 */ "......." + /* 5 */ "......." + /* 6 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..i...." + /* 2 */ "......." + /* 3 */ "...e.i." + /* 4 */ ".i....." + /* 5 */ "......." + /* 6 */ "......." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..i...." + /* 2 */ "...i..." + /* 3 */ "..ieii." + /* 4 */ ".i.ii.." + /* 5 */ "...i..." + /* 6 */ "......." + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..ii..." + /* 2 */ "..iii.." + /* 3 */ ".iieii." + /* 4 */ ".iiii.." + /* 5 */ "..iii.." + /* 6 */ "......." + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..iii.." + /* 2 */ ".iiiii." + /* 3 */ ".iieii." + /* 4 */ ".iiiii." + /* 5 */ "..iii.." + /* 6 */ "......." + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "...i..." + /* 2 */ "..iiii." + /* 3 */ ".iiiii." + /* 4 */ "..iii.." + /* 5 */ "...i..." + /* 6 */ "......." + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "...i..." + /* 3 */ "..iii.." + /* 4 */ "...i..." + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "-1: 3, 2, 0: 2\n" /* Type -1, direction Z- */ + "3: 6, 2, 3: 5\n" /* Type 3, direction X+ */ + "-3: 0, 2, 3: 4\n" /* Type -3, direction X- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // MediumSakuraTree + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Restaurant: // The data has been exported from the gallery Plains, area index 61, ID 117, created by Aloe_vera @@ -1614,6 +2389,9 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Restaurant @@ -1626,8 +2404,8 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = 12, 8, 6, // SizeX = 12, SizeY = 8, SizeZ = 6 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 11, 7, 5, // MaxX, MaxY, MaxZ + -1, 0, -1, // MinX, MinY, MinZ + 12, 7, 6, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1719,7 +2497,11 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = /* 5 */ "............", // Connectors: - "-1: 0, 2, 2: 4\n" /* Type -1, direction X- */, + "-1: -1, 2, 2: 4\n" /* Type -1, direction X- */ + "3: 5, 2, 6: 3\n" /* Type 3, direction Z+ */ + "-3: 6, 2, -1: 2\n" /* Type -3, direction Z- */ + "-3: 12, 2, 2: 5\n" /* Type -3, direction X+ */ + "3: 12, 2, 2: 5\n" /* Type 3, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1738,6 +2520,9 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // SakuraDouble @@ -1750,8 +2535,8 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = 5, 7, 5, // SizeX = 5, SizeY = 7, SizeZ = 5 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 4, 6, 4, // MaxX, MaxY, MaxZ + -1, 0, -1, // MinX, MinY, MinZ + 5, 6, 5, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1819,7 +2604,9 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = /* 4 */ ".....", // Connectors: - "-1: 2, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 2, 2, -1: 2\n" /* Type -1, direction Z- */ + "3: 5, 2, 2: 5\n" /* Type 3, direction X+ */ + "-3: -1, 2, 2: 4\n" /* Type -3, direction X- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1838,6 +2625,9 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // SakuraSmall }; // g_JapaneseVillagePrefabs @@ -2192,6 +2982,9 @@ const cPrefab::sDef g_JapaneseVillageStartingPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // HighTemple @@ -2389,6 +3182,9 @@ const cPrefab::sDef g_JapaneseVillageStartingPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Well }; diff --git a/src/Generating/Prefabs/NetherFortPrefabs.cpp b/src/Generating/Prefabs/NetherFortPrefabs.cpp index 088340391..2c97f28ea 100644 --- a/src/Generating/Prefabs/NetherFortPrefabs.cpp +++ b/src/Generating/Prefabs/NetherFortPrefabs.cpp @@ -155,6 +155,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BalconyCorridor @@ -315,6 +318,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BalconyTee2 @@ -435,6 +441,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BlazePlatform @@ -605,6 +614,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BlazePlatformOverhang @@ -805,6 +817,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: -1000, + + // MoveToGround: + false, }, // BridgeCircleCrossing @@ -1006,6 +1021,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BridgeCrossing @@ -1100,6 +1118,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BridgeCrumble1 @@ -1200,6 +1221,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BridgeCrumble2 @@ -1379,6 +1403,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 1000, + + // MoveToGround: + false, }, // BridgeDoubleCrumble @@ -1619,6 +1646,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BridgeFunnelDown @@ -1948,6 +1978,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BridgeLevelCrossing @@ -2067,6 +2100,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 1000, + + // MoveToGround: + false, }, // BridgeSegment @@ -2227,6 +2263,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // BridgeTee @@ -2328,6 +2367,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // Corridor11 @@ -2429,6 +2471,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // Corridor13 @@ -2524,6 +2569,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 500, + + // MoveToGround: + false, }, // Corridor5 @@ -2663,6 +2711,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // CorridorCorner5 @@ -2803,6 +2854,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // CorridorCornerChest5 @@ -2928,6 +2982,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: -50, + + // MoveToGround: + false, }, // CorridorCrossing @@ -3080,6 +3137,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // CorridorStairs @@ -3181,6 +3241,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // DarkCorridor @@ -3438,6 +3501,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // LavaStaircase @@ -3769,6 +3835,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: -1000, + + // MoveToGround: + false, }, // LavaStaircaseBig @@ -4047,6 +4116,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // LavaStairsBridge @@ -4235,6 +4307,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: -1000, + + // MoveToGround: + false, }, // MidStaircase @@ -4378,6 +4453,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // StairsToOpen1 @@ -4521,6 +4599,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // StairsToOpen2 @@ -4638,6 +4719,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // Tee2x4 @@ -4767,6 +4851,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // Tee4x4 @@ -4863,6 +4950,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: -50, + + // MoveToGround: + false, }, // TinyCorridorCorner @@ -4960,6 +5050,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // TinyCorridorCornerChest @@ -5059,6 +5152,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: -50, + + // MoveToGround: + false, }, // TinyCorridorCrossing @@ -5174,6 +5270,9 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // AddWeightIfSame: -99, + + // MoveToGround: + false, }, // Turret }; // g_NetherFortPrefabs @@ -5378,6 +5477,9 @@ const cPrefab::sDef g_NetherFortStartingPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + false, }, // CentralRoom }; diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index 28488be14..fee6610c9 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -20,11 +20,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 26, ID 70, created by Taugrammaton { // Size: - 13, 4, 12, // SizeX = 13, SizeY = 4, SizeZ = 12 + 13, 8, 12, // SizeX = 13, SizeY = 8, SizeZ = 12 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 12, 3, 11, // MaxX, MaxY, MaxZ + 12, 7, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -36,6 +36,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "f: 8: 0\n" /* water */ "g: 85: 0\n" /* fence */ "h: 59: 7\n" /* crops */ + "i: 50: 5\n" /* torch */ "m: 19: 0\n" /* sponge */, // Block data: @@ -101,7 +102,71 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "ghh..h....hhg" /* 9 */ "ghh.....h.hhg" /* 10 */ "ghh.hh.h..hhg" - /* 11 */ "g..g..g..g..g", + /* 11 */ "g..g..g..g..g" + + // Level 4 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "i..i..i..i..i" + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ "............." + /* 5 */ "............." + /* 6 */ "............." + /* 7 */ "............." + /* 8 */ "............." + /* 9 */ "............." + /* 10 */ "............." + /* 11 */ "i..i..i..i..i" + + // Level 5 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ "............." + /* 5 */ "............." + /* 6 */ "............." + /* 7 */ "............." + /* 8 */ "............." + /* 9 */ "............." + /* 10 */ "............." + /* 11 */ "............." + + // Level 6 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ "............." + /* 5 */ "............." + /* 6 */ "............." + /* 7 */ "............." + /* 8 */ "............." + /* 9 */ "............." + /* 10 */ "............." + /* 11 */ "............." + + // Level 7 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ "............." + /* 5 */ "............." + /* 6 */ "............." + /* 7 */ "............." + /* 8 */ "............." + /* 9 */ "............." + /* 10 */ "............." + /* 11 */ ".............", // Connectors: "-1: 7, 1, 11: 3\n" /* Type -1, direction Z+ */, @@ -123,6 +188,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // BigPlantBed @@ -132,130 +200,117 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 23, ID 66, created by xoft { // Size: - 12, 8, 7, // SizeX = 12, SizeY = 8, SizeZ = 7 + 12, 7, 7, // SizeX = 12, SizeY = 7, SizeZ = 7 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 12, 7, 7, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 12, 6, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 64: 7\n" /* wooddoorblock */ - "h: 53: 3\n" /* woodstairs */ - "i: 53: 1\n" /* woodstairs */ - "j: 85: 0\n" /* fence */ - "k: 53: 0\n" /* woodstairs */ - "l: 53: 2\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 64: 7\n" /* wooddoorblock */ + "f: 53: 3\n" /* woodstairs */ + "g: 53: 1\n" /* woodstairs */ + "h: 85: 0\n" /* fence */ + "i: 53: 0\n" /* woodstairs */ + "j: 53: 2\n" /* woodstairs */ + "k:102: 0\n" /* glasspane */ + "l: 64:12\n" /* wooddoorblock */ "m: 19: 0\n" /* sponge */ - "n:102: 0\n" /* glasspane */ - "o: 64:12\n" /* wooddoorblock */ - "p: 50: 3\n" /* torch */ - "q: 72: 0\n" /* woodplate */ - "r: 50: 4\n" /* torch */ - "s: 53: 7\n" /* woodstairs */ - "t: 47: 0\n" /* bookshelf */ - "u: 50: 1\n" /* torch */ - "v: 50: 2\n" /* torch */ - "w: 53: 6\n" /* woodstairs */ - "x: 5: 0\n" /* wood */, + "n: 50: 3\n" /* torch */ + "o: 72: 0\n" /* woodplate */ + "p: 50: 4\n" /* torch */ + "q: 53: 7\n" /* woodstairs */ + "r: 47: 0\n" /* bookshelf */ + "s: 50: 1\n" /* torch */ + "t: 50: 2\n" /* torch */ + "u: 53: 6\n" /* woodstairs */ + "v: 5: 0\n" /* wood */, // Block data: // Level 0 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "aaaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaaa" + /* 0 */ "mmmmmmmaaamm" + /* 1 */ "maaaaaaaaaam" + /* 2 */ "maaaaaaaaaam" + /* 3 */ "maaaaaaaaaam" + /* 4 */ "maaaaaaaaaam" + /* 5 */ "maaaaaaaaaam" + /* 6 */ "mmmmmmmmmmmm" // Level 1 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "bbbbbbbaaabb" - /* 1 */ "baaaaaaaaaab" - /* 2 */ "baaaaaaaaaab" - /* 3 */ "baaaaaaaaaab" - /* 4 */ "baaaaaaaaaab" - /* 5 */ "baaaaaaaaaab" - /* 6 */ "bbbbbbbbbbbb" + /* 0 */ ".......bcd.." + /* 1 */ ".aaaaaaaaaa." + /* 2 */ ".aaaaaaaaaa." + /* 3 */ ".aaaaaaaaaa." + /* 4 */ ".aaaaaaaaaa." + /* 5 */ ".aaaaaaaaaa." + /* 6 */ "............" // Level 2 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ ".......cde.." - /* 1 */ ".ffffffffff." - /* 2 */ ".ffffffffff." - /* 3 */ ".ffffffffff." - /* 4 */ ".ffffffffff." - /* 5 */ ".ffffffffff." + /* 0 */ "............" + /* 1 */ ".aaaaaaaeaa." + /* 2 */ ".af.ghi...a." + /* 3 */ ".ah.......a." + /* 4 */ ".aj.ghighia." + /* 5 */ ".aaaaaaaaaa." /* 6 */ "............" // Level 3 /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ ".fffffffgff." - /* 2 */ ".fh.ijk...f." - /* 3 */ ".fj.......f." - /* 4 */ ".fl.ijkijkf." - /* 5 */ ".ffffffffff." + /* 1 */ ".akkakkalaa." + /* 2 */ ".k..no.n.nk." + /* 3 */ ".ko.......k." + /* 4 */ ".k..po.po.k." + /* 5 */ ".akkakkakka." /* 6 */ "............" // Level 4 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".fnnfnnfoff." - /* 2 */ ".n..pq.p.pn." - /* 3 */ ".nq.......n." - /* 4 */ ".n..rq.rq.n." - /* 5 */ ".fnnfnnfnnf." - /* 6 */ "............" + /* 0 */ "jjjjjjjjjjjj" + /* 1 */ "qaaaaaaaaaaq" + /* 2 */ ".arrrrrrrra." + /* 3 */ ".as......ta." + /* 4 */ ".arrrrrrrra." + /* 5 */ "uaaaaaaaaaau" + /* 6 */ "ffffffffffff" // Level 5 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "llllllllllll" - /* 1 */ "sffffffffffs" - /* 2 */ ".fttttttttf." - /* 3 */ ".fu......vf." - /* 4 */ ".fttttttttf." - /* 5 */ "wffffffffffw" - /* 6 */ "hhhhhhhhhhhh" + /* 0 */ "............" + /* 1 */ "jjjjjjjjjjjj" + /* 2 */ "qvvvvvvvvvvq" + /* 3 */ ".vvvvvvvvvv." + /* 4 */ "uvvvvvvvvvvu" + /* 5 */ "ffffffffffff" + /* 6 */ "............" // Level 6 /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ "llllllllllll" - /* 2 */ "sxxxxxxxxxxs" - /* 3 */ ".xxxxxxxxxx." - /* 4 */ "wxxxxxxxxxxw" - /* 5 */ "hhhhhhhhhhhh" - /* 6 */ "............" - - // Level 7 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" /* 1 */ "............" - /* 2 */ "llllllllllll" - /* 3 */ "xxxxxxxxxxxx" - /* 4 */ "hhhhhhhhhhhh" + /* 2 */ "jjjjjjjjjjjj" + /* 3 */ "vvvvvvvvvvvv" + /* 4 */ "ffffffffffff" /* 5 */ "............" /* 6 */ "............", // Connectors: - "-1: 8, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 8, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -274,6 +329,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // CobbleHouse10x5Library @@ -283,50 +341,130 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 5, ID 20, created by tonibm1999 { // Size: - 15, 2, 9, // SizeX = 15, SizeY = 2, SizeZ = 9 + 15, 8, 9, // SizeX = 15, SizeY = 8, SizeZ = 9 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 14, 1, 8, // MaxX, MaxY, MaxZ + 14, 7, 8, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 17: 0\n" /* tree */ - "b: 60: 7\n" /* tilleddirt */ - "c: 8: 0\n" /* water */ - "d: 50: 5\n" /* torch */ - "e: 59: 7\n" /* crops */ + "a: 3: 0\n" /* dirt */ + "b: 2: 0\n" /* grass */ + "c: 17: 0\n" /* tree */ + "d: 60: 7\n" /* tilleddirt */ + "e: 8: 0\n" /* water */ + "f: 50: 5\n" /* torch */ + "g: 59: 7\n" /* crops */ "m: 19: 0\n" /* sponge */, // Block data: // Level 0 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "aaaaaaa.aaaaaaa" - /* 1 */ "abbcbba.abbcbba" - /* 2 */ "abbcbba.abbcbba" - /* 3 */ "abbcbba.abbcbba" - /* 4 */ "abbcbba.abbcbba" - /* 5 */ "abbcbba.abbcbba" - /* 6 */ "abbcbba.abbcbba" - /* 7 */ "abbcbba.abbcbba" - /* 8 */ "aaaaaaa.aaaaaaa" + /* 0 */ "aaaaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaaaaaa" + /* 3 */ "aaaaaaaaaaaaaaa" + /* 4 */ "aaaaaaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaaaaa" // Level 1 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "d.....d.d.....d" - /* 1 */ ".ee.ee...ee.ee." - /* 2 */ ".e...e...ee.ee." - /* 3 */ ".e.......ee.ee." - /* 4 */ ".ee..e...ee.ee." - /* 5 */ ".ee..e...ee.ee." - /* 6 */ "..e..e...ee.ee." - /* 7 */ "..e.e....ee.ee." - /* 8 */ "d.....d.d.....d", + /* 0 */ "aaaaaaabaaaaaaa" + /* 1 */ "aaaaaaabaaaaaaa" + /* 2 */ "aaaaaaabaaaaaaa" + /* 3 */ "aaaaaaabaaaaaaa" + /* 4 */ "aaaaaaabaaaaaaa" + /* 5 */ "aaaaaaabaaaaaaa" + /* 6 */ "aaaaaaabaaaaaaa" + /* 7 */ "aaaaaaabaaaaaaa" + /* 8 */ "aaaaaaabaaaaaaa" + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "ccccccc.ccccccc" + /* 1 */ "cddeddc.cddeddc" + /* 2 */ "cddeddc.cddeddc" + /* 3 */ "cddeddc.cddeddc" + /* 4 */ "cddeddc.cddeddc" + /* 5 */ "cddeddc.cddeddc" + /* 6 */ "cddeddc.cddeddc" + /* 7 */ "cddeddc.cddeddc" + /* 8 */ "ccccccc.ccccccc" + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "f.....f.f.....f" + /* 1 */ ".gg.gg...gg.gg." + /* 2 */ ".g...g...gg.gg." + /* 3 */ ".g.......gg.gg." + /* 4 */ ".gg..g...gg.gg." + /* 5 */ ".gg..g...gg.gg." + /* 6 */ "..g..g...gg.gg." + /* 7 */ "..g.g....gg.gg." + /* 8 */ "f.....f.f.....f" + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "...............", // Connectors: - "-1: 7, 0, 8: 3\n" /* Type -1, direction Z+ */, + "-1: 7, 2, 8: 3\n" /* Type -1, direction Z+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -345,6 +483,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // DoublePlantBed @@ -354,160 +495,158 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 51, ID 102, created by Aloe_vera { // Size: - 12, 10, 11, // SizeX = 12, SizeY = 10, SizeZ = 11 + 12, 9, 11, // SizeX = 12, SizeY = 9, SizeZ = 11 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 12, 9, 11, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 12, 8, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 6\n" /* wooddoorblock */ - "j: 10: 0\n" /* lava */ - "k: 54: 2\n" /* chest */ - "l: 61: 2\n" /* furnace */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 6\n" /* wooddoorblock */ + "h: 10: 0\n" /* lava */ + "i: 54: 2\n" /* chest */ + "j: 61: 2\n" /* furnace */ + "k:102: 0\n" /* glasspane */ + "l: 64:12\n" /* wooddoorblock */ "m: 19: 0\n" /* sponge */ - "n:102: 0\n" /* glasspane */ - "o: 64:12\n" /* wooddoorblock */ - "p:139: 0\n" /* cobblestonewall */ - "q:101: 0\n" /* ironbars */ - "r: 53: 2\n" /* woodstairs */ - "s: 53: 7\n" /* woodstairs */ - "t: 50: 2\n" /* torch */ - "u: 50: 1\n" /* torch */ - "v: 53: 6\n" /* woodstairs */ - "w: 53: 3\n" /* woodstairs */ - "x: 43: 0\n" /* doubleslab */ - "y: 44: 0\n" /* step */, + "n:139: 0\n" /* cobblestonewall */ + "o:101: 0\n" /* ironbars */ + "p: 53: 2\n" /* woodstairs */ + "q: 53: 7\n" /* woodstairs */ + "r: 50: 2\n" /* torch */ + "s: 50: 1\n" /* torch */ + "t: 53: 6\n" /* woodstairs */ + "u: 53: 3\n" /* woodstairs */ + "v: 43: 0\n" /* doubleslab */ + "w: 44: 0\n" /* step */, // Block data: // Level 0 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "aaaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaaa" - /* 8 */ "aaaaaaaaaaaa" - /* 9 */ "aaaaaaaaaaaa" - /* 10 */ "aaaaaaaaaaaa" + /* 0 */ "mmmmmaaaaamm" + /* 1 */ "maaaaaaaaamm" + /* 2 */ "maaaaaaaaamm" + /* 3 */ "maaaaaaaaaaa" + /* 4 */ "maaaaaaaaaaa" + /* 5 */ "maaaaaaaaaaa" + /* 6 */ "maaaaaaaaaaa" + /* 7 */ "maaaaaaaaaaa" + /* 8 */ "maaaaammmmmm" + /* 9 */ "maaaaammmmmm" + /* 10 */ "mmmmmmmmmmmm" // Level 1 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "bbbbbaaaaabb" - /* 1 */ "baaaaaaaaabb" - /* 2 */ "baaaaaaaaabb" - /* 3 */ "baaaaaaaaaaa" - /* 4 */ "baaaaaaaaaaa" - /* 5 */ "baaaaaaaaaaa" - /* 6 */ "baaaaaaaaaaa" - /* 7 */ "baaaaaaaaaaa" - /* 8 */ "baaaaabbbbbb" - /* 9 */ "baaaaabbbbbb" - /* 10 */ "bbbbbbbbbbbb" + /* 0 */ ".....bcccd.." + /* 1 */ ".aaaaaaaad.." + /* 2 */ ".aaaaaaaad.." + /* 3 */ ".aaaaaaaaaaa" + /* 4 */ ".aaaaaaaaaaa" + /* 5 */ ".aaaaaaaaaaa" + /* 6 */ ".aaaaaaaaaaa" + /* 7 */ ".aaaaaaaaaaa" + /* 8 */ ".aaaaa......" + /* 9 */ ".aaaaa......" + /* 10 */ "............" // Level 2 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ ".....cddde.." - /* 1 */ ".ffffffffe.." - /* 2 */ ".ffffffffe.." - /* 3 */ ".fffffffffff" - /* 4 */ ".fffffffffff" - /* 5 */ ".fffffffffff" - /* 6 */ ".fffffffffff" - /* 7 */ ".fffffffffff" - /* 8 */ ".fffff.mmmmm" - /* 9 */ ".fffff.mmmmm" - /* 10 */ ".......mmmmm" + /* 0 */ "............" + /* 1 */ ".efffe......" + /* 2 */ ".f...g......" + /* 3 */ ".f...ea..aaa" + /* 4 */ ".f...f...aha" + /* 5 */ ".f...f...aha" + /* 6 */ ".f...fijjaha" + /* 7 */ ".f...eaaaaaa" + /* 8 */ ".f...f......" + /* 9 */ ".efffe......" + /* 10 */ "............" // Level 3 /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ ".ghhhg......" - /* 2 */ ".h...i......" - /* 3 */ ".h...gf..fff" - /* 4 */ ".h...h...fjf" - /* 5 */ ".h...h...fjf" - /* 6 */ ".h...hkllfjf" - /* 7 */ ".h...gffffff" - /* 8 */ ".h...h.mmmmm" - /* 9 */ ".ghhhg.mmmmm" - /* 10 */ ".......mmmmm" + /* 1 */ ".ekkke......" + /* 2 */ ".k...l......" + /* 3 */ ".k...en..n.a" + /* 4 */ ".k...k.....o" + /* 5 */ ".f...k.....o" + /* 6 */ ".k...k.....o" + /* 7 */ ".k...eaooooa" + /* 8 */ ".k...f......" + /* 9 */ ".ekkke......" + /* 10 */ "............" // Level 4 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".gnnng......" - /* 2 */ ".n...o......" - /* 3 */ ".n...gp..p.f" - /* 4 */ ".n...n.....q" - /* 5 */ ".h...n.....q" - /* 6 */ ".n...n.....q" - /* 7 */ ".n...gfqqqqf" - /* 8 */ ".n...h.mmmmm" - /* 9 */ ".gnnng.mmmmm" - /* 10 */ ".......mmmmm" + /* 0 */ "ppppppp....." + /* 1 */ "qfffffq....." + /* 2 */ ".f...f......" + /* 3 */ ".f..rfa..aoa" + /* 4 */ ".f...f...o.a" + /* 5 */ ".f...f...o.a" + /* 6 */ ".fs..f...o.a" + /* 7 */ ".f...faaaaaa" + /* 8 */ ".f...f......" + /* 9 */ "tffffft....." + /* 10 */ "uuuuuuu....." // Level 5 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "rrrrrrr....." - /* 1 */ "shhhhhs....." - /* 2 */ ".h...h......" - /* 3 */ ".h..thf..fqf" - /* 4 */ ".h...h...q.f" - /* 5 */ ".h...h...q.f" - /* 6 */ ".hu..h...q.f" - /* 7 */ ".h...hffffff" - /* 8 */ ".h...h.mmmmm" - /* 9 */ "vhhhhhvmmmmm" - /* 10 */ "wwwwwwwmmmmm" + /* 0 */ "............" + /* 1 */ "ppppppp....." + /* 2 */ "qfffffq....." + /* 3 */ ".f...fvvvvvv" + /* 4 */ ".f...fvwwwwv" + /* 5 */ ".f...fvwwwwv" + /* 6 */ ".f...fvwwwwv" + /* 7 */ ".f...fvvvvvv" + /* 8 */ "tffffft....." + /* 9 */ "uuuuuuu....." + /* 10 */ "............" // Level 6 /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ "rrrrrrr....." - /* 2 */ "shhhhhs....." - /* 3 */ ".h...hxxxxxx" - /* 4 */ ".h...hxyyyyx" - /* 5 */ ".h...hxyyyyx" - /* 6 */ ".h...hxyyyyx" - /* 7 */ ".h...hxxxxxx" - /* 8 */ "vhhhhhvmmmmm" - /* 9 */ "wwwwwwwmmmmm" - /* 10 */ ".......mmmmm" + /* 1 */ "............" + /* 2 */ "ppppppp....." + /* 3 */ "qfffffq....." + /* 4 */ ".f...f......" + /* 5 */ ".f...f......" + /* 6 */ ".f...f......" + /* 7 */ "tffffft....." + /* 8 */ "uuuuuuu....." + /* 9 */ "............" + /* 10 */ "............" // Level 7 /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" /* 1 */ "............" - /* 2 */ "rrrrrrr....." - /* 3 */ "shhhhhs....." - /* 4 */ ".h...h......" - /* 5 */ ".h...h......" - /* 6 */ ".h...h......" - /* 7 */ "vhhhhhv....." - /* 8 */ "wwwwwwwmmmmm" - /* 9 */ ".......mmmmm" - /* 10 */ ".......mmmmm" + /* 2 */ "............" + /* 3 */ "ppppppp....." + /* 4 */ "qfffffq....." + /* 5 */ ".f...f......" + /* 6 */ "tffffft....." + /* 7 */ "uuuuuuu....." + /* 8 */ "............" + /* 9 */ "............" + /* 10 */ "............" // Level 8 /* z\x* 11 */ @@ -515,32 +654,17 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 0 */ "............" /* 1 */ "............" /* 2 */ "............" - /* 3 */ "rrrrrrr....." - /* 4 */ "shhhhhs....." - /* 5 */ ".h...h......" - /* 6 */ "vhhhhhv....." - /* 7 */ "wwwwwww....." - /* 8 */ ".......mmmmm" - /* 9 */ ".......mmmmm" - /* 10 */ ".......mmmmm" - - // Level 9 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "............" - /* 2 */ "............" /* 3 */ "............" - /* 4 */ "rrrrrrr....." - /* 5 */ "hhhhhhh....." - /* 6 */ "wwwwwww....." + /* 4 */ "ppppppp....." + /* 5 */ "fffffff....." + /* 6 */ "uuuuuuu....." /* 7 */ "............" - /* 8 */ ".......mmmmm" - /* 9 */ ".......mmmmm" - /* 10 */ ".......mmmmm", + /* 8 */ "............" + /* 9 */ "............" + /* 10 */ "............", // Connectors: - "-1: 7, 2, -1: 2\n" /* Type -1, direction Z- */, + "-1: 7, 1, -1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -559,20 +683,484 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Forge + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LampPost: + // The data has been exported from the gallery Plains, area index 28, ID 73, created by STR_Warrior + { + // Size: + 3, 7, 3, // SizeX = 3, SizeY = 7, SizeZ = 3 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 2, 6, 2, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 3: 0\n" /* dirt */ + "b: 43: 0\n" /* doubleslab */ + "c:139: 0\n" /* cobblestonewall */ + "d: 50: 4\n" /* torch */ + "e: 50: 2\n" /* torch */ + "f: 50: 1\n" /* torch */ + "g: 50: 3\n" /* torch */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 012 */ + /* 0 */ "mmm" + /* 1 */ "mam" + /* 2 */ "mmm" + + // Level 1 + /* z\x* 012 */ + /* 0 */ "..." + /* 1 */ ".b." + /* 2 */ "..." + + // Level 2 + /* z\x* 012 */ + /* 0 */ "..." + /* 1 */ ".c." + /* 2 */ "..." + + // Level 3 + /* z\x* 012 */ + /* 0 */ "..." + /* 1 */ ".c." + /* 2 */ "..." + + // Level 4 + /* z\x* 012 */ + /* 0 */ ".d." + /* 1 */ "ebf" + /* 2 */ ".g." + + // Level 5 + /* z\x* 012 */ + /* 0 */ "..." + /* 1 */ "..." + /* 2 */ "..." + + // Level 6 + /* z\x* 012 */ + /* 0 */ "..." + /* 1 */ "..." + /* 2 */ "...", + + // Connectors: + "-1: 1, 1, 2: 3\n" /* Type -1, direction Z+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LampPost + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftCorridor: + // The data has been exported from the gallery Plains, area index 139, ID 447, created by STR_Warrior + { + // Size: + 10, 4, 3, // SizeX = 10, SizeY = 4, SizeZ = 3 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 3, 2, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "b: 85: 0\n" /* fence */ + "c: 50: 2\n" /* torch */ + "d: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "aaaaaaaaaa" + /* 1 */ "aaaaaaaaaa" + /* 2 */ "aaaaaaaaaa" + + // Level 1 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "..b....b.." + /* 1 */ ".........." + /* 2 */ "..b....b.." + + // Level 2 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "..b....b.." + /* 1 */ ".........." + /* 2 */ "..b....b.." + + // Level 3 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ "..a....a.." + /* 1 */ ".cad..cad." + /* 2 */ "..a....a..", + + // Connectors: + "-3: 0, 1, 1: 4\n" /* Type -3, direction X- */ + "3: 0, 1, 1: 4\n" /* Type 3, direction X- */ + "3: 9, 1, 1: 5\n" /* Type 3, direction X+ */ + "-3: 9, 1, 1: 5\n" /* Type -3, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 200, + + // MoveToGround: + false, + }, // MineshaftCorridor + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftCrossing: + // The data has been exported from the gallery Plains, area index 171, ID 578, created by Aloe_vera + { + // Size: + 5, 4, 5, // SizeX = 5, SizeY = 4, SizeZ = 5 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 3, 4, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aaaaa" + /* 2 */ "aaaaa" + /* 3 */ "aaaaa" + /* 4 */ "aaaaa" + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m" + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m" + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m", + + // Connectors: + "3: 4, 1, 2: 5\n" /* Type 3, direction X+ */ + "-3: 4, 1, 2: 5\n" /* Type -3, direction X+ */ + "-3: 2, 1, 4: 3\n" /* Type -3, direction Z+ */ + "3: 2, 1, 4: 3\n" /* Type 3, direction Z+ */ + "3: 0, 1, 2: 4\n" /* Type 3, direction X- */ + "-3: 0, 1, 2: 4\n" /* Type -3, direction X- */ + "3: 2, 1, 0: 2\n" /* Type 3, direction Z- */ + "-3: 2, 1, 0: 2\n" /* Type -3, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 5, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // MineshaftCrossing + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftDoubleCrossing: + // The data has been exported from the gallery Plains, area index 172, ID 579, created by Aloe_vera + { + // Size: + 5, 8, 5, // SizeX = 5, SizeY = 8, SizeZ = 5 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 7, 4, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aaaaa" + /* 2 */ "aaaaa" + /* 3 */ "aaaaa" + /* 4 */ "aaaaa" + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m" + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m" + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m" + + // Level 4 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aa.aa" + /* 2 */ "a...a" + /* 3 */ "aa.aa" + /* 4 */ "aaaaa" + + // Level 5 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m" + + // Level 6 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m" + + // Level 7 + /* z\x* 01234 */ + /* 0 */ "m...m" + /* 1 */ ".a.a." + /* 2 */ "....." + /* 3 */ ".a.a." + /* 4 */ "m...m", + + // Connectors: + "-3: 4, 5, 2: 5\n" /* Type -3, direction X+ */ + "3: 4, 5, 2: 5\n" /* Type 3, direction X+ */ + "-3: 2, 1, 4: 3\n" /* Type -3, direction Z+ */ + "3: 2, 1, 4: 3\n" /* Type 3, direction Z+ */ + "-3: 0, 1, 2: 4\n" /* Type -3, direction X- */ + "3: 0, 1, 2: 4\n" /* Type 3, direction X- */ + "-3: 2, 1, 0: 2\n" /* Type -3, direction Z- */ + "3: 2, 1, 0: 2\n" /* Type 3, direction Z- */ + "-3: 4, 1, 2: 5\n" /* Type -3, direction X+ */ + "3: 4, 1, 2: 5\n" /* Type 3, direction X+ */ + "-3: 2, 5, 4: 3\n" /* Type -3, direction Z+ */ + "3: 2, 5, 4: 3\n" /* Type 3, direction Z+ */ + "-3: 0, 5, 2: 4\n" /* Type -3, direction X- */ + "3: 0, 5, 2: 4\n" /* Type 3, direction X- */ + "-3: 2, 5, 0: 2\n" /* Type -3, direction Z- */ + "3: 2, 5, 0: 2\n" /* Type 3, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 5, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // MineshaftDoubleCrossing + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Scarecrow: + // The data has been exported from the gallery Plains, area index 150, ID 494, created by STR_Warrior + { + // Size: + 1, 6, 3, // SizeX = 1, SizeY = 6, SizeZ = 3 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 0, 5, 2, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:139: 0\n" /* cobblestonewall */ + "b: 85: 0\n" /* fence */ + "c:126: 4\n" /* woodenslab */ + "d: 86: 1\n" /* pumpkin */ + "e:139: 1\n" /* cobblestonewall */ + "f:163: 4\n" /* acaciawoodenstairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0 */ + /* 0 */ "." + /* 1 */ "a" + /* 2 */ "." + + // Level 1 + /* z\x* 0 */ + /* 0 */ "." + /* 1 */ "b" + /* 2 */ "." + + // Level 2 + /* z\x* 0 */ + /* 0 */ "c" + /* 1 */ "d" + /* 2 */ "c" + + // Level 3 + /* z\x* 0 */ + /* 0 */ "." + /* 1 */ "e" + /* 2 */ "." + + // Level 4 + /* z\x* 0 */ + /* 0 */ "f" + /* 1 */ "d" + /* 2 */ "f" + + // Level 5 + /* z\x* 0 */ + /* 0 */ "." + /* 1 */ "f" + /* 2 */ ".", + + // Connectors: + "-1: -1, 0, 1: 4\n" /* Type -1, direction X- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 10, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // Scarecrow + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // SinglePlantBed: // The data has been exported from the gallery Plains, area index 17, ID 60, created by Aloe_vera { // Size: - 10, 3, 7, // SizeX = 10, SizeY = 3, SizeZ = 7 + 10, 7, 7, // SizeX = 10, SizeY = 7, SizeZ = 7 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 9, 2, 6, // MaxX, MaxY, MaxZ + 9, 6, 6, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -615,6 +1203,50 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 3 */ ".........." /* 4 */ ".eeeeeeee." /* 5 */ ".eeeeeeee." + /* 6 */ ".........." + + // Level 3 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".........." + /* 2 */ ".........." + /* 3 */ ".........." + /* 4 */ ".........." + /* 5 */ ".........." + /* 6 */ ".........." + + // Level 4 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".........." + /* 2 */ ".........." + /* 3 */ ".........." + /* 4 */ ".........." + /* 5 */ ".........." + /* 6 */ ".........." + + // Level 5 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".........." + /* 2 */ ".........." + /* 3 */ ".........." + /* 4 */ ".........." + /* 5 */ ".........." + /* 6 */ ".........." + + // Level 6 + /* z\x* */ + /* * 0123456789 */ + /* 0 */ ".........." + /* 1 */ ".........." + /* 2 */ ".........." + /* 3 */ ".........." + /* 4 */ ".........." + /* 5 */ ".........." /* 6 */ "..........", // Connectors: @@ -637,6 +1269,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // SinglePlantBed @@ -646,182 +1281,180 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 58, ID 109, created by Aloe_vera { // Size: - 7, 16, 13, // SizeX = 7, SizeY = 16, SizeZ = 13 + 7, 15, 13, // SizeX = 7, SizeY = 15, SizeZ = 13 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 7, 15, 13, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 7, 14, 13, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "A: 54: 2\n" /* chest */ - "B: 50: 4\n" /* torch */ - "C: 85: 0\n" /* fence */ - "D:126: 8\n" /* woodenslab */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j: 65: 3\n" /* ladder */ - "k: 53: 3\n" /* woodstairs */ - "l: 53: 7\n" /* woodstairs */ + "A: 85: 0\n" /* fence */ + "B:126: 8\n" /* woodenslab */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h: 65: 3\n" /* ladder */ + "i: 53: 3\n" /* woodstairs */ + "j: 53: 7\n" /* woodstairs */ + "k: 64:12\n" /* wooddoorblock */ + "l:102: 0\n" /* glasspane */ "m: 19: 0\n" /* sponge */ - "n: 64:12\n" /* wooddoorblock */ - "o:102: 0\n" /* glasspane */ - "p: 50: 1\n" /* torch */ - "q: 50: 2\n" /* torch */ - "r:171:14\n" /* carpet */ - "s: 50: 3\n" /* torch */ - "t: 53: 2\n" /* woodstairs */ - "u: 53: 0\n" /* woodstairs */ - "v: 53: 1\n" /* woodstairs */ - "w: 53: 5\n" /* woodstairs */ - "x: 53: 4\n" /* woodstairs */ - "y: 17: 4\n" /* tree */ - "z: 17: 8\n" /* tree */, + "n: 50: 1\n" /* torch */ + "o: 50: 2\n" /* torch */ + "p:171:14\n" /* carpet */ + "q: 50: 3\n" /* torch */ + "r: 53: 2\n" /* woodstairs */ + "s: 53: 0\n" /* woodstairs */ + "t: 53: 1\n" /* woodstairs */ + "u: 53: 5\n" /* woodstairs */ + "v: 53: 4\n" /* woodstairs */ + "w: 17: 4\n" /* tree */ + "x: 17: 8\n" /* tree */ + "y: 54: 2\n" /* chest */ + "z: 50: 4\n" /* torch */, // Block data: // Level 0 /* z\x* 0123456 */ - /* 0 */ "aaaaaaa" - /* 1 */ "aaaaaaa" - /* 2 */ "aaaaaaa" - /* 3 */ "aaaaaaa" - /* 4 */ "aaaaaaa" - /* 5 */ "aaaaaaa" - /* 6 */ "aaaaaaa" - /* 7 */ "aaaaaaa" - /* 8 */ "aaaaaaa" - /* 9 */ "aaaaaaa" - /* 10 */ "aaaaaaa" - /* 11 */ "aaaaaaa" - /* 12 */ "aaaaaaa" + /* 0 */ "mmaaamm" + /* 1 */ "maaaaam" + /* 2 */ "maaaaam" + /* 3 */ "maaaaam" + /* 4 */ "maaaaam" + /* 5 */ "maaaaam" + /* 6 */ "maaaaam" + /* 7 */ "maaaaam" + /* 8 */ "maaaaam" + /* 9 */ "maaaaam" + /* 10 */ "maaaaam" + /* 11 */ "maaaaam" + /* 12 */ "mmmmmmm" // Level 1 /* z\x* 0123456 */ - /* 0 */ "bbaaabb" - /* 1 */ "baaaaab" - /* 2 */ "baaaaab" - /* 3 */ "baaaaab" - /* 4 */ "baaaaab" - /* 5 */ "baaaaab" - /* 6 */ "baaaaab" - /* 7 */ "baaaaab" - /* 8 */ "baaaaab" - /* 9 */ "baaaaab" - /* 10 */ "baaaaab" - /* 11 */ "baaaaab" - /* 12 */ "bbbbbbb" + /* 0 */ "..bcd.." + /* 1 */ ".aaaaa." + /* 2 */ ".aaaaa." + /* 3 */ ".aaaaa." + /* 4 */ ".aaaaa." + /* 5 */ ".aaaaa." + /* 6 */ ".aaaaa." + /* 7 */ ".aaaaa." + /* 8 */ ".aaaaa." + /* 9 */ ".aaaaa." + /* 10 */ ".aaaaa." + /* 11 */ ".aaaaa." + /* 12 */ "......." // Level 2 /* z\x* 0123456 */ - /* 0 */ "..cde.." - /* 1 */ ".fffff." - /* 2 */ ".fffff." - /* 3 */ ".fffff." - /* 4 */ ".fffff." - /* 5 */ ".fffff." - /* 6 */ ".fffff." - /* 7 */ ".fffff." - /* 8 */ ".fffff." - /* 9 */ ".fffff." - /* 10 */ ".fffff." - /* 11 */ ".fffff." + /* 0 */ "......." + /* 1 */ ".efgfe." + /* 2 */ ".f..hf." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ ".ei.ie." + /* 6 */ ".f...f." + /* 7 */ ".fi.if." + /* 8 */ ".f...f." + /* 9 */ ".f.j.f." + /* 10 */ ".f...f." + /* 11 */ ".efffe." /* 12 */ "......." // Level 3 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".ghihg." - /* 2 */ ".h..jh." - /* 3 */ ".h...h." - /* 4 */ ".h...h." - /* 5 */ ".gk.kg." - /* 6 */ ".h...h." - /* 7 */ ".hk.kh." - /* 8 */ ".h...h." - /* 9 */ ".h.l.h." - /* 10 */ ".h...h." - /* 11 */ ".ghhhg." + /* 1 */ ".efkfe." + /* 2 */ ".l..hl." + /* 3 */ ".l...l." + /* 4 */ ".l...l." + /* 5 */ ".e...e." + /* 6 */ ".l...l." + /* 7 */ ".l...l." + /* 8 */ ".fn.of." + /* 9 */ ".l.p.l." + /* 10 */ ".l...l." + /* 11 */ ".ellle." /* 12 */ "......." // Level 4 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".ghnhg." - /* 2 */ ".o..jo." - /* 3 */ ".o...o." - /* 4 */ ".o...o." - /* 5 */ ".g...g." - /* 6 */ ".o...o." - /* 7 */ ".o...o." - /* 8 */ ".hp.qh." - /* 9 */ ".o.r.o." - /* 10 */ ".o...o." - /* 11 */ ".gooog." - /* 12 */ "......." + /* 1 */ ".efffe." + /* 2 */ ".f.qhf." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ "re...er" + /* 6 */ "sf...ft" + /* 7 */ "sf...ft" + /* 8 */ "sf...ft" + /* 9 */ "sf...ft" + /* 10 */ "sf...ft" + /* 11 */ "sefffet" + /* 12 */ "su...vt" // Level 5 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".ghhhg." - /* 2 */ ".h.sjh." - /* 3 */ ".h...h." - /* 4 */ ".h...h." - /* 5 */ "tg...gt" - /* 6 */ "uh...hv" - /* 7 */ "uh...hv" - /* 8 */ "uh...hv" - /* 9 */ "uh...hv" - /* 10 */ "uh...hv" - /* 11 */ "ughhhgv" - /* 12 */ "uw...xv" + /* 1 */ ".ewwwe." + /* 2 */ ".xffhx." + /* 3 */ ".xfffx." + /* 4 */ ".xfffx." + /* 5 */ ".ewwwe." + /* 6 */ ".sf.ft." + /* 7 */ ".sf.ft." + /* 8 */ ".sf.ft." + /* 9 */ ".sf.ft." + /* 10 */ ".sf.ft." + /* 11 */ ".sffft." + /* 12 */ ".su.vt." // Level 6 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".gyyyg." - /* 2 */ ".zhhjz." - /* 3 */ ".zhhhz." - /* 4 */ ".zhhhz." - /* 5 */ ".gyyyg." - /* 6 */ ".uh.hv." - /* 7 */ ".uh.hv." - /* 8 */ ".uh.hv." - /* 9 */ ".uh.hv." - /* 10 */ ".uh.hv." - /* 11 */ ".uhhhv." - /* 12 */ ".uw.xv." + /* 1 */ ".eflfe." + /* 2 */ ".f..hf." + /* 3 */ ".f...f." + /* 4 */ ".f.y.f." + /* 5 */ ".efffe." + /* 6 */ "..sft.." + /* 7 */ "..sft.." + /* 8 */ "..sft.." + /* 9 */ "..sft.." + /* 10 */ "..sft.." + /* 11 */ "..sft.." + /* 12 */ "..sft.." // Level 7 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".ghohg." - /* 2 */ ".h..jh." - /* 3 */ ".h...h." - /* 4 */ ".h.A.h." - /* 5 */ ".ghhhg." - /* 6 */ "..uhv.." - /* 7 */ "..uhv.." - /* 8 */ "..uhv.." - /* 9 */ "..uhv.." - /* 10 */ "..uhv.." - /* 11 */ "..uhv.." - /* 12 */ "..uhv.." + /* 1 */ ".eflfe." + /* 2 */ ".f..hf." + /* 3 */ ".l...l." + /* 4 */ ".f...f." + /* 5 */ ".efffe." + /* 6 */ "......." + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + /* 11 */ "......." + /* 12 */ "......." // Level 8 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".ghohg." - /* 2 */ ".h..jh." - /* 3 */ ".o...o." - /* 4 */ ".h...h." - /* 5 */ ".ghhhg." + /* 1 */ ".eflfe." + /* 2 */ ".f..hf." + /* 3 */ ".f...f." + /* 4 */ ".f.z.f." + /* 5 */ ".efffe." /* 6 */ "......." /* 7 */ "......." /* 8 */ "......." @@ -833,11 +1466,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 9 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".ghohg." - /* 2 */ ".h..jh." - /* 3 */ ".h...h." - /* 4 */ ".h.B.h." - /* 5 */ ".ghhhg." + /* 1 */ ".ewwwe." + /* 2 */ ".xffhx." + /* 3 */ ".xfffx." + /* 4 */ ".xfffx." + /* 5 */ ".ewwwe." /* 6 */ "......." /* 7 */ "......." /* 8 */ "......." @@ -849,11 +1482,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 10 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".gyyyg." - /* 2 */ ".zhhjz." - /* 3 */ ".zhhhz." - /* 4 */ ".zhhhz." - /* 5 */ ".gyyyg." + /* 1 */ ".eAAAe." + /* 2 */ ".A...A." + /* 3 */ ".A...A." + /* 4 */ ".A...A." + /* 5 */ ".eAAAe." /* 6 */ "......." /* 7 */ "......." /* 8 */ "......." @@ -865,11 +1498,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 11 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".gCCCg." - /* 2 */ ".C...C." - /* 3 */ ".C...C." - /* 4 */ ".C...C." - /* 5 */ ".gCCCg." + /* 1 */ ".e...e." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ ".e...e." /* 6 */ "......." /* 7 */ "......." /* 8 */ "......." @@ -880,13 +1513,13 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 12 /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".g...g." - /* 2 */ "......." - /* 3 */ "......." - /* 4 */ "......." - /* 5 */ ".g...g." - /* 6 */ "......." + /* 0 */ "su...vt" + /* 1 */ "sefffet" + /* 2 */ "sfBBBft" + /* 3 */ "sfBBBft" + /* 4 */ "sfBBBft" + /* 5 */ "sefffet" + /* 6 */ "su...vt" /* 7 */ "......." /* 8 */ "......." /* 9 */ "......." @@ -896,13 +1529,13 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 13 /* z\x* 0123456 */ - /* 0 */ "uw...xv" - /* 1 */ "ughhhgv" - /* 2 */ "uhDDDhv" - /* 3 */ "uhDDDhv" - /* 4 */ "uhDDDhv" - /* 5 */ "ughhhgv" - /* 6 */ "uw...xv" + /* 0 */ ".su.vt." + /* 1 */ ".sffft." + /* 2 */ ".sffft." + /* 3 */ ".sffft." + /* 4 */ ".sffft." + /* 5 */ ".sffft." + /* 6 */ ".su.vt." /* 7 */ "......." /* 8 */ "......." /* 9 */ "......." @@ -912,29 +1545,13 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 14 /* z\x* 0123456 */ - /* 0 */ ".uw.xv." - /* 1 */ ".uhhhv." - /* 2 */ ".uhhhv." - /* 3 */ ".uhhhv." - /* 4 */ ".uhhhv." - /* 5 */ ".uhhhv." - /* 6 */ ".uw.xv." - /* 7 */ "......." - /* 8 */ "......." - /* 9 */ "......." - /* 10 */ "......." - /* 11 */ "......." - /* 12 */ "......." - - // Level 15 - /* z\x* 0123456 */ - /* 0 */ "..uhv.." - /* 1 */ "..uhv.." - /* 2 */ "..uhv.." - /* 3 */ "..uhv.." - /* 4 */ "..uhv.." - /* 5 */ "..uhv.." - /* 6 */ "..uhv.." + /* 0 */ "..sft.." + /* 1 */ "..sft.." + /* 2 */ "..sft.." + /* 3 */ "..sft.." + /* 4 */ "..sft.." + /* 5 */ "..sft.." + /* 6 */ "..sft.." /* 7 */ "......." /* 8 */ "......." /* 9 */ "......." @@ -943,7 +1560,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 12 */ ".......", // Connectors: - "-1: 3, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -962,6 +1579,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenChurchMid @@ -971,132 +1591,118 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 54, ID 105, created by Aloe_vera { // Size: - 7, 8, 9, // SizeX = 7, SizeY = 8, SizeZ = 9 + 7, 7, 9, // SizeX = 7, SizeY = 7, SizeZ = 9 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 7, 7, 9, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 7, 6, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c:170: 0\n" /* haybale */ - "d: 67: 0\n" /* stairs */ - "e: 67: 2\n" /* stairs */ - "f: 67: 1\n" /* stairs */ - "g: 4: 0\n" /* cobblestone */ - "h: 17: 0\n" /* tree */ - "i: 5: 0\n" /* wood */ - "j:170: 4\n" /* haybale */ - "k:170: 8\n" /* haybale */ - "l: 54: 2\n" /* chest */ + "a: 4: 0\n" /* cobblestone */ + "b:170: 0\n" /* haybale */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 17: 0\n" /* tree */ + "g: 5: 0\n" /* wood */ + "h:170: 4\n" /* haybale */ + "i:170: 8\n" /* haybale */ + "j: 54: 2\n" /* chest */ + "k: 50: 4\n" /* torch */ + "l: 53: 0\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 50: 4\n" /* torch */ - "o: 53: 0\n" /* woodstairs */ - "p: 53: 5\n" /* woodstairs */ - "q: 53: 4\n" /* woodstairs */ - "r: 53: 1\n" /* woodstairs */, + "n: 53: 5\n" /* woodstairs */ + "o: 53: 4\n" /* woodstairs */ + "p: 53: 1\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 0123456 */ - /* 0 */ "aaaaaaa" - /* 1 */ "aaaaaaa" - /* 2 */ "aaaaaaa" - /* 3 */ "aaaaaaa" - /* 4 */ "aaaaaaa" - /* 5 */ "aaaaaaa" - /* 6 */ "aaaaaaa" - /* 7 */ "aaaaaaa" - /* 8 */ "aaaaaaa" + /* 0 */ "maaaaam" + /* 1 */ "maaaaam" + /* 2 */ "maaaaam" + /* 3 */ "maaaaam" + /* 4 */ "maaaaam" + /* 5 */ "maaaaam" + /* 6 */ "maaaaam" + /* 7 */ "maaaaam" + /* 8 */ "mmmmmmm" // Level 1 /* z\x* 0123456 */ - /* 0 */ "aaaaaab" - /* 1 */ "baaaaab" - /* 2 */ "baaaaab" - /* 3 */ "baaaaab" - /* 4 */ "baaaaab" - /* 5 */ "baaaaab" - /* 6 */ "baaaaab" - /* 7 */ "baaaaab" - /* 8 */ "bbbbbbb" + /* 0 */ "bcddde." + /* 1 */ ".aaaaa." + /* 2 */ ".aaaaa." + /* 3 */ ".aaaaa." + /* 4 */ ".aaaaa." + /* 5 */ ".aaaaa." + /* 6 */ ".aaaaa." + /* 7 */ ".aaaaa." + /* 8 */ "......." // Level 2 /* z\x* 0123456 */ - /* 0 */ "cdeeef." - /* 1 */ ".ggggg." - /* 2 */ ".ggggg." - /* 3 */ ".ggggg." - /* 4 */ ".ggggg." - /* 5 */ ".ggggg." - /* 6 */ ".ggggg." - /* 7 */ ".ggggg." + /* 0 */ "......." + /* 1 */ ".f..bf." + /* 2 */ ".g...g." + /* 3 */ ".gb.hg." + /* 4 */ ".fihif." + /* 5 */ ".gbbbg." + /* 6 */ ".gijbg." + /* 7 */ ".fgfgf." /* 8 */ "......." // Level 3 /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".h..ch." - /* 2 */ ".i...i." - /* 3 */ ".ic.ji." - /* 4 */ ".hkjkh." - /* 5 */ ".iccci." - /* 6 */ ".iklci." - /* 7 */ ".hihih." + /* 0 */ ".k...k." + /* 1 */ ".f...f." + /* 2 */ ".g...g." + /* 3 */ ".g...g." + /* 4 */ ".fh..f." + /* 5 */ ".ghibg." + /* 6 */ ".ghiig." + /* 7 */ ".fgfgf." /* 8 */ "......." // Level 4 /* z\x* 0123456 */ - /* 0 */ ".n...n." - /* 1 */ ".h...h." - /* 2 */ ".i...i." - /* 3 */ ".i...i." - /* 4 */ ".hj..h." - /* 5 */ ".ijkci." - /* 6 */ ".ijkki." - /* 7 */ ".hihih." - /* 8 */ "......." + /* 0 */ "ln...op" + /* 1 */ "lgggggp" + /* 2 */ "lg...gp" + /* 3 */ "lg...gp" + /* 4 */ "lg...gp" + /* 5 */ "lgbb.gp" + /* 6 */ "lgibigp" + /* 7 */ "lgggggp" + /* 8 */ "ln...op" // Level 5 /* z\x* 0123456 */ - /* 0 */ "op...qr" - /* 1 */ "oiiiiir" - /* 2 */ "oi...ir" - /* 3 */ "oi...ir" - /* 4 */ "oi...ir" - /* 5 */ "oicc.ir" - /* 6 */ "oikckir" - /* 7 */ "oiiiiir" - /* 8 */ "op...qr" + /* 0 */ ".ln.op." + /* 1 */ ".lgggp." + /* 2 */ ".lg.gp." + /* 3 */ ".lg.gp." + /* 4 */ ".lg.gp." + /* 5 */ ".lg.gp." + /* 6 */ ".lg.gp." + /* 7 */ ".lgggp." + /* 8 */ ".ln.op." // Level 6 /* z\x* 0123456 */ - /* 0 */ ".op.qr." - /* 1 */ ".oiiir." - /* 2 */ ".oi.ir." - /* 3 */ ".oi.ir." - /* 4 */ ".oi.ir." - /* 5 */ ".oi.ir." - /* 6 */ ".oi.ir." - /* 7 */ ".oiiir." - /* 8 */ ".op.qr." - - // Level 7 - /* z\x* 0123456 */ - /* 0 */ "..oir.." - /* 1 */ "..oir.." - /* 2 */ "..oir.." - /* 3 */ "..oir.." - /* 4 */ "..oir.." - /* 5 */ "..oir.." - /* 6 */ "..oir.." - /* 7 */ "..oir.." - /* 8 */ "..oir..", + /* 0 */ "..lgp.." + /* 1 */ "..lgp.." + /* 2 */ "..lgp.." + /* 3 */ "..lgp.." + /* 4 */ "..lgp.." + /* 5 */ "..lgp.." + /* 6 */ "..lgp.." + /* 7 */ "..lgp.." + /* 8 */ "..lgp..", // Connectors: - "-1: 3, 2, -1: 2\n" /* Type -1, direction Z- */, + "-1: 3, 1, -1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1115,6 +1721,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenGranary @@ -1124,130 +1733,128 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 47, ID 98, created by Aloe_vera { // Size: - 12, 9, 9, // SizeX = 12, SizeY = 9, SizeZ = 9 + 12, 8, 9, // SizeX = 12, SizeY = 8, SizeZ = 9 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 12, 8, 9, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 12, 7, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j: 64: 5\n" /* wooddoorblock */ - "k: 53: 3\n" /* woodstairs */ - "l: 85: 0\n" /* fence */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h: 64: 5\n" /* wooddoorblock */ + "i: 53: 3\n" /* woodstairs */ + "j: 85: 0\n" /* fence */ + "k: 53: 2\n" /* woodstairs */ + "l: 53: 1\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 53: 2\n" /* woodstairs */ - "o: 53: 1\n" /* woodstairs */ - "p: 53: 0\n" /* woodstairs */ - "q:102: 0\n" /* glasspane */ - "r: 64:12\n" /* wooddoorblock */ - "s: 50: 3\n" /* torch */ - "t: 72: 0\n" /* woodplate */ - "u: 53: 7\n" /* woodstairs */ - "v: 47: 0\n" /* bookshelf */ - "w: 50: 1\n" /* torch */ - "x: 50: 2\n" /* torch */ - "y: 53: 6\n" /* woodstairs */, + "n: 53: 0\n" /* woodstairs */ + "o:102: 0\n" /* glasspane */ + "p: 64:12\n" /* wooddoorblock */ + "q: 50: 3\n" /* torch */ + "r: 72: 0\n" /* woodplate */ + "s: 53: 7\n" /* woodstairs */ + "t: 47: 0\n" /* bookshelf */ + "u: 50: 1\n" /* torch */ + "v: 50: 2\n" /* torch */ + "w: 53: 6\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "aaaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaaa" - /* 8 */ "aaaaaaaaaaaa" + /* 0 */ "mmmmaaaammmm" + /* 1 */ "maaaaaaaaaam" + /* 2 */ "maaaaaaaaaam" + /* 3 */ "maaaaaaaaaam" + /* 4 */ "maaaaaaaaaam" + /* 5 */ "maaaaaaaaaam" + /* 6 */ "maaaaaaaaaam" + /* 7 */ "maaaaaaaaaam" + /* 8 */ "mmmmmmmmmmmm" // Level 1 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "bbbbaaaabbbb" - /* 1 */ "baaaaaaaaaab" - /* 2 */ "baaaaaaaaaab" - /* 3 */ "baaaaaaaaaab" - /* 4 */ "baaaaaaaaaab" - /* 5 */ "baaaaaaaaaab" - /* 6 */ "baaaaaaaaaab" - /* 7 */ "baaaaaaaaaab" - /* 8 */ "bbbbbbbbbbbb" + /* 0 */ "....bccd...." + /* 1 */ ".aaaaaaaaaa." + /* 2 */ ".aaaaaaaaaa." + /* 3 */ ".aaaaaaaaaa." + /* 4 */ ".aaaaaaaaaa." + /* 5 */ ".aaaaaaaaaa." + /* 6 */ ".aaaaaaaaaa." + /* 7 */ ".aaaaaaaaaa." + /* 8 */ "............" // Level 2 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "....cdde...." - /* 1 */ ".ffffffffff." - /* 2 */ ".ffffffffff." - /* 3 */ ".ffffffffff." - /* 4 */ ".ffffffffff." - /* 5 */ ".ffffffffff." - /* 6 */ ".ffffffffff." - /* 7 */ ".ffffffffff." + /* 0 */ "............" + /* 1 */ ".efffghfffe." + /* 2 */ ".f........f." + /* 3 */ ".fi......if." + /* 4 */ ".fj......jf." + /* 5 */ ".fk......kf." + /* 6 */ ".f.ljnljn.f." + /* 7 */ ".effffffffe." /* 8 */ "............" // Level 3 /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ ".ghhhijhhhg." - /* 2 */ ".h........h." - /* 3 */ ".hk......kh." - /* 4 */ ".hl......lh." - /* 5 */ ".hn......nh." - /* 6 */ ".h.olpolp.h." - /* 7 */ ".ghhhhhhhhg." + /* 1 */ ".eoofppfooe." + /* 2 */ ".o..q..q..o." + /* 3 */ ".o........o." + /* 4 */ ".fr......rf." + /* 5 */ ".o........o." + /* 6 */ ".o..r..r..o." + /* 7 */ ".eoofoofooe." /* 8 */ "............" // Level 4 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ ".gqqhrrhqqg." - /* 2 */ ".q..s..s..q." - /* 3 */ ".q........q." - /* 4 */ ".ht......th." - /* 5 */ ".q........q." - /* 6 */ ".q..t..t..q." - /* 7 */ ".gqqhqqhqqg." - /* 8 */ "............" + /* 0 */ "kkkkkkkkkkkk" + /* 1 */ "sffffffffffs" + /* 2 */ ".fttttttttf." + /* 3 */ ".f........f." + /* 4 */ ".fu......vf." + /* 5 */ ".f........f." + /* 6 */ ".fttttttttf." + /* 7 */ "wffffffffffw" + /* 8 */ "iiiiiiiiiiii" // Level 5 /* z\x* 11 */ /* * 012345678901 */ - /* 0 */ "nnnnnnnnnnnn" - /* 1 */ "uhhhhhhhhhhu" - /* 2 */ ".hvvvvvvvvh." - /* 3 */ ".h........h." - /* 4 */ ".hw......xh." - /* 5 */ ".h........h." - /* 6 */ ".hvvvvvvvvh." - /* 7 */ "yhhhhhhhhhhy" - /* 8 */ "kkkkkkkkkkkk" + /* 0 */ "............" + /* 1 */ "kkkkkkkkkkkk" + /* 2 */ "sffffffffffs" + /* 3 */ ".fttttttttf." + /* 4 */ ".f........f." + /* 5 */ ".fttttttttf." + /* 6 */ "wffffffffffw" + /* 7 */ "iiiiiiiiiiii" + /* 8 */ "............" // Level 6 /* z\x* 11 */ /* * 012345678901 */ /* 0 */ "............" - /* 1 */ "nnnnnnnnnnnn" - /* 2 */ "uhhhhhhhhhhu" - /* 3 */ ".hvvvvvvvvh." - /* 4 */ ".h........h." - /* 5 */ ".hvvvvvvvvh." - /* 6 */ "yhhhhhhhhhhy" - /* 7 */ "kkkkkkkkkkkk" + /* 1 */ "............" + /* 2 */ "kkkkkkkkkkkk" + /* 3 */ "sffffffffffs" + /* 4 */ ".f........f." + /* 5 */ "wffffffffffw" + /* 6 */ "iiiiiiiiiiii" + /* 7 */ "............" /* 8 */ "............" // Level 7 @@ -1255,29 +1862,16 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* * 012345678901 */ /* 0 */ "............" /* 1 */ "............" - /* 2 */ "nnnnnnnnnnnn" - /* 3 */ "uhhhhhhhhhhu" - /* 4 */ ".h........h." - /* 5 */ "yhhhhhhhhhhy" - /* 6 */ "kkkkkkkkkkkk" - /* 7 */ "............" - /* 8 */ "............" - - // Level 8 - /* z\x* 11 */ - /* * 012345678901 */ - /* 0 */ "............" - /* 1 */ "............" /* 2 */ "............" - /* 3 */ "nnnnnnnnnnnn" - /* 4 */ "hhhhhhhhhhhh" - /* 5 */ "kkkkkkkkkkkk" + /* 3 */ "kkkkkkkkkkkk" + /* 4 */ "ffffffffffff" + /* 5 */ "iiiiiiiiiiii" /* 6 */ "............" /* 7 */ "............" /* 8 */ "............", // Connectors: - "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1296,6 +1890,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouse10x7Library @@ -1305,115 +1902,103 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 49, ID 100, created by Aloe_vera { // Size: - 7, 8, 7, // SizeX = 7, SizeY = 8, SizeZ = 7 + 7, 7, 7, // SizeX = 7, SizeY = 7, SizeZ = 7 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 7, 7, 7, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 7, 6, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j: 64:12\n" /* wooddoorblock */ - "k:102: 0\n" /* glasspane */ - "l: 53: 2\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h: 64:12\n" /* wooddoorblock */ + "i:102: 0\n" /* glasspane */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 50: 3\n" /* torch */ "m: 19: 0\n" /* sponge */ - "n: 53: 7\n" /* woodstairs */ - "o: 50: 3\n" /* torch */ - "p: 53: 6\n" /* woodstairs */ - "q: 53: 3\n" /* woodstairs */, + "n: 53: 6\n" /* woodstairs */ + "o: 53: 3\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 0123456 */ - /* 0 */ "aaaaaaa" - /* 1 */ "aaaaaaa" - /* 2 */ "aaaaaaa" - /* 3 */ "aaaaaaa" - /* 4 */ "aaaaaaa" - /* 5 */ "aaaaaaa" - /* 6 */ "aaaaaaa" + /* 0 */ "mmaaamm" + /* 1 */ "maaaaam" + /* 2 */ "maaaaam" + /* 3 */ "maaaaam" + /* 4 */ "maaaaam" + /* 5 */ "maaaaam" + /* 6 */ "mmmmmmm" // Level 1 /* z\x* 0123456 */ - /* 0 */ "bbaaabb" - /* 1 */ "baaaaab" - /* 2 */ "baaaaab" - /* 3 */ "baaaaab" - /* 4 */ "baaaaab" - /* 5 */ "baaaaab" - /* 6 */ "bbbbbbb" + /* 0 */ "..bcd.." + /* 1 */ ".aaaaa." + /* 2 */ ".aaaaa." + /* 3 */ ".aaaaa." + /* 4 */ ".aaaaa." + /* 5 */ ".aaaaa." + /* 6 */ "......." // Level 2 /* z\x* 0123456 */ - /* 0 */ "..cde.." - /* 1 */ ".fffff." - /* 2 */ ".fffff." - /* 3 */ ".fffff." - /* 4 */ ".fffff." - /* 5 */ ".fffff." + /* 0 */ "......." + /* 1 */ ".efgfe." + /* 2 */ ".f...f." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ ".efffe." /* 6 */ "......." // Level 3 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ ".ghihg." - /* 2 */ ".h...h." - /* 3 */ ".h...h." - /* 4 */ ".h...h." - /* 5 */ ".ghhhg." + /* 1 */ ".efhfe." + /* 2 */ ".i...i." + /* 3 */ ".i...i." + /* 4 */ ".i...i." + /* 5 */ ".eiiie." /* 6 */ "......." // Level 4 /* z\x* 0123456 */ - /* 0 */ "......." - /* 1 */ ".ghjhg." - /* 2 */ ".k...k." - /* 3 */ ".k...k." - /* 4 */ ".k...k." - /* 5 */ ".gkkkg." - /* 6 */ "......." + /* 0 */ "jjjjjjj" + /* 1 */ "kfffffk" + /* 2 */ ".fl.lf." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ "nfffffn" + /* 6 */ "ooooooo" // Level 5 /* z\x* 0123456 */ - /* 0 */ "lllllll" - /* 1 */ "nhhhhhn" - /* 2 */ ".ho.oh." - /* 3 */ ".h...h." - /* 4 */ ".h...h." - /* 5 */ "phhhhhp" - /* 6 */ "qqqqqqq" + /* 0 */ "......." + /* 1 */ "jjjjjjj" + /* 2 */ "kfffffk" + /* 3 */ ".f...f." + /* 4 */ "nfffffn" + /* 5 */ "ooooooo" + /* 6 */ "......." // Level 6 /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ "lllllll" - /* 2 */ "nhhhhhn" - /* 3 */ ".h...h." - /* 4 */ "phhhhhp" - /* 5 */ "qqqqqqq" - /* 6 */ "......." - - // Level 7 - /* z\x* 0123456 */ - /* 0 */ "......." /* 1 */ "......." - /* 2 */ "lllllll" - /* 3 */ "hhhhhhh" - /* 4 */ "qqqqqqq" + /* 2 */ "jjjjjjj" + /* 3 */ "fffffff" + /* 4 */ "ooooooo" /* 5 */ "......." /* 6 */ ".......", // Connectors: - "-1: 3, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1432,6 +2017,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouse5x5 @@ -1441,115 +2029,103 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 40, ID 91, created by xoft { // Size: - 9, 8, 7, // SizeX = 9, SizeY = 8, SizeZ = 7 + 9, 7, 7, // SizeX = 9, SizeY = 7, SizeZ = 7 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 9, 7, 7, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 9, 6, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j:102: 0\n" /* glasspane */ - "k: 64:12\n" /* wooddoorblock */ - "l: 53: 2\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 50: 3\n" /* torch */ "m: 19: 0\n" /* sponge */ - "n: 53: 7\n" /* woodstairs */ - "o: 50: 3\n" /* torch */ - "p: 53: 6\n" /* woodstairs */ - "q: 53: 3\n" /* woodstairs */, + "n: 53: 6\n" /* woodstairs */ + "o: 53: 3\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 012345678 */ - /* 0 */ "aaaaaaaaa" - /* 1 */ "aaaaaaaaa" - /* 2 */ "aaaaaaaaa" - /* 3 */ "aaaaaaaaa" - /* 4 */ "aaaaaaaaa" - /* 5 */ "aaaaaaaaa" - /* 6 */ "aaaaaaaaa" + /* 0 */ "mmmaaammm" + /* 1 */ "maaaaaaam" + /* 2 */ "maaaaaaam" + /* 3 */ "maaaaaaam" + /* 4 */ "maaaaaaam" + /* 5 */ "maaaaaaam" + /* 6 */ "mmmmmmmmm" // Level 1 /* z\x* 012345678 */ - /* 0 */ "bbbaaabbb" - /* 1 */ "baaaaaaab" - /* 2 */ "baaaaaaab" - /* 3 */ "baaaaaaab" - /* 4 */ "baaaaaaab" - /* 5 */ "baaaaaaab" - /* 6 */ "bbbbbbbbb" + /* 0 */ "...bcd..." + /* 1 */ ".aaaaaaa." + /* 2 */ ".aaaaaaa." + /* 3 */ ".aaaaaaa." + /* 4 */ ".aaaaaaa." + /* 5 */ ".aaaaaaa." + /* 6 */ "........." // Level 2 /* z\x* 012345678 */ - /* 0 */ "...cde..." - /* 1 */ ".fffffff." - /* 2 */ ".fffffff." - /* 3 */ ".fffffff." - /* 4 */ ".fffffff." - /* 5 */ ".fffffff." + /* 0 */ "........." + /* 1 */ ".effgffe." + /* 2 */ ".f.....f." + /* 3 */ ".f.....f." + /* 4 */ ".f.....f." + /* 5 */ ".efffffe." /* 6 */ "........." // Level 3 /* z\x* 012345678 */ /* 0 */ "........." - /* 1 */ ".ghhihhg." + /* 1 */ ".ehfifhe." /* 2 */ ".h.....h." /* 3 */ ".h.....h." /* 4 */ ".h.....h." - /* 5 */ ".ghhhhhg." + /* 5 */ ".ehhfhhe." /* 6 */ "........." // Level 4 /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ ".gjhkhjg." - /* 2 */ ".j.....j." - /* 3 */ ".j.....j." - /* 4 */ ".j.....j." - /* 5 */ ".gjjhjjg." - /* 6 */ "........." + /* 0 */ "jjjjjjjjj" + /* 1 */ "kefffffek" + /* 2 */ ".f.l.l.f." + /* 3 */ ".f.....f." + /* 4 */ ".f.....f." + /* 5 */ "nefffffen" + /* 6 */ "ooooooooo" // Level 5 /* z\x* 012345678 */ - /* 0 */ "lllllllll" - /* 1 */ "nghhhhhgn" - /* 2 */ ".h.o.o.h." - /* 3 */ ".h.....h." - /* 4 */ ".h.....h." - /* 5 */ "pghhhhhgp" - /* 6 */ "qqqqqqqqq" + /* 0 */ "........." + /* 1 */ "jjjjjjjjj" + /* 2 */ "kfffffffk" + /* 3 */ ".f.....f." + /* 4 */ "nfffffffn" + /* 5 */ "ooooooooo" + /* 6 */ "........." // Level 6 /* z\x* 012345678 */ /* 0 */ "........." - /* 1 */ "lllllllll" - /* 2 */ "nhhhhhhhn" - /* 3 */ ".h.....h." - /* 4 */ "phhhhhhhp" - /* 5 */ "qqqqqqqqq" - /* 6 */ "........." - - // Level 7 - /* z\x* 012345678 */ - /* 0 */ "........." /* 1 */ "........." - /* 2 */ "lllllllll" - /* 3 */ "hhhhhhhhh" - /* 4 */ "qqqqqqqqq" + /* 2 */ "jjjjjjjjj" + /* 3 */ "fffffffff" + /* 4 */ "ooooooooo" /* 5 */ "........." /* 6 */ ".........", // Connectors: - "-1: 4, 2, -1: 2\n" /* Type -1, direction Z- */, + "-1: 4, 1, -1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1568,6 +2144,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouse7x5 @@ -1577,274 +2156,110 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 41, ID 92, created by xoft { // Size: - 11, 8, 7, // SizeX = 11, SizeY = 8, SizeZ = 7 + 11, 7, 7, // SizeX = 11, SizeY = 7, SizeZ = 7 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 11, 7, 7, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 11, 6, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j:102: 0\n" /* glasspane */ - "k: 64:12\n" /* wooddoorblock */ - "l: 53: 2\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 50: 3\n" /* torch */ "m: 19: 0\n" /* sponge */ - "n: 53: 7\n" /* woodstairs */ - "o: 50: 3\n" /* torch */ - "p: 53: 6\n" /* woodstairs */ - "q: 53: 3\n" /* woodstairs */, + "n: 53: 6\n" /* woodstairs */ + "o: 53: 3\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "aaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaa" + /* 0 */ "mmmmaaammmm" + /* 1 */ "maaaaaaaaam" + /* 2 */ "maaaaaaaaam" + /* 3 */ "maaaaaaaaam" + /* 4 */ "maaaaaaaaam" + /* 5 */ "maaaaaaaaam" + /* 6 */ "mmmmmmmmmmm" // Level 1 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "bbbbaaabbbb" - /* 1 */ "baaaaaaaaab" - /* 2 */ "baaaaaaaaab" - /* 3 */ "baaaaaaaaab" - /* 4 */ "baaaaaaaaab" - /* 5 */ "baaaaaaaaab" - /* 6 */ "bbbbbbbbbbb" + /* 0 */ "....bcd...." + /* 1 */ ".aaaaaaaaa." + /* 2 */ ".aaaaaaaaa." + /* 3 */ ".aaaaaaaaa." + /* 4 */ ".aaaaaaaaa." + /* 5 */ ".aaaaaaaaa." + /* 6 */ "..........." // Level 2 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "....cde...." - /* 1 */ ".fffffffff." - /* 2 */ ".fffffffff." - /* 3 */ ".fffffffff." - /* 4 */ ".fffffffff." - /* 5 */ ".fffffffff." + /* 0 */ "..........." + /* 1 */ ".efffgfffe." + /* 2 */ ".f.......f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".efffffffe." /* 6 */ "..........." // Level 3 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ ".ghhhihhhg." + /* 1 */ ".ehhfifhhe." /* 2 */ ".h.......h." /* 3 */ ".h.......h." /* 4 */ ".h.......h." - /* 5 */ ".ghhhhhhhg." + /* 5 */ ".ehhhfhhhe." /* 6 */ "..........." // Level 4 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".gjjhkhjjg." - /* 2 */ ".j.......j." - /* 3 */ ".j.......j." - /* 4 */ ".j.......j." - /* 5 */ ".gjjjhjjjg." - /* 6 */ "..........." + /* 0 */ "jjjjjjjjjjj" + /* 1 */ "kfffffffffk" + /* 2 */ ".f..l.l.ff." + /* 3 */ ".f......ff." + /* 4 */ ".f......ff." + /* 5 */ "nfffffffffn" + /* 6 */ "ooooooooooo" // Level 5 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "lllllllllll" - /* 1 */ "nhhhhhhhhhn" - /* 2 */ ".h..o.o.hh." - /* 3 */ ".h......hh." - /* 4 */ ".h......hh." - /* 5 */ "phhhhhhhhhp" - /* 6 */ "qqqqqqqqqqq" - - // Level 6 - /* z\x* 1 */ - /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ "lllllllllll" - /* 2 */ "nhhhhhhhhhn" - /* 3 */ ".hhhhhhhhh." - /* 4 */ "phhhhhhhhhp" - /* 5 */ "qqqqqqqqqqq" - /* 6 */ "..........." - - // Level 7 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "lllllllllll" - /* 3 */ "hhhhhhhhhhh" - /* 4 */ "qqqqqqqqqqq" - /* 5 */ "..........." - /* 6 */ "...........", - - // Connectors: - "-1: 5, 2, -1: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: - true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // WoodenHouse9x5 - - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // WoodenHouse9x5: - // The data has been exported from the gallery Plains, area index 46, ID 97, created by Aloe_vera - { - // Size: - 11, 8, 7, // SizeX = 11, SizeY = 8, SizeZ = 7 - - // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 11, 7, 7, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j: 53: 3\n" /* woodstairs */ - "k: 85: 0\n" /* fence */ - "l: 53: 2\n" /* woodstairs */ - "m: 19: 0\n" /* sponge */ - "n: 53: 1\n" /* woodstairs */ - "o: 53: 0\n" /* woodstairs */ - "p:102: 0\n" /* glasspane */ - "q: 64:12\n" /* wooddoorblock */ - "r: 50: 3\n" /* torch */ - "s: 72: 0\n" /* woodplate */ - "t: 53: 7\n" /* woodstairs */ - "u: 47: 0\n" /* bookshelf */ - "v: 50: 1\n" /* torch */ - "w: 50: 2\n" /* torch */ - "x: 53: 6\n" /* woodstairs */, - - // Block data: - // Level 0 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "aaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaa" - - // Level 1 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "bbbbaaabbbb" - /* 1 */ "baaaaaaaaab" - /* 2 */ "baaaaaaaaab" - /* 3 */ "baaaaaaaaab" - /* 4 */ "baaaaaaaaab" - /* 5 */ "baaaaaaaaab" - /* 6 */ "bbbbbbbbbbb" - - // Level 2 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "....cde...." - /* 1 */ ".fffffffff." - /* 2 */ ".fffffffff." + /* 1 */ "jjjjjjjjjjj" + /* 2 */ "kfffffffffk" /* 3 */ ".fffffffff." - /* 4 */ ".fffffffff." - /* 5 */ ".fffffffff." + /* 4 */ "nfffffffffn" + /* 5 */ "ooooooooooo" /* 6 */ "..........." - // Level 3 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".ghhhihhhg." - /* 2 */ ".hj.....jh." - /* 3 */ ".hk.....kh." - /* 4 */ ".hl.nko.lh." - /* 5 */ ".ghhhhhhhg." - /* 6 */ "..........." - - // Level 4 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".gpphqhppg." - /* 2 */ ".p..r.r..p." - /* 3 */ ".ps.....sp." - /* 4 */ ".p...s...p." - /* 5 */ ".gppphpppg." - /* 6 */ "..........." - - // Level 5 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "lllllllllll" - /* 1 */ "thhhhhhhhht" - /* 2 */ ".huuuuuuuh." - /* 3 */ ".hv.....wh." - /* 4 */ ".huuuuuuuh." - /* 5 */ "xhhhhhhhhhx" - /* 6 */ "jjjjjjjjjjj" - // Level 6 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ "lllllllllll" - /* 2 */ "thhhhhhhhht" - /* 3 */ ".h.......h." - /* 4 */ "xhhhhhhhhhx" - /* 5 */ "jjjjjjjjjjj" - /* 6 */ "..........." - - // Level 7 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." /* 1 */ "..........." - /* 2 */ "lllllllllll" - /* 3 */ "hhhhhhhhhhh" - /* 4 */ "jjjjjjjjjjj" + /* 2 */ "jjjjjjjjjjj" + /* 3 */ "fffffffffff" + /* 4 */ "ooooooooooo" /* 5 */ "..........." /* 6 */ "...........", // Connectors: - "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 5, 1, -1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1863,6 +2278,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouse9x5 @@ -1893,11 +2311,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = "k: 85: 0\n" /* fence */ "l: 53: 0\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 64: 2\n" /* wooddoorblock */ - "o: 64: 0\n" /* wooddoorblock */ + "n: 64: 6\n" /* wooddoorblock */ + "o: 64: 4\n" /* wooddoorblock */ "p:102: 0\n" /* glasspane */ "q: 72: 0\n" /* woodplate */ - "r: 64: 8\n" /* wooddoorblock */ + "r: 64:12\n" /* wooddoorblock */ "s: 53: 5\n" /* woodstairs */ "t: 53: 4\n" /* woodstairs */ "u: 50: 1\n" /* torch */ @@ -2029,162 +2447,129 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouse9x5Fence /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // WoodenHouse9x7: - // The data has been exported from the gallery Plains, area index 52, ID 103, created by Aloe_vera + // WoodenHouse9x5Library: + // The data has been exported from the gallery Plains, area index 46, ID 97, created by Aloe_vera { // Size: - 11, 9, 9, // SizeX = 11, SizeY = 9, SizeZ = 9 + 11, 7, 7, // SizeX = 11, SizeY = 7, SizeZ = 7 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 11, 8, 9, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 11, 6, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j:102: 0\n" /* glasspane */ - "k: 64:12\n" /* wooddoorblock */ - "l: 53: 2\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h: 53: 3\n" /* woodstairs */ + "i: 85: 0\n" /* fence */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 1\n" /* woodstairs */ + "l: 53: 0\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 53: 7\n" /* woodstairs */ - "o: 50: 3\n" /* torch */ - "p: 50: 4\n" /* torch */ - "q: 53: 6\n" /* woodstairs */ - "r: 53: 3\n" /* woodstairs */, + "n:102: 0\n" /* glasspane */ + "o: 64:12\n" /* wooddoorblock */ + "p: 50: 3\n" /* torch */ + "q: 72: 0\n" /* woodplate */ + "r: 53: 7\n" /* woodstairs */ + "s: 47: 0\n" /* bookshelf */ + "t: 50: 1\n" /* torch */ + "u: 50: 2\n" /* torch */ + "v: 53: 6\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "aaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaa" - /* 8 */ "aaaaaaaaaaa" + /* 0 */ "mmmmaaammmm" + /* 1 */ "maaaaaaaaam" + /* 2 */ "maaaaaaaaam" + /* 3 */ "maaaaaaaaam" + /* 4 */ "maaaaaaaaam" + /* 5 */ "maaaaaaaaam" + /* 6 */ "mmmmmmmmmmm" // Level 1 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "bbbbaaabbbb" - /* 1 */ "baaaaaaaaab" - /* 2 */ "baaaaaaaaab" - /* 3 */ "baaaaaaaaab" - /* 4 */ "baaaaaaaaab" - /* 5 */ "baaaaaaaaab" - /* 6 */ "baaaaaaaaab" - /* 7 */ "baaaaaaaaab" - /* 8 */ "bbbbbbbbbbb" + /* 0 */ "....bcd...." + /* 1 */ ".aaaaaaaaa." + /* 2 */ ".aaaaaaaaa." + /* 3 */ ".aaaaaaaaa." + /* 4 */ ".aaaaaaaaa." + /* 5 */ ".aaaaaaaaa." + /* 6 */ "..........." // Level 2 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "....cde...." - /* 1 */ ".fffffffff." - /* 2 */ ".fffffffff." - /* 3 */ ".fffffffff." - /* 4 */ ".fffffffff." - /* 5 */ ".fffffffff." - /* 6 */ ".fffffffff." - /* 7 */ ".fffffffff." - /* 8 */ "..........." + /* 0 */ "..........." + /* 1 */ ".efffgfffe." + /* 2 */ ".fh.....hf." + /* 3 */ ".fi.....if." + /* 4 */ ".fj.kil.jf." + /* 5 */ ".efffffffe." + /* 6 */ "..........." // Level 3 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ ".ghhhihhhg." - /* 2 */ ".h.......h." - /* 3 */ ".h.......h." - /* 4 */ ".h.......h." - /* 5 */ ".h.......h." - /* 6 */ ".h.......h." - /* 7 */ ".ghhhhhhhg." - /* 8 */ "..........." + /* 1 */ ".ennfofnne." + /* 2 */ ".n..p.p..n." + /* 3 */ ".nq.....qn." + /* 4 */ ".n...q...n." + /* 5 */ ".ennnfnnne." + /* 6 */ "..........." // Level 4 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".gjjhkhjjg." - /* 2 */ ".j.......j." - /* 3 */ ".j.......j." - /* 4 */ ".h.......h." - /* 5 */ ".j.......j." - /* 6 */ ".j.......j." - /* 7 */ ".gjjjhjjjg." - /* 8 */ "..........." + /* 0 */ "jjjjjjjjjjj" + /* 1 */ "rfffffffffr" + /* 2 */ ".fsssssssf." + /* 3 */ ".ft.....uf." + /* 4 */ ".fsssssssf." + /* 5 */ "vfffffffffv" + /* 6 */ "hhhhhhhhhhh" // Level 5 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "lllllllllll" - /* 1 */ "nhhhhhhhhhn" - /* 2 */ ".h..o.o..h." - /* 3 */ ".h.......h." - /* 4 */ ".h.......h." - /* 5 */ ".h.......h." - /* 6 */ ".h...p...h." - /* 7 */ "qhhhhhhhhhq" - /* 8 */ "rrrrrrrrrrr" + /* 0 */ "..........." + /* 1 */ "jjjjjjjjjjj" + /* 2 */ "rfffffffffr" + /* 3 */ ".f.......f." + /* 4 */ "vfffffffffv" + /* 5 */ "hhhhhhhhhhh" + /* 6 */ "..........." // Level 6 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ "lllllllllll" - /* 2 */ "nhhhhhhhhhn" - /* 3 */ ".h.......h." - /* 4 */ ".h.......h." - /* 5 */ ".h.......h." - /* 6 */ "qhhhhhhhhhq" - /* 7 */ "rrrrrrrrrrr" - /* 8 */ "..........." - - // Level 7 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." /* 1 */ "..........." - /* 2 */ "lllllllllll" - /* 3 */ "nhhhhhhhhhn" - /* 4 */ ".h.......h." - /* 5 */ "qhhhhhhhhhq" - /* 6 */ "rrrrrrrrrrr" - /* 7 */ "..........." - /* 8 */ "..........." - - // Level 8 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." - /* 2 */ "..........." - /* 3 */ "lllllllllll" + /* 2 */ "jjjjjjjjjjj" + /* 3 */ "fffffffffff" /* 4 */ "hhhhhhhhhhh" - /* 5 */ "rrrrrrrrrrr" - /* 6 */ "..........." - /* 7 */ "..........." - /* 8 */ "...........", + /* 5 */ "..........." + /* 6 */ "...........", // Connectors: - "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2203,6 +2588,171 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, + }, // WoodenHouse9x5Library + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // WoodenHouse9x7: + // The data has been exported from the gallery Plains, area index 52, ID 103, created by Aloe_vera + { + // Size: + 11, 8, 9, // SizeX = 11, SizeY = 8, SizeZ = 9 + + // Hitbox (relative to bounding box): + -1, -1, 0, // MinX, MinY, MinZ + 11, 7, 9, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 50: 3\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 50: 4\n" /* torch */ + "o: 53: 6\n" /* woodstairs */ + "p: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmaaammmm" + /* 1 */ "maaaaaaaaam" + /* 2 */ "maaaaaaaaam" + /* 3 */ "maaaaaaaaam" + /* 4 */ "maaaaaaaaam" + /* 5 */ "maaaaaaaaam" + /* 6 */ "maaaaaaaaam" + /* 7 */ "maaaaaaaaam" + /* 8 */ "mmmmmmmmmmm" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "....bcd...." + /* 1 */ ".aaaaaaaaa." + /* 2 */ ".aaaaaaaaa." + /* 3 */ ".aaaaaaaaa." + /* 4 */ ".aaaaaaaaa." + /* 5 */ ".aaaaaaaaa." + /* 6 */ ".aaaaaaaaa." + /* 7 */ ".aaaaaaaaa." + /* 8 */ "..........." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".efffgfffe." + /* 2 */ ".f.......f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".f.......f." + /* 6 */ ".f.......f." + /* 7 */ ".efffffffe." + /* 8 */ "..........." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ ".ehhfifhhe." + /* 2 */ ".h.......h." + /* 3 */ ".h.......h." + /* 4 */ ".f.......f." + /* 5 */ ".h.......h." + /* 6 */ ".h.......h." + /* 7 */ ".ehhhfhhhe." + /* 8 */ "..........." + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "jjjjjjjjjjj" + /* 1 */ "kfffffffffk" + /* 2 */ ".f..l.l..f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".f.......f." + /* 6 */ ".f...n...f." + /* 7 */ "offfffffffo" + /* 8 */ "ppppppppppp" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "jjjjjjjjjjj" + /* 2 */ "kfffffffffk" + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".f.......f." + /* 6 */ "offfffffffo" + /* 7 */ "ppppppppppp" + /* 8 */ "..........." + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "jjjjjjjjjjj" + /* 3 */ "kfffffffffk" + /* 4 */ ".f.......f." + /* 5 */ "offfffffffo" + /* 6 */ "ppppppppppp" + /* 7 */ "..........." + /* 8 */ "..........." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "jjjjjjjjjjj" + /* 4 */ "fffffffffff" + /* 5 */ "ppppppppppp" + /* 6 */ "..........." + /* 7 */ "..........." + /* 8 */ "...........", + + // Connectors: + "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, }, // WoodenHouse9x7 @@ -2246,19 +2796,19 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 0 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "aaaaaaaaaaa" - /* 1 */ "aaaaaaaaaab" - /* 2 */ "aaaaaaaaaab" - /* 3 */ "aaaaaaaaaab" - /* 4 */ "aaaaaaaaaab" - /* 5 */ "aaaaaaaaaaa" - /* 6 */ "aaaaaaaaaab" - /* 7 */ "aaaaaaaaaab" - /* 8 */ "abaaaaaaabb" - /* 9 */ "aaaaaaaaabb" - /* 10 */ "aaaaaaaaabb" - /* 11 */ "abaaaaaaaba" - /* 12 */ "abaaaaaaabb" + /* 0 */ "abaaaaabbbb" + /* 1 */ "baaaaaaaaab" + /* 2 */ "baaaaaaaaab" + /* 3 */ "baaaaaaaaab" + /* 4 */ "baaaaaaaaab" + /* 5 */ "baaaaaaaaab" + /* 6 */ "baaaaaaaaab" + /* 7 */ "baaaaaaaaab" + /* 8 */ "bbaaaaaaabb" + /* 9 */ "bbaaaaaaabb" + /* 10 */ "bbaaaaaaabb" + /* 11 */ "bbaaaaaaabb" + /* 12 */ "bbaaaaaaabb" // Level 1 /* z\x* 1 */ @@ -2416,6 +2966,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouse9x7Butcher @@ -2425,126 +2978,124 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 38, ID 87, created by Aloe_vera { // Size: - 11, 9, 9, // SizeX = 11, SizeY = 9, SizeZ = 9 + 11, 8, 9, // SizeX = 11, SizeY = 8, SizeZ = 9 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 11, 8, 9, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 11, 7, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 67: 3\n" /* stairs */ - "h: 17: 0\n" /* tree */ - "i: 5: 0\n" /* wood */ - "j: 64: 7\n" /* wooddoorblock */ - "k:102: 0\n" /* glasspane */ - "l: 64:12\n" /* wooddoorblock */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 67: 3\n" /* stairs */ + "f: 17: 0\n" /* tree */ + "g: 5: 0\n" /* wood */ + "h: 64: 7\n" /* wooddoorblock */ + "i:102: 0\n" /* glasspane */ + "j: 64:12\n" /* wooddoorblock */ + "k: 53: 2\n" /* woodstairs */ + "l: 53: 7\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 53: 2\n" /* woodstairs */ - "o: 53: 7\n" /* woodstairs */ - "p: 17: 4\n" /* tree */ - "q: 17: 8\n" /* tree */ - "r: 50: 3\n" /* torch */ - "s: 50: 4\n" /* torch */ - "t: 53: 6\n" /* woodstairs */ - "u: 53: 3\n" /* woodstairs */, + "n: 17: 4\n" /* tree */ + "o: 17: 8\n" /* tree */ + "p: 50: 3\n" /* torch */ + "q: 50: 4\n" /* torch */ + "r: 53: 6\n" /* woodstairs */ + "s: 53: 3\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "aaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaa" - /* 8 */ "aaaaaaaaaaa" + /* 0 */ "mmmmaaammmm" + /* 1 */ "maaaaaaaaam" + /* 2 */ "maaaaaaaaam" + /* 3 */ "maaaaaaaaam" + /* 4 */ "maaaaaaaaam" + /* 5 */ "maaaaaaaaam" + /* 6 */ "maaaaaaaaam" + /* 7 */ "maaaaaaaaam" + /* 8 */ "mmmmaaammmm" // Level 1 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "bbbbaaabbbb" - /* 1 */ "baaaaaaaaab" - /* 2 */ "baaaaaaaaab" - /* 3 */ "baaaaaaaaab" - /* 4 */ "baaaaaaaaab" - /* 5 */ "baaaaaaaaab" - /* 6 */ "baaaaaaaaab" - /* 7 */ "baaaaaaaaab" - /* 8 */ "bbbbaaabbbb" + /* 0 */ "....bcd...." + /* 1 */ ".aaaaaaaaa." + /* 2 */ ".aaaaaaaaa." + /* 3 */ ".aaaaaaaaa." + /* 4 */ ".aaaaaaaaa." + /* 5 */ ".aaaaaaaaa." + /* 6 */ ".aaaaaaaaa." + /* 7 */ ".aaaaaaaaa." + /* 8 */ "....bed...." // Level 2 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "....cde...." - /* 1 */ ".fffffffff." - /* 2 */ ".fffffffff." - /* 3 */ ".fffffffff." - /* 4 */ ".fffffffff." - /* 5 */ ".fffffffff." - /* 6 */ ".fffffffff." - /* 7 */ ".fffffffff." - /* 8 */ "....cge...." + /* 0 */ "..........." + /* 1 */ ".fggfhfggf." + /* 2 */ ".g.......g." + /* 3 */ ".g.......g." + /* 4 */ ".f.......f." + /* 5 */ ".g.......g." + /* 6 */ ".g.......g." + /* 7 */ ".fggfhfggf." + /* 8 */ "..........." // Level 3 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ ".hiihjhiih." + /* 1 */ ".fiifjfiif." /* 2 */ ".i.......i." /* 3 */ ".i.......i." - /* 4 */ ".h.......h." + /* 4 */ ".f.......f." /* 5 */ ".i.......i." /* 6 */ ".i.......i." - /* 7 */ ".hiihjhiih." + /* 7 */ ".fiifjfiif." /* 8 */ "..........." // Level 4 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".hkkhlhkkh." - /* 2 */ ".k.......k." - /* 3 */ ".k.......k." - /* 4 */ ".h.......h." - /* 5 */ ".k.......k." - /* 6 */ ".k.......k." - /* 7 */ ".hkkhlhkkh." - /* 8 */ "..........." + /* 0 */ "kkkkkkkkkkk" + /* 1 */ "lfnnnnnnnfl" + /* 2 */ ".o..p.p..o." + /* 3 */ ".o.......o." + /* 4 */ ".o.......o." + /* 5 */ ".o.......o." + /* 6 */ ".o..q.q..o." + /* 7 */ "rfnnnnnnnfr" + /* 8 */ "sssssssssss" // Level 5 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "nnnnnnnnnnn" - /* 1 */ "ohpppppppho" - /* 2 */ ".q..r.r..q." - /* 3 */ ".q.......q." - /* 4 */ ".q.......q." - /* 5 */ ".q.......q." - /* 6 */ ".q..s.s..q." - /* 7 */ "thpppppppht" - /* 8 */ "uuuuuuuuuuu" + /* 0 */ "..........." + /* 1 */ "kkkkkkkkkkk" + /* 2 */ "lgggggggggl" + /* 3 */ ".g.......g." + /* 4 */ ".g.......g." + /* 5 */ ".g.......g." + /* 6 */ "rgggggggggr" + /* 7 */ "sssssssssss" + /* 8 */ "..........." // Level 6 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ "nnnnnnnnnnn" - /* 2 */ "oiiiiiiiiio" - /* 3 */ ".i.......i." - /* 4 */ ".i.......i." - /* 5 */ ".i.......i." - /* 6 */ "tiiiiiiiiit" - /* 7 */ "uuuuuuuuuuu" + /* 1 */ "..........." + /* 2 */ "kkkkkkkkkkk" + /* 3 */ "lgggggggggl" + /* 4 */ ".g.......g." + /* 5 */ "rgggggggggr" + /* 6 */ "sssssssssss" + /* 7 */ "..........." /* 8 */ "..........." // Level 7 @@ -2552,29 +3103,16 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* * 01234567890 */ /* 0 */ "..........." /* 1 */ "..........." - /* 2 */ "nnnnnnnnnnn" - /* 3 */ "oiiiiiiiiio" - /* 4 */ ".i.......i." - /* 5 */ "tiiiiiiiiit" - /* 6 */ "uuuuuuuuuuu" - /* 7 */ "..........." - /* 8 */ "..........." - - // Level 8 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ "..........." /* 2 */ "..........." - /* 3 */ "nnnnnnnnnnn" - /* 4 */ "iiiiiiiiiii" - /* 5 */ "uuuuuuuuuuu" + /* 3 */ "kkkkkkkkkkk" + /* 4 */ "ggggggggggg" + /* 5 */ "sssssssssss" /* 6 */ "..........." /* 7 */ "..........." /* 8 */ "...........", // Connectors: - "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2593,6 +3131,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouse9x7DoubleDoor @@ -2602,250 +3143,228 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 39, ID 90, created by STR_Warrior { // Size: - 15, 10, 16, // SizeX = 15, SizeY = 10, SizeZ = 16 + 15, 9, 16, // SizeX = 15, SizeY = 9, SizeZ = 16 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 15, 9, 16, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 15, 8, 16, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "A: 50: 4\n" /* torch */ - "B: 50: 2\n" /* torch */ - "C: 53: 7\n" /* woodstairs */ - "D: 53: 4\n" /* woodstairs */ - "E: 53: 5\n" /* woodstairs */ - "F: 53: 6\n" /* woodstairs */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 43: 0\n" /* doubleslab */ - "h: 17: 0\n" /* tree */ - "i: 5: 0\n" /* wood */ - "j: 64: 7\n" /* wooddoorblock */ - "k: 96: 8\n" /* trapdoor */ - "l: 61: 2\n" /* furnace */ + "A: 53: 7\n" /* woodstairs */ + "B: 53: 4\n" /* woodstairs */ + "C: 53: 5\n" /* woodstairs */ + "D: 53: 6\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 43: 0\n" /* doubleslab */ + "f: 17: 0\n" /* tree */ + "g: 5: 0\n" /* wood */ + "h: 64: 7\n" /* wooddoorblock */ + "i: 96: 8\n" /* trapdoor */ + "j: 61: 2\n" /* furnace */ + "k: 53: 3\n" /* woodstairs */ + "l: 85: 0\n" /* fence */ "m: 19: 0\n" /* sponge */ - "n: 53: 3\n" /* woodstairs */ - "o: 85: 0\n" /* fence */ - "p: 53: 2\n" /* woodstairs */ - "q: 53: 1\n" /* woodstairs */ - "r: 53: 0\n" /* woodstairs */ - "s: 47: 0\n" /* bookshelf */ - "t:102: 0\n" /* glasspane */ - "u: 64:12\n" /* wooddoorblock */ - "v: 72: 0\n" /* woodplate */ - "w: 17: 4\n" /* tree */ - "x: 17: 8\n" /* tree */ - "y: 50: 3\n" /* torch */ - "z: 50: 1\n" /* torch */, + "n: 53: 2\n" /* woodstairs */ + "o: 53: 1\n" /* woodstairs */ + "p: 53: 0\n" /* woodstairs */ + "q: 47: 0\n" /* bookshelf */ + "r:102: 0\n" /* glasspane */ + "s: 64:12\n" /* wooddoorblock */ + "t: 72: 0\n" /* woodplate */ + "u: 17: 4\n" /* tree */ + "v: 17: 8\n" /* tree */ + "w: 50: 3\n" /* torch */ + "x: 50: 1\n" /* torch */ + "y: 50: 4\n" /* torch */ + "z: 50: 2\n" /* torch */, // Block data: // Level 0 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "aaaaaaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaaaaaa" - /* 8 */ "mmmmmmmmaaaaaaa" - /* 9 */ "mmmmmmmmaaaaaaa" - /* 10 */ "mmmmmmmmaaaaaaa" - /* 11 */ "mmmmmmmmaaaaaaa" - /* 12 */ "mmmmmmmmaaaaaaa" - /* 13 */ "mmmmmmmmaaaaaaa" - /* 14 */ "mmmmmmmmaaaaaaa" - /* 15 */ "mmmmmmmmaaaaaaa" + /* 0 */ "mmmmmmaaammmmmm" + /* 1 */ "maaaaaaaaaaaaam" + /* 2 */ "maaaaaaaaaaaaam" + /* 3 */ "maaaaaaaaaaaaam" + /* 4 */ "maaaaaaaaaaaaam" + /* 5 */ "maaaaaaaaaaaaam" + /* 6 */ "maaaaaaaaaaaaam" + /* 7 */ "maaaaaaaaaaaaam" + /* 8 */ "mmmmmmmmaaaaaam" + /* 9 */ "mmmmmmmmaaaaaam" + /* 10 */ "mmmmmmmmaaaaaam" + /* 11 */ "mmmmmmmmaaaaaam" + /* 12 */ "mmmmmmmmaaaaaam" + /* 13 */ "mmmmmmmmaaaaaam" + /* 14 */ "mmmmmmmmaaaaaam" + /* 15 */ "mmmmmmmmmmmmmmm" // Level 1 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "bbbbbbaaabbbbbb" - /* 1 */ "baaaaaaaaaaaaab" - /* 2 */ "baaaaaaaaaaaaab" - /* 3 */ "baaaaaaaaaaaaab" - /* 4 */ "baaaaaaaaaaaaab" - /* 5 */ "baaaaaaaaaaaaab" - /* 6 */ "baaaaaaaaaaaaab" - /* 7 */ "baaaaaaaaaaaaab" - /* 8 */ "mmmmmmmmaaaaaab" - /* 9 */ "mmmmmmmmaaaaaab" - /* 10 */ "mmmmmmmmaaaaaab" - /* 11 */ "mmmmmmmmaaaaaab" - /* 12 */ "mmmmmmmmaaaaaab" - /* 13 */ "mmmmmmmmaaaaaab" - /* 14 */ "mmmmmmmmaaaaaab" - /* 15 */ "mmmmmmmmbbbbbbb" + /* 0 */ "......bcd......" + /* 1 */ ".aaaaaaaaaaaaa." + /* 2 */ ".aeeeeaaaaaaaa." + /* 3 */ ".aeeeeaaaaaaaa." + /* 4 */ ".aaaaaaaaaaaaa." + /* 5 */ ".aaaaaaaaaaaaa." + /* 6 */ ".aaaaaaaaaaaaa." + /* 7 */ ".aaaaaaaaaaaaa." + /* 8 */ "........aaaaaa." + /* 9 */ "mmmmmmm.aaaaaa." + /* 10 */ "mmmmmmm.aaaaaa." + /* 11 */ "mmmmmmm.aaaaaa." + /* 12 */ "mmmmmmm.aaaaaa." + /* 13 */ "mmmmmmm.aaaaaa." + /* 14 */ "mmmmmmm.aaaaaa." + /* 15 */ "mmmmmmm........" // Level 2 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "......cde......" - /* 1 */ ".fffffffffffff." - /* 2 */ ".fggggffffffff." - /* 3 */ ".fggggffffffff." - /* 4 */ ".fffffffffffff." - /* 5 */ ".fffffffffffff." - /* 6 */ ".fffffffffffff." - /* 7 */ "mfffffffffffff." - /* 8 */ "mmmmmmmmffffff." - /* 9 */ "mmmmmmmmffffff." - /* 10 */ "mmmmmmmmffffff." - /* 11 */ "mmmmmmmmffffff." - /* 12 */ "mmmmmmmmffffff." - /* 13 */ "mmmmmmmmffffff." - /* 14 */ "mmmmmmmmffffff." - /* 15 */ "mmmmmmmm......." + /* 0 */ "..............." + /* 1 */ ".fggggfhfggggf." + /* 2 */ ".g...i.......g." + /* 3 */ ".gjeee......kg." + /* 4 */ ".f..........lg." + /* 5 */ ".g..........ng." + /* 6 */ ".g.olp..ol...g." + /* 7 */ ".fggggggfn...f." + /* 8 */ "........g....g." + /* 9 */ "mmmmmmm.gk...g." + /* 10 */ "mmmmmmm.gl..kg." + /* 11 */ "mmmmmmm.gn..lg." + /* 12 */ "mmmmmmm.g...ng." + /* 13 */ "mmmmmmm.gq..qg." + /* 14 */ "mmmmmmm.fggggf." + /* 15 */ "mmmmmmm........" // Level 3 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".hiiiihjhiiiih." - /* 2 */ ".i...k.......i." - /* 3 */ ".ilggg......ni." - /* 4 */ ".h..........oi." - /* 5 */ ".i..........pi." - /* 6 */ ".i.qor..qo...i." - /* 7 */ "mhiiiiiihp...h." - /* 8 */ "mmmmmmmmi....i." - /* 9 */ "mmmmmmmmin...i." - /* 10 */ "mmmmmmmmio..ni." - /* 11 */ "mmmmmmmmip..oi." - /* 12 */ "mmmmmmmmi...pi." - /* 13 */ "mmmmmmmmis..si." - /* 14 */ "mmmmmmmmhiiiih." - /* 15 */ "mmmmmmmm......." + /* 1 */ ".fgrrgfsfgrrgf." + /* 2 */ ".g...........g." + /* 3 */ ".g...........r." + /* 4 */ ".f..........tr." + /* 5 */ ".g...........r." + /* 6 */ ".g..t....t...g." + /* 7 */ ".fgrrrrgf....f." + /* 8 */ "........g....g." + /* 9 */ "mmmmmmm.r....r." + /* 10 */ "mmmmmmm.rt...r." + /* 11 */ "mmmmmmm.r...tr." + /* 12 */ "mmmmmmm.r....r." + /* 13 */ "mmmmmmm.gq..qg." + /* 14 */ "mmmmmmm.fgrrgf." + /* 15 */ "mmmmmmm........" // Level 4 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".hittihuhittih." - /* 2 */ ".i...........i." - /* 3 */ ".i...........t." - /* 4 */ ".h..........vt." - /* 5 */ ".i...........t." - /* 6 */ ".i..v....v...i." - /* 7 */ "mhittttih....h." - /* 8 */ "mmmmmmmmi....i." - /* 9 */ "mmmmmmmmt....t." - /* 10 */ "mmmmmmmmtv...t." - /* 11 */ "mmmmmmmmt...vt." - /* 12 */ "mmmmmmmmt....t." - /* 13 */ "mmmmmmmmis..si." - /* 14 */ "mmmmmmmmhittih." - /* 15 */ "mmmmmmmm......." + /* 1 */ ".fuuuuuuuuuuuf." + /* 2 */ ".v....w.w....v." + /* 3 */ ".v...........v." + /* 4 */ ".vx..........v." + /* 5 */ ".v...........v." + /* 6 */ ".v......y....v." + /* 7 */ ".fuuuuuufx..zv." + /* 8 */ "........v....v." + /* 9 */ "mmmmmmm.v....v." + /* 10 */ "mmmmmmm.v....v." + /* 11 */ "mmmmmmm.v....v." + /* 12 */ "mmmmmmm.v....v." + /* 13 */ "mmmmmmm.v.yy.v." + /* 14 */ "mmmmmmm.fuuuuf." + /* 15 */ "mmmmmmm........" // Level 5 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".hwwwwwwwwwwwh." - /* 2 */ ".x....y.y....x." - /* 3 */ ".x...........x." - /* 4 */ ".xz..........x." - /* 5 */ ".x...........x." - /* 6 */ ".x......A....x." - /* 7 */ "mhwwwwwwhz..Bx." - /* 8 */ "mmmmmmmmx....x." - /* 9 */ "mmmmmmmmx....x." - /* 10 */ "mmmmmmmmx....x." - /* 11 */ "mmmmmmmmx....x." - /* 12 */ "mmmmmmmmx....x." - /* 13 */ "mmmmmmmmx.AA.x." - /* 14 */ "mmmmmmmmhwwwwh." - /* 15 */ "mmmmmmmm......." + /* 0 */ "nnnnnnnnnnnnnno" + /* 1 */ "pgggggggggggggo" + /* 2 */ "pgAAAAAAAAAABgo" + /* 3 */ "pgC.........Bgo" + /* 4 */ "pgC.........Bgo" + /* 5 */ "pgC.........Bgo" + /* 6 */ "pgCDDDDDDD..Bgo" + /* 7 */ "pggggggggC..Bgo" + /* 8 */ "pkkkkkkpgC..Bgo" + /* 9 */ "mmmmmmmpgC..Bgo" + /* 10 */ "mmmmmmmpgC..Bgo" + /* 11 */ "mmmmmmmpgC..Bgo" + /* 12 */ "mmmmmmmpgC..Bgo" + /* 13 */ "mmmmmmmpgCDDBgo" + /* 14 */ "mmmmmmmpggggggo" + /* 15 */ "mmmmmmmpkkkkkkk" // Level 6 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "ppppppppppppppq" - /* 1 */ "riiiiiiiiiiiiiq" - /* 2 */ "riCCCCCCCCCCDiq" - /* 3 */ "riE.........Diq" - /* 4 */ "riE.........Diq" - /* 5 */ "riE.........Diq" - /* 6 */ "riEFFFFFFF..Diq" - /* 7 */ "riiiiiiiiE..Diq" - /* 8 */ "rnnnnnnriE..Diq" - /* 9 */ "mmmmmmmriE..Diq" - /* 10 */ "mmmmmmmriE..Diq" - /* 11 */ "mmmmmmmriE..Diq" - /* 12 */ "mmmmmmmriE..Diq" - /* 13 */ "mmmmmmmriEFFDiq" - /* 14 */ "mmmmmmmriiiiiiq" - /* 15 */ "mmmmmmmrnnnnnnn" + /* 0 */ "..............." + /* 1 */ ".pnnnnnnnnnnno." + /* 2 */ ".pgggggggggggo." + /* 3 */ ".pgggggggggggo." + /* 4 */ ".pgggggggggggo." + /* 5 */ ".pgggggggggggo." + /* 6 */ ".pgggggggggggo." + /* 7 */ ".pkkkkkkkggggo." + /* 8 */ "........pggggo." + /* 9 */ "mmmmmmm.pggggo." + /* 10 */ "mmmmmmm.pggggo." + /* 11 */ "mmmmmmm.pggggo." + /* 12 */ "mmmmmmm.pggggo." + /* 13 */ "mmmmmmm.pggggo." + /* 14 */ "mmmmmmm.kkkkko." + /* 15 */ "mmmmmmm........" // Level 7 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "mmmmmmmmmmmmmmm" - /* 1 */ "mrpppppppppppqm" - /* 2 */ "mriiiiiiiiiiiqm" - /* 3 */ "mriiiiiiiiiiiqm" - /* 4 */ "mriiiiiiiiiiiqm" - /* 5 */ "mriiiiiiiiiiiqm" - /* 6 */ "mriiiiiiiiiiiqm" - /* 7 */ "mrnnnnnnniiiiqm" - /* 8 */ "mmmmmmmmriiiiqm" - /* 9 */ "mmmmmmmmriiiiqm" - /* 10 */ "mmmmmmmmriiiiqm" - /* 11 */ "mmmmmmmmriiiiqm" - /* 12 */ "mmmmmmmmriiiiqm" - /* 13 */ "mmmmmmmmriiiiqm" - /* 14 */ "mmmmmmmmnnnnnqm" - /* 15 */ "mmmmmmmmmmmmmmm" + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..nnnnnnnnnnn.." + /* 3 */ "..pgggggggggo.." + /* 4 */ "..pgggggggggo.." + /* 5 */ "..pgggggggggo.." + /* 6 */ "..kkkkkkkkggo.." + /* 7 */ ".........pggo.." + /* 8 */ ".........pggo.." + /* 9 */ "mmmmmmm..pggo.." + /* 10 */ "mmmmmmm..pggo.." + /* 11 */ "mmmmmmm..pggo.." + /* 12 */ "mmmmmmm..pggo.." + /* 13 */ "mmmmmmm..kkko.." + /* 14 */ "mmmmmmm........" + /* 15 */ "mmmmmmm........" // Level 8 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "mmmmmmmmmmmmmmm" - /* 1 */ "mmmmmmmmmmmmmmm" - /* 2 */ "mmpppppppppppmm" - /* 3 */ "mmriiiiiiiiiqmm" - /* 4 */ "mmriiiiiiiiiqmm" - /* 5 */ "mmriiiiiiiiiqmm" - /* 6 */ "mmnnnnnnnniiqmm" - /* 7 */ "mmmmmmmmmriiqmm" - /* 8 */ "mmmmmmmmmriiqmm" - /* 9 */ "mmmmmmmmmriiqmm" - /* 10 */ "mmmmmmmmmriiqmm" - /* 11 */ "mmmmmmmmmriiqmm" - /* 12 */ "mmmmmmmmmriiqmm" - /* 13 */ "mmmmmmmmmnnnqmm" - /* 14 */ "mmmmmmmmmmmmmmm" - /* 15 */ "mmmmmmmmmmmmmmm" - - // Level 9 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "mmmmmmmmmmmmmmm" - /* 1 */ "mmmmmmmmmmmmmmm" - /* 2 */ "mmmmmmmmmmmmmmm" - /* 3 */ "mmmrpppppppqmmm" - /* 4 */ "mmmriiiiiiiqmmm" - /* 5 */ "mmmrnnnnnnrqmmm" - /* 6 */ "mmmmmmmmmmrqmmm" - /* 7 */ "mmmmmmmmmmrqmmm" - /* 8 */ "mmmmmmmmmmrqmmm" - /* 9 */ "mmmmmmmmmmrqmmm" - /* 10 */ "mmmmmmmmmmrqmmm" - /* 11 */ "mmmmmmmmmmrqmmm" - /* 12 */ "mmmmmmmmmmrnmmm" - /* 13 */ "mmmmmmmmmmmmmmm" - /* 14 */ "mmmmmmmmmmmmmmm" - /* 15 */ "mmmmmmmmmmmmmmm", + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "...pnnnnnnno..." + /* 4 */ "...pgggggggo..." + /* 5 */ "...pkkkkkkpo..." + /* 6 */ "..........po..." + /* 7 */ "..........po..." + /* 8 */ "..........po..." + /* 9 */ "mmmmmmm...po..." + /* 10 */ "mmmmmmm...po..." + /* 11 */ "mmmmmmm...po..." + /* 12 */ "mmmmmmm...pk..." + /* 13 */ "mmmmmmm........" + /* 14 */ "mmmmmmm........" + /* 15 */ "mmmmmmm........", // Connectors: - "-1: 7, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 7, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -2864,6 +3383,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouseL13x14 @@ -2873,182 +3395,203 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 0, ID 4, created by Aloe_vera { // Size: - 16, 7, 16, // SizeX = 16, SizeY = 7, SizeZ = 16 + 16, 8, 16, // SizeX = 16, SizeY = 8, SizeZ = 16 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 16, 6, 16, // MaxX, MaxY, MaxZ + -1, 1, 0, // MinX, MinY, MinZ + 16, 7, 16, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 67: 0\n" /* stairs */ - "b: 67: 2\n" /* stairs */ - "c: 67: 1\n" /* stairs */ - "d: 4: 0\n" /* cobblestone */ - "e: 5: 0\n" /* wood */ - "f: 67: 3\n" /* stairs */ - "g: 17: 0\n" /* tree */ - "h: 64: 7\n" /* wooddoorblock */ - "i: 64: 5\n" /* wooddoorblock */ - "j:102: 0\n" /* glasspane */ - "k: 64:12\n" /* wooddoorblock */ - "l: 53: 2\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 2: 0\n" /* grass */ + "c: 67: 0\n" /* stairs */ + "d: 67: 2\n" /* stairs */ + "e: 67: 1\n" /* stairs */ + "f: 5: 0\n" /* wood */ + "g: 67: 3\n" /* stairs */ + "h: 17: 0\n" /* tree */ + "i: 64: 7\n" /* wooddoorblock */ + "j: 64: 5\n" /* wooddoorblock */ + "k:102: 0\n" /* glasspane */ + "l: 64:12\n" /* wooddoorblock */ "m: 19: 0\n" /* sponge */ - "n: 53: 1\n" /* woodstairs */ - "o: 53: 7\n" /* woodstairs */ - "p: 53: 6\n" /* woodstairs */ - "q: 53: 3\n" /* woodstairs */ - "r: 53: 0\n" /* woodstairs */ - "s: 53: 5\n" /* woodstairs */ - "t: 53: 4\n" /* woodstairs */ - "u: 50: 3\n" /* torch */ - "v: 50: 2\n" /* torch */ - "w: 50: 4\n" /* torch */ - "x: 50: 1\n" /* torch */, + "n: 53: 2\n" /* woodstairs */ + "o: 53: 1\n" /* woodstairs */ + "p: 53: 7\n" /* woodstairs */ + "q: 53: 6\n" /* woodstairs */ + "r: 53: 3\n" /* woodstairs */ + "s: 53: 0\n" /* woodstairs */ + "t: 53: 5\n" /* woodstairs */ + "u: 53: 4\n" /* woodstairs */ + "v: 50: 3\n" /* torch */ + "w: 50: 2\n" /* torch */ + "x: 50: 4\n" /* torch */ + "y: 50: 1\n" /* torch */, // Block data: // Level 0 /* z\x* 111111 */ /* * 0123456789012345 */ - /* 0 */ "........abc....." - /* 1 */ ".dddddddddddddd." - /* 2 */ ".deeeeeeeeeeeed." - /* 3 */ ".deeeeeeeeeeeed." - /* 4 */ ".deeeeeeeeeeeed." - /* 5 */ ".deeeeeeeeeeeed." - /* 6 */ ".deeeeeeeeeeeed." - /* 7 */ ".ddddddddeeeeed." - /* 8 */ "mmmmmafcdeeeeed." - /* 9 */ "mmmmmmmmdeeeeed." - /* 10 */ "mmmmmmmmdeeeeed." - /* 11 */ "mmmmmmmmdeeeeed." - /* 12 */ "mmmmmmmmdeeeeed." - /* 13 */ "mmmmmmmmdeeeeed." - /* 14 */ "mmmmmmmmddddddd." - /* 15 */ "mmmmmmmm........" + /* 0 */ "mmmmmmmmaaammmmm" + /* 1 */ "maaaaaaaaaaaaaam" + /* 2 */ "maaaaaaaaaaaaaam" + /* 3 */ "maaaaaaaaaaaaaam" + /* 4 */ "maaaaaaaaaaaaaam" + /* 5 */ "maaaaaaaaaaaaaam" + /* 6 */ "maaaaaaaaaaaaaam" + /* 7 */ "maaaaaaaaaaaaaam" + /* 8 */ "bbbbbaaaaaaaaaam" + /* 9 */ "bbbbbbbbaaaaaaam" + /* 10 */ "bbbbbbbbaaaaaaam" + /* 11 */ "bbbbbbbbaaaaaaam" + /* 12 */ "bbbbbbbbaaaaaaam" + /* 13 */ "bbbbbbbbaaaaaaam" + /* 14 */ "bbbbbbbbaaaaaaam" + /* 15 */ "bbbbbbbbmmmmmmmm" // Level 1 /* z\x* 111111 */ /* * 0123456789012345 */ - /* 0 */ "................" - /* 1 */ ".geeeeeeghgeeeg." - /* 2 */ ".e............e." - /* 3 */ ".e............e." - /* 4 */ ".e............e." - /* 5 */ ".e............e." - /* 6 */ ".e............e." - /* 7 */ ".geeeeieg.....e." - /* 8 */ "mmmmmm.me.....e." - /* 9 */ "mmmmmmmme.....e." - /* 10 */ "mmmmmmmme.....e." - /* 11 */ "mmmmmmmme.....e." - /* 12 */ "mmmmmmmme.....e." - /* 13 */ "mmmmmmmme.....e." - /* 14 */ "mmmmmmmmgeeeeeg." - /* 15 */ "mmmmmmmm........" + /* 0 */ "........cde....." + /* 1 */ ".aaaaaaaaaaaaaa." + /* 2 */ ".affffffffffffa." + /* 3 */ ".affffffffffffa." + /* 4 */ ".affffffffffffa." + /* 5 */ ".affffffffffffa." + /* 6 */ ".affffffffffffa." + /* 7 */ ".aaaaaaaafffffa." + /* 8 */ ".....cgeafffffa." + /* 9 */ "........afffffa." + /* 10 */ "........afffffa." + /* 11 */ "........afffffa." + /* 12 */ "........afffffa." + /* 13 */ "........afffffa." + /* 14 */ "........aaaaaaa." + /* 15 */ "................" // Level 2 /* z\x* 111111 */ /* * 0123456789012345 */ /* 0 */ "................" - /* 1 */ ".gejjejjgkgjjeg." - /* 2 */ ".j............e." - /* 3 */ ".j............j." - /* 4 */ ".j............j." - /* 5 */ ".j............e." - /* 6 */ ".j............j." - /* 7 */ ".gejjekeg.....j." - /* 8 */ "mmmmmm.me.....e." - /* 9 */ "mmmmmmmmj.....j." - /* 10 */ "mmmmmmmmj.....j." - /* 11 */ "mmmmmmmme.....e." - /* 12 */ "mmmmmmmmj.....j." - /* 13 */ "mmmmmmmmj.....j." - /* 14 */ "mmmmmmmmgjjjjjg." - /* 15 */ "mmmmmmmm........" + /* 1 */ ".hffffffhihfffh." + /* 2 */ ".f............f." + /* 3 */ ".f............f." + /* 4 */ ".f............f." + /* 5 */ ".f............f." + /* 6 */ ".f............f." + /* 7 */ ".hffffjfh.....f." + /* 8 */ "........f.....f." + /* 9 */ "........f.....f." + /* 10 */ "........f.....f." + /* 11 */ "........f.....f." + /* 12 */ "........f.....f." + /* 13 */ "........f.....f." + /* 14 */ "........hfffffh." + /* 15 */ "................" // Level 3 /* z\x* 111111 */ /* * 0123456789012345 */ - /* 0 */ "llllllllllllllln" - /* 1 */ "ogeeeeeegegeeegn" - /* 2 */ ".e............en" - /* 3 */ ".e............en" - /* 4 */ ".e............en" - /* 5 */ ".e............en" - /* 6 */ ".e............en" - /* 7 */ "pgeeeeeeg.....en" - /* 8 */ "qqqqqqqre.....en" - /* 9 */ "mmmmmmmre.....en" - /* 10 */ "mmmmmmmre.....en" - /* 11 */ "mmmmmmmre.....en" - /* 12 */ "mmmmmmmre.....en" - /* 13 */ "mmmmmmmre.....en" - /* 14 */ "mmmmmmmrgeeeeegn" - /* 15 */ "mmmmmmmrs.....tn" + /* 0 */ "................" + /* 1 */ ".hfkkfkkhlhkkfh." + /* 2 */ ".k............f." + /* 3 */ ".k............k." + /* 4 */ ".k............k." + /* 5 */ ".k............f." + /* 6 */ ".k............k." + /* 7 */ ".hfkkflfh.....k." + /* 8 */ "........f.....f." + /* 9 */ "........k.....k." + /* 10 */ "........k.....k." + /* 11 */ "........f.....f." + /* 12 */ "........k.....k." + /* 13 */ "........k.....k." + /* 14 */ "........hkkkkkh." + /* 15 */ "................" // Level 4 /* z\x* 111111 */ /* * 0123456789012345 */ - /* 0 */ "................" - /* 1 */ "lllllllllllllll." - /* 2 */ "oeeeeeeeeeeeeen." - /* 3 */ ".e.........u.en." - /* 4 */ ".e..........ven." - /* 5 */ ".e......w....en." - /* 6 */ "peeeeeeeee...en." - /* 7 */ "qqqqqqqqrex..en." - /* 8 */ "mmmmmmmmre...en." - /* 9 */ "mmmmmmmmre...en." - /* 10 */ "mmmmmmmmre...en." - /* 11 */ "mmmmmmmmre...en." - /* 12 */ "mmmmmmmmre...en." - /* 13 */ "mmmmmmmmre...en." - /* 14 */ "mmmmmmmmreeeeen." - /* 15 */ "mmmmmmmmrs...tn." + /* 0 */ "nnnnnnnnnnnnnnno" + /* 1 */ "phffffffhfhfffho" + /* 2 */ ".f............fo" + /* 3 */ ".f............fo" + /* 4 */ ".f............fo" + /* 5 */ ".f............fo" + /* 6 */ ".f............fo" + /* 7 */ "qhffffffh.....fo" + /* 8 */ "rrrrrrrsf.....fo" + /* 9 */ ".......sf.....fo" + /* 10 */ ".......sf.....fo" + /* 11 */ ".......sf.....fo" + /* 12 */ ".......sf.....fo" + /* 13 */ ".......sf.....fo" + /* 14 */ ".......shfffffho" + /* 15 */ ".......st.....uo" // Level 5 /* z\x* 111111 */ /* * 0123456789012345 */ /* 0 */ "................" - /* 1 */ "................" - /* 2 */ "llllllllllllln.." - /* 3 */ "oeeeeeeeeeeeen.." - /* 4 */ ".ex.........en.." - /* 5 */ "peeeeeeeeee.en.." - /* 6 */ "qqqqqqqqqre.en.." - /* 7 */ ".........re.en.." - /* 8 */ "mmmmmmmm.re.en.." - /* 9 */ "mmmmmmmm.re.en.." - /* 10 */ "mmmmmmmm.re.en.." - /* 11 */ "mmmmmmmm.re.en.." - /* 12 */ "mmmmmmmm.re.en.." - /* 13 */ "mmmmmmmm.rewen.." - /* 14 */ "mmmmmmmm.reeen.." - /* 15 */ "mmmmmmmm.rs.tn.." + /* 1 */ "nnnnnnnnnnnnnnn." + /* 2 */ "pfffffffffffffo." + /* 3 */ ".f.........v.fo." + /* 4 */ ".f..........wfo." + /* 5 */ ".f......x....fo." + /* 6 */ "qfffffffff...fo." + /* 7 */ "rrrrrrrrsfy..fo." + /* 8 */ "........sf...fo." + /* 9 */ "........sf...fo." + /* 10 */ "........sf...fo." + /* 11 */ "........sf...fo." + /* 12 */ "........sf...fo." + /* 13 */ "........sf...fo." + /* 14 */ "........sfffffo." + /* 15 */ "........st...uo." // Level 6 /* z\x* 111111 */ /* * 0123456789012345 */ /* 0 */ "................" /* 1 */ "................" + /* 2 */ "nnnnnnnnnnnnno.." + /* 3 */ "pffffffffffffo.." + /* 4 */ ".fy.........fo.." + /* 5 */ "qffffffffff.fo.." + /* 6 */ "rrrrrrrrrsf.fo.." + /* 7 */ ".........sf.fo.." + /* 8 */ ".........sf.fo.." + /* 9 */ ".........sf.fo.." + /* 10 */ ".........sf.fo.." + /* 11 */ ".........sf.fo.." + /* 12 */ ".........sf.fo.." + /* 13 */ ".........sfxfo.." + /* 14 */ ".........sfffo.." + /* 15 */ ".........st.uo.." + + // Level 7 + /* z\x* 111111 */ + /* * 0123456789012345 */ + /* 0 */ "................" + /* 1 */ "................" /* 2 */ "................" - /* 3 */ "lllllllllllll..." - /* 4 */ "eeeeeeeeeeeen..." - /* 5 */ "qqqqqqqqqqren..." - /* 6 */ "..........ren..." - /* 7 */ "..........ren..." - /* 8 */ "mmmmmmmm..ren..." - /* 9 */ "mmmmmmmm..ren..." - /* 10 */ "mmmmmmmm..ren..." - /* 11 */ "mmmmmmmm..ren..." - /* 12 */ "mmmmmmmm..ren..." - /* 13 */ "mmmmmmmm..ren..." - /* 14 */ "mmmmmmmm..ren..." - /* 15 */ "mmmmmmmm..ren...", + /* 3 */ "nnnnnnnnnnnnn..." + /* 4 */ "ffffffffffffo..." + /* 5 */ "rrrrrrrrrrsfo..." + /* 6 */ "..........sfo..." + /* 7 */ "..........sfo..." + /* 8 */ "..........sfo..." + /* 9 */ "..........sfo..." + /* 10 */ "..........sfo..." + /* 11 */ "..........sfo..." + /* 12 */ "..........sfo..." + /* 13 */ "..........sfo..." + /* 14 */ "..........sfo..." + /* 15 */ "..........sfo...", // Connectors: - "-1: 9, 0, 0: 2\n" /* Type -1, direction Z- */, + "-1: 9, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3067,6 +3610,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouseL14x14 @@ -3076,162 +3622,145 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 42, ID 93, created by xoft { // Size: - 11, 8, 11, // SizeX = 11, SizeY = 8, SizeZ = 11 + 11, 7, 11, // SizeX = 11, SizeY = 7, SizeZ = 11 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 11, 7, 11, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 11, 6, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j:102: 0\n" /* glasspane */ - "k: 64:12\n" /* wooddoorblock */ - "l: 53: 2\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 7\n" /* woodstairs */ + "l: 53: 1\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 53: 7\n" /* woodstairs */ - "o: 53: 1\n" /* woodstairs */ - "p: 50: 3\n" /* torch */ - "q: 50: 4\n" /* torch */ - "r: 53: 6\n" /* woodstairs */ - "s: 50: 1\n" /* torch */ - "t: 50: 2\n" /* torch */ - "u: 53: 3\n" /* woodstairs */ - "v: 53: 0\n" /* woodstairs */ - "w: 53: 5\n" /* woodstairs */ - "x: 53: 4\n" /* woodstairs */, + "n: 50: 3\n" /* torch */ + "o: 50: 4\n" /* torch */ + "p: 53: 6\n" /* woodstairs */ + "q: 50: 1\n" /* torch */ + "r: 50: 2\n" /* torch */ + "s: 53: 3\n" /* woodstairs */ + "t: 53: 0\n" /* woodstairs */ + "u: 53: 5\n" /* woodstairs */ + "v: 53: 4\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "aaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaa" - /* 8 */ "aaaaaaaaaaa" - /* 9 */ "aaaaaaaaaaa" - /* 10 */ "aaaaaaaaaaa" + /* 0 */ "mmmmaaammmm" + /* 1 */ "maaaaaaaaam" + /* 2 */ "maaaaaaaaam" + /* 3 */ "maaaaaaaaam" + /* 4 */ "maaaaaaaaam" + /* 5 */ "maaaaaaaaam" + /* 6 */ "mmmmmaaaaam" + /* 7 */ "mmmmmaaaaam" + /* 8 */ "mmmmmaaaaam" + /* 9 */ "mmmmmaaaaam" + /* 10 */ "mmmmmmmmmmm" // Level 1 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "bbbbaaabbbb" - /* 1 */ "baaaaaaaaab" - /* 2 */ "baaaaaaaaab" - /* 3 */ "baaaaaaaaab" - /* 4 */ "baaaaaaaaab" - /* 5 */ "baaaaaaaaab" - /* 6 */ "bbbbbaaaaab" - /* 7 */ "bbbbbaaaaab" - /* 8 */ "bbbbbaaaaab" - /* 9 */ "bbbbbaaaaab" - /* 10 */ "bbbbbbbbbbb" + /* 0 */ "....bcd...." + /* 1 */ ".aaaaaaaaa." + /* 2 */ ".aaaaaaaaa." + /* 3 */ ".aaaaaaaaa." + /* 4 */ ".aaaaaaaaa." + /* 5 */ ".aaaaaaaaa." + /* 6 */ ".....aaaaa." + /* 7 */ ".....aaaaa." + /* 8 */ ".....aaaaa." + /* 9 */ ".....aaaaa." + /* 10 */ "..........." // Level 2 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "....cde...." - /* 1 */ ".fffffffff." - /* 2 */ ".fffffffff." - /* 3 */ ".fffffffff." - /* 4 */ ".fffffffff." - /* 5 */ ".fffffffff." - /* 6 */ ".....fffff." - /* 7 */ "mmmm.fffff." - /* 8 */ "mmmm.fffff." - /* 9 */ "mmmm.fffff." - /* 10 */ "mmmm......." + /* 0 */ "..........." + /* 1 */ ".efffgfffe." + /* 2 */ ".f.......f." + /* 3 */ ".f.......f." + /* 4 */ ".f.......f." + /* 5 */ ".efffe...f." + /* 6 */ ".....f...f." + /* 7 */ ".....f...f." + /* 8 */ ".....f...f." + /* 9 */ ".....efffe." + /* 10 */ "..........." // Level 3 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ ".ghhhihhhg." + /* 1 */ ".ehhfifhhe." /* 2 */ ".h.......h." /* 3 */ ".h.......h." /* 4 */ ".h.......h." - /* 5 */ ".ghhhg...h." + /* 5 */ ".ehhhe...f." /* 6 */ ".....h...h." - /* 7 */ "mmmm.h...h." - /* 8 */ "mmmm.h...h." - /* 9 */ "mmmm.ghhhg." - /* 10 */ "mmmm......." + /* 7 */ ".....h...h." + /* 8 */ ".....h...h." + /* 9 */ ".....ehhhe." + /* 10 */ "..........." // Level 4 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "..........." - /* 1 */ ".gjjhkhjjg." - /* 2 */ ".j.......j." - /* 3 */ ".j.......j." - /* 4 */ ".j.......j." - /* 5 */ ".gjjjg...h." - /* 6 */ ".....j...j." - /* 7 */ "mmmm.j...j." - /* 8 */ "mmmm.j...j." - /* 9 */ "mmmm.gjjjg." - /* 10 */ "mmmm......." + /* 0 */ "jjjjjjjjjjj" + /* 1 */ "kfffffffffl" + /* 2 */ ".f..n.n..fl" + /* 3 */ ".f.......fl" + /* 4 */ ".f...o...fl" + /* 5 */ "pfffffq.rfl" + /* 6 */ "sssssf...fl" + /* 7 */ "....tf...fl" + /* 8 */ "....tf...fl" + /* 9 */ "....tfffffl" + /* 10 */ "....tu...vl" // Level 5 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "lllllllllll" - /* 1 */ "nhhhhhhhhho" - /* 2 */ ".h..p.p..ho" - /* 3 */ ".h.......ho" - /* 4 */ ".h...q...ho" - /* 5 */ "rhhhhhs.tho" - /* 6 */ "uuuuuh...ho" - /* 7 */ "mmmmvh...ho" - /* 8 */ "mmmmvh...ho" - /* 9 */ "mmmmvhhhhho" - /* 10 */ "mmmmvw...xo" + /* 0 */ "..........." + /* 1 */ "jjjjjjjjjl." + /* 2 */ "kffffffffl." + /* 3 */ ".f......fl." + /* 4 */ "pffffff.fl." + /* 5 */ "ssssssf.fl." + /* 6 */ ".....tf.fl." + /* 7 */ ".....tf.fl." + /* 8 */ ".....tf.fl." + /* 9 */ ".....tfffl." + /* 10 */ ".....tu.vl." // Level 6 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." - /* 1 */ "lllllllllo." - /* 2 */ "nhhhhhhhho." - /* 3 */ ".h......ho." - /* 4 */ "rhhhhhh.ho." - /* 5 */ "uuuuuuh.ho." - /* 6 */ ".....vh.ho." - /* 7 */ "mmmm.vh.ho." - /* 8 */ "mmmm.vh.ho." - /* 9 */ "mmmm.vhhho." - /* 10 */ "mmmm.vw.xo." - - // Level 7 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "..........." /* 1 */ "..........." - /* 2 */ "lllllllll.." - /* 3 */ "hhhhhhhho.." - /* 4 */ "uuuuuuvho.." - /* 5 */ "......vho.." - /* 6 */ "......vho.." - /* 7 */ "mmmm..vho.." - /* 8 */ "mmmm..vho.." - /* 9 */ "mmmm..vho.." - /* 10 */ "mmmm..vho..", + /* 2 */ "jjjjjjjjj.." + /* 3 */ "ffffffffl.." + /* 4 */ "sssssstfl.." + /* 5 */ "......tfl.." + /* 6 */ "......tfl.." + /* 7 */ "......tfl.." + /* 8 */ "......tfl.." + /* 9 */ "......tfl.." + /* 10 */ "......tfl..", // Connectors: - "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3250,6 +3779,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouseL9x9 @@ -3259,160 +3791,143 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 43, ID 94, created by xoft { // Size: - 15, 8, 11, // SizeX = 15, SizeY = 8, SizeZ = 11 + 15, 7, 11, // SizeX = 15, SizeY = 7, SizeZ = 11 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 15, 7, 11, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 15, 6, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 64: 7\n" /* wooddoorblock */ - "j:102: 0\n" /* glasspane */ - "k: 64:12\n" /* wooddoorblock */ - "l: 53: 2\n" /* woodstairs */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 64: 7\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j: 53: 2\n" /* woodstairs */ + "k: 53: 0\n" /* woodstairs */ + "l: 53: 1\n" /* woodstairs */ "m: 19: 0\n" /* sponge */ - "n: 53: 0\n" /* woodstairs */ - "o: 53: 1\n" /* woodstairs */ - "p: 50: 3\n" /* torch */ - "q: 50: 4\n" /* torch */ - "r: 50: 2\n" /* torch */ - "s: 50: 1\n" /* torch */ - "t: 53: 3\n" /* woodstairs */ - "u: 53: 5\n" /* woodstairs */ - "v: 53: 4\n" /* woodstairs */, + "n: 50: 3\n" /* torch */ + "o: 50: 4\n" /* torch */ + "p: 50: 2\n" /* torch */ + "q: 50: 1\n" /* torch */ + "r: 53: 3\n" /* woodstairs */ + "s: 53: 5\n" /* woodstairs */ + "t: 53: 4\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "aaaaaaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaaaaaa" - /* 8 */ "aaaaaaaaaaaaaaa" - /* 9 */ "aaaaaaaaaaaaaaa" - /* 10 */ "aaaaaaaaaaaaaaa" + /* 0 */ "mmmmmmaaammmmmm" + /* 1 */ "maaaaaaaaaaaaam" + /* 2 */ "maaaaaaaaaaaaam" + /* 3 */ "maaaaaaaaaaaaam" + /* 4 */ "maaaaaaaaaaaaam" + /* 5 */ "maaaaaaaaaaaaam" + /* 6 */ "maaaaammmaaaaam" + /* 7 */ "maaaaammmaaaaam" + /* 8 */ "maaaaammmaaaaam" + /* 9 */ "maaaaammmaaaaam" + /* 10 */ "mmmmmmmmmmmmmmm" // Level 1 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "bbbbbbaaabbbbbb" - /* 1 */ "baaaaaaaaaaaaab" - /* 2 */ "baaaaaaaaaaaaab" - /* 3 */ "baaaaaaaaaaaaab" - /* 4 */ "baaaaaaaaaaaaab" - /* 5 */ "baaaaaaaaaaaaab" - /* 6 */ "baaaaabbbaaaaab" - /* 7 */ "baaaaabbbaaaaab" - /* 8 */ "baaaaabbbaaaaab" - /* 9 */ "baaaaabbbaaaaab" - /* 10 */ "bbbbbbbbbbbbbbb" + /* 0 */ "......bcd......" + /* 1 */ ".aaaaaaaaaaaaa." + /* 2 */ ".aaaaaaaaaaaaa." + /* 3 */ ".aaaaaaaaaaaaa." + /* 4 */ ".aaaaaaaaaaaaa." + /* 5 */ ".aaaaaaaaaaaaa." + /* 6 */ ".aaaaa...aaaaa." + /* 7 */ ".aaaaa...aaaaa." + /* 8 */ ".aaaaa...aaaaa." + /* 9 */ ".aaaaa...aaaaa." + /* 10 */ "..............." // Level 2 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "......cde......" - /* 1 */ ".fffffffffffff." - /* 2 */ ".fffffffffffff." - /* 3 */ ".fffffffffffff." - /* 4 */ ".fffffffffffff." - /* 5 */ ".fffffffffffff." - /* 6 */ ".fffff...fffff." - /* 7 */ ".fffff...fffff." - /* 8 */ ".fffff...fffff." - /* 9 */ ".fffff...fffff." + /* 0 */ "..............." + /* 1 */ ".efffffgfffffe." + /* 2 */ ".f...........f." + /* 3 */ ".f...........f." + /* 4 */ ".f...........f." + /* 5 */ ".f...efffe...f." + /* 6 */ ".f...f...f...f." + /* 7 */ ".f...f...f...f." + /* 8 */ ".f...f...f...f." + /* 9 */ ".efffe...efffe." /* 10 */ "..............." // Level 3 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".ghhhhhihhhhhg." + /* 1 */ ".ehhhhfifhhhhe." /* 2 */ ".h...........h." /* 3 */ ".h...........h." /* 4 */ ".h...........h." - /* 5 */ ".h...ghhhg...h." + /* 5 */ ".f...ehhhe...f." /* 6 */ ".h...h...h...h." /* 7 */ ".h...h...h...h." /* 8 */ ".h...h...h...h." - /* 9 */ ".ghhhg...ghhhg." + /* 9 */ ".ehhhe...ehhhe." /* 10 */ "..............." // Level 4 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".gjjjjhkhjjjjg." - /* 2 */ ".j...........j." - /* 3 */ ".j...........j." - /* 4 */ ".j...........j." - /* 5 */ ".h...gjjjg...h." - /* 6 */ ".j...j...j...j." - /* 7 */ ".j...j...j...j." - /* 8 */ ".j...j...j...j." - /* 9 */ ".gjjjg...gjjjg." - /* 10 */ "..............." + /* 0 */ "jjjjjjjjjjjjjjj" + /* 1 */ "kfffffffffffffl" + /* 2 */ "kf....n.n....fl" + /* 3 */ "kf...........fl" + /* 4 */ "kf...o...o...fl" + /* 5 */ "kf..pfffffq..fl" + /* 6 */ "kf...frrrf...fl" + /* 7 */ "kf...fl.kf...fl" + /* 8 */ "kf...fl.kf...fl" + /* 9 */ "kfffffl.kfffffl" + /* 10 */ "ks...tl.ks...tl" // Level 5 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "lllllllllllllll" - /* 1 */ "nhhhhhhhhhhhhho" - /* 2 */ "nh....p.p....ho" - /* 3 */ "nh...........ho" - /* 4 */ "nh...q...q...ho" - /* 5 */ "nh..rhhhhhs..ho" - /* 6 */ "nh...httth...ho" - /* 7 */ "nh...ho.nh...ho" - /* 8 */ "nh...ho.nh...ho" - /* 9 */ "nhhhhho.nhhhhho" - /* 10 */ "nu...vo.nu...vo" + /* 0 */ "..............." + /* 1 */ ".jjjjjjjjjjjjl." + /* 2 */ ".kfffffffffffl." + /* 3 */ ".kfffffffffffl." + /* 4 */ ".kfffffffffffl." + /* 5 */ ".kffflrrrrfffl." + /* 6 */ ".kfffl...kfffl." + /* 7 */ ".kfffl...kfffl." + /* 8 */ ".kfffl...kfffl." + /* 9 */ ".kfffl...kfffl." + /* 10 */ ".ks.tl...ks.tl." // Level 6 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".llllllllllllo." - /* 2 */ ".nhhhhhhhhhhho." - /* 3 */ ".nhhhhhhhhhhho." - /* 4 */ ".nhhhhhhhhhhho." - /* 5 */ ".nhhhotttthhho." - /* 6 */ ".nhhho...nhhho." - /* 7 */ ".nhhho...nhhho." - /* 8 */ ".nhhho...nhhho." - /* 9 */ ".nhhho...nhhho." - /* 10 */ ".nu.vo...nu.vo." - - // Level 7 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ "..nllllllllll.." - /* 3 */ "..nhhhhhhhhho.." - /* 4 */ "..nhotttttnho.." - /* 5 */ "..nho.....nho.." - /* 6 */ "..nho.....nho.." - /* 7 */ "..nho.....nho.." - /* 8 */ "..nho.....nho.." - /* 9 */ "..nho.....nho.." - /* 10 */ "..nho.....nho..", + /* 2 */ "..kjjjjjjjjjj.." + /* 3 */ "..kfffffffffl.." + /* 4 */ "..kflrrrrrkfl.." + /* 5 */ "..kfl.....kfl.." + /* 6 */ "..kfl.....kfl.." + /* 7 */ "..kfl.....kfl.." + /* 8 */ "..kfl.....kfl.." + /* 9 */ "..kfl.....kfl.." + /* 10 */ "..kfl.....kfl..", // Connectors: - "-1: 7, 2, 0: 2\n" /* Type -1, direction Z- */, + "-1: 7, 1, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3431,6 +3946,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenHouseU13x9 @@ -3440,262 +3958,260 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 60, ID 111, created by Aloe_vera { // Size: - 9, 18, 13, // SizeX = 9, SizeY = 18, SizeZ = 13 + 9, 17, 13, // SizeX = 9, SizeY = 17, SizeZ = 13 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 8, 17, 12, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 8, 16, 12, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 4: 0\n" /* cobblestone */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 67: 3\n" /* stairs */ - "g: 17: 0\n" /* tree */ - "h: 5: 0\n" /* wood */ - "i: 54: 4\n" /* chest */ - "j:154: 4\n" /* hopper */ - "k: 64: 4\n" /* wooddoorblock */ - "l:102: 0\n" /* glasspane */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 2\n" /* stairs */ + "c: 67: 1\n" /* stairs */ + "d: 67: 3\n" /* stairs */ + "e: 17: 0\n" /* tree */ + "f: 5: 0\n" /* wood */ + "g: 54: 4\n" /* chest */ + "h:154: 4\n" /* hopper */ + "i: 64: 4\n" /* wooddoorblock */ + "j:102: 0\n" /* glasspane */ + "k: 85: 0\n" /* fence */ + "l: 64:12\n" /* wooddoorblock */ "m: 19: 0\n" /* sponge */ - "n: 85: 0\n" /* fence */ - "o: 64:12\n" /* wooddoorblock */ - "p: 50: 2\n" /* torch */ - "q: 35: 0\n" /* wool */ - "r: 17: 4\n" /* tree */ - "s: 17: 8\n" /* tree */ - "t: 53: 2\n" /* woodstairs */ - "u: 53: 7\n" /* woodstairs */ - "v: 53: 6\n" /* woodstairs */ - "w: 53: 3\n" /* woodstairs */, + "n: 50: 2\n" /* torch */ + "o: 35: 0\n" /* wool */ + "p: 17: 4\n" /* tree */ + "q: 17: 8\n" /* tree */ + "r: 53: 2\n" /* woodstairs */ + "s: 53: 7\n" /* woodstairs */ + "t: 53: 6\n" /* woodstairs */ + "u: 53: 3\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 012345678 */ - /* 0 */ "aaaaaaaaa" - /* 1 */ "aaaaaaaaa" - /* 2 */ "aaaaaaaaa" - /* 3 */ "aaaaaaaaa" - /* 4 */ "aaaaaaaaa" - /* 5 */ "aaaaaaaaa" - /* 6 */ "aaaaaaaaa" - /* 7 */ "aaaaaaaaa" - /* 8 */ "aaaaaaaaa" - /* 9 */ "aaaaaaaaa" - /* 10 */ "aaaaaaaaa" - /* 11 */ "aaaaaaaaa" - /* 12 */ "aaaaaaaaa" + /* 0 */ "mmmmmmmmm" + /* 1 */ "mmmmmmmmm" + /* 2 */ "mmmmmmmmm" + /* 3 */ "mmmmmmmmm" + /* 4 */ "maaaaammm" + /* 5 */ "maaaaaamm" + /* 6 */ "maaaaaamm" + /* 7 */ "maaaaaamm" + /* 8 */ "maaaaammm" + /* 9 */ "mmmmmmmmm" + /* 10 */ "mmmmmmmmm" + /* 11 */ "mmmmmmmmm" + /* 12 */ "mmmmmmmmm" // Level 1 /* z\x* 012345678 */ - /* 0 */ "bbbbbbbbb" - /* 1 */ "bbbbbbbbb" - /* 2 */ "bbbbbbbbb" - /* 3 */ "bbbbbbbbb" - /* 4 */ "baaaaabbb" - /* 5 */ "baaaaaabb" - /* 6 */ "baaaaaabb" - /* 7 */ "baaaaaabb" - /* 8 */ "baaaaabbb" - /* 9 */ "bbbbbbbbb" - /* 10 */ "bbbbbbbbb" - /* 11 */ "bbbbbbbbb" - /* 12 */ "bbbbbbbbb" + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ ".aaaaa..." + /* 5 */ ".aaaaab.." + /* 6 */ ".aaaaac.." + /* 7 */ ".aaaaad.." + /* 8 */ ".aaaaa..." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 2 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." /* 3 */ "........." - /* 4 */ ".ccccc..." - /* 5 */ ".cccccd.." - /* 6 */ ".ccccce.." - /* 7 */ ".cccccf.." - /* 8 */ ".ccccc..." + /* 4 */ ".efffe..." + /* 5 */ ".f...f..." + /* 6 */ ".fgh.i..." + /* 7 */ ".f...f..." + /* 8 */ ".efffe..." /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 3 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." /* 3 */ "........." - /* 4 */ ".ghhhg..." - /* 5 */ ".h...h..." - /* 6 */ ".hij.k..." - /* 7 */ ".h...h..." - /* 8 */ ".ghhhg..." + /* 4 */ ".ejjje..." + /* 5 */ ".j...f..." + /* 6 */ ".j.k.l..." + /* 7 */ ".j...f..." + /* 8 */ ".ejjje..." /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 4 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." /* 3 */ "........." - /* 4 */ ".glllg..." - /* 5 */ ".l...h..." - /* 6 */ ".l.n.o..." - /* 7 */ ".l...h..." - /* 8 */ ".glllg..." + /* 4 */ ".efffe..." + /* 5 */ ".f..nf..." + /* 6 */ ".f.k.f..." + /* 7 */ ".f..nf..k" + /* 8 */ ".efffe..o" /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 5 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." /* 3 */ "........." - /* 4 */ ".ghhhg..." - /* 5 */ ".h..ph..." - /* 6 */ ".h.n.h..." - /* 7 */ ".h..ph..n" - /* 8 */ ".ghhhg..q" + /* 4 */ ".epppe..." + /* 5 */ ".q...q..." + /* 6 */ ".q.k.q..." + /* 7 */ ".q...q..k" + /* 8 */ ".epppe..o" /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 6 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." /* 3 */ "........." - /* 4 */ ".grrrg..." - /* 5 */ ".s...s..." - /* 6 */ ".s.n.s..." - /* 7 */ ".s...s..n" - /* 8 */ ".grrrg..q" + /* 4 */ ".efffe..." + /* 5 */ ".f...f..." + /* 6 */ ".f.k.f..k" + /* 7 */ ".f...f..o" + /* 8 */ ".efffe..o" /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 7 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." /* 3 */ "........." - /* 4 */ ".ghhhg..." - /* 5 */ ".h...h..." - /* 6 */ ".h.n.h..n" - /* 7 */ ".h...h..q" - /* 8 */ ".ghhhg..q" + /* 4 */ ".ejjje..." + /* 5 */ ".j...j..." + /* 6 */ ".j.k.j..k" + /* 7 */ ".j...j..o" + /* 8 */ ".ejjje..." /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 8 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." + /* 0 */ "........o" + /* 1 */ "........o" + /* 2 */ "........o" /* 3 */ "........." - /* 4 */ ".glllg..." - /* 5 */ ".l...l..." - /* 6 */ ".l.n.l..n" - /* 7 */ ".l...l..q" - /* 8 */ ".glllg..." + /* 4 */ ".efffe..." + /* 5 */ ".f...f..k" + /* 6 */ ".f.k.f..o" + /* 7 */ ".f...f..o" + /* 8 */ ".efffe..." /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 9 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.q" - /* 1 */ "mmmmmmm.q" - /* 2 */ "mmmmmmm.q" - /* 3 */ "........." - /* 4 */ ".ghhhg..." - /* 5 */ ".h...h..n" - /* 6 */ ".h.n.h..q" - /* 7 */ ".h...h..q" - /* 8 */ ".ghhhg..." + /* 0 */ "........k" + /* 1 */ "........k" + /* 2 */ "........o" + /* 3 */ "........o" + /* 4 */ ".epppe..o" + /* 5 */ ".q...q..k" + /* 6 */ ".q.k.q..o" + /* 7 */ ".q...q..k" + /* 8 */ ".epppe..k" /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 10 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.n" - /* 1 */ "mmmmmmm.n" - /* 2 */ "mmmmmmm.q" - /* 3 */ "........q" - /* 4 */ ".grrrg..q" - /* 5 */ ".s...s..n" - /* 6 */ ".s.n.s..q" - /* 7 */ ".s...s..n" - /* 8 */ ".grrrg..n" - /* 9 */ "........." - /* 10 */ "mmmmmmm.." - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........k" + /* 3 */ "rrrrrrr.k" + /* 4 */ "sfffffs.o" + /* 5 */ ".f...f..o" + /* 6 */ ".f.kppppp" + /* 7 */ ".f...f..o" + /* 8 */ "tffffft.o" + /* 9 */ "uuuuuuu.k" + /* 10 */ "........k" + /* 11 */ "........." + /* 12 */ "........." // Level 11 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.n" - /* 3 */ "ttttttt.n" - /* 4 */ "uhhhhhu.q" - /* 5 */ ".h...h..q" - /* 6 */ ".h.nrrrrr" - /* 7 */ ".h...h..q" - /* 8 */ "vhhhhhv.q" - /* 9 */ "wwwwwww.n" - /* 10 */ "mmmmmmm.n" - /* 11 */ "mmmmmmm.." - /* 12 */ "mmmmmmm.." + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "rrrrrrr.k" + /* 5 */ "sfffffs.k" + /* 6 */ ".f...f..o" + /* 7 */ "tffffft.k" + /* 8 */ "uuuuuuu.o" + /* 9 */ "........o" + /* 10 */ "........o" + /* 11 */ "........k" + /* 12 */ "........k" // Level 12 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "mmmmmmm.." - /* 4 */ "ttttttt.n" - /* 5 */ "uhhhhhu.n" - /* 6 */ ".h...h..q" - /* 7 */ "vhhhhhv.n" - /* 8 */ "wwwwwww.q" - /* 9 */ "mmmmmmm.q" - /* 10 */ "mmmmmmm.q" - /* 11 */ "mmmmmmm.n" - /* 12 */ "mmmmmmm.n" + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........." + /* 5 */ "rrrrrrr.o" + /* 6 */ "fffffff.o" + /* 7 */ "uuuuuuu.k" + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........o" + /* 11 */ "........o" + /* 12 */ "........o" // Level 13 /* z\x* 012345678 */ - /* 0 */ "mmmmmmm.." - /* 1 */ "mmmmmmm.." - /* 2 */ "mmmmmmm.." - /* 3 */ "mmmmmmm.." - /* 4 */ "mmmmmmm.." - /* 5 */ "ttttttt.q" - /* 6 */ "hhhhhhh.q" - /* 7 */ "wwwwwww.n" - /* 8 */ "mmmmmmm.." - /* 9 */ "mmmmmmm.." - /* 10 */ "mmmmmmm.q" - /* 11 */ "mmmmmmm.q" - /* 12 */ "mmmmmmm.q" + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "........." + /* 3 */ "........." + /* 4 */ "........." + /* 5 */ "........o" + /* 6 */ "........k" + /* 7 */ "........." + /* 8 */ "........." + /* 9 */ "........." + /* 10 */ "........." + /* 11 */ "........." + /* 12 */ "........." // Level 14 /* z\x* 012345678 */ @@ -3703,9 +4219,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 1 */ "........." /* 2 */ "........." /* 3 */ "........." - /* 4 */ "........." - /* 5 */ "........q" - /* 6 */ "........n" + /* 4 */ "........o" + /* 5 */ "........o" + /* 6 */ "........k" /* 7 */ "........." /* 8 */ "........." /* 9 */ "........." @@ -3719,9 +4235,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 1 */ "........." /* 2 */ "........." /* 3 */ "........." - /* 4 */ "........q" - /* 5 */ "........q" - /* 6 */ "........n" + /* 4 */ "........o" + /* 5 */ "........k" + /* 6 */ "........." /* 7 */ "........." /* 8 */ "........." /* 9 */ "........." @@ -3735,24 +4251,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 1 */ "........." /* 2 */ "........." /* 3 */ "........." - /* 4 */ "........q" - /* 5 */ "........n" - /* 6 */ "........." - /* 7 */ "........." - /* 8 */ "........." - /* 9 */ "........." - /* 10 */ "........." - /* 11 */ "........." - /* 12 */ "........." - - // Level 17 - /* z\x* 012345678 */ - /* 0 */ "........." - /* 1 */ "........." - /* 2 */ "........." - /* 3 */ "........." - /* 4 */ "........q" - /* 5 */ "........n" + /* 4 */ "........o" + /* 5 */ "........k" /* 6 */ "........." /* 7 */ "........." /* 8 */ "........." @@ -3762,7 +4262,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 12 */ ".........", // Connectors: - "-1: 8, 2, 6: 5\n" /* Type -1, direction X+ */, + "-1: 8, 1, 6: 5\n" /* Type -1, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3781,6 +4281,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenMill5x5 @@ -3790,140 +4293,139 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 55, ID 106, created by Aloe_vera { // Size: - 15, 10, 9, // SizeX = 15, SizeY = 10, SizeZ = 9 + 15, 9, 9, // SizeX = 15, SizeY = 9, SizeZ = 9 // Hitbox (relative to bounding box): - -1, 0, 0, // MinX, MinY, MinZ - 15, 9, 9, // MaxX, MaxY, MaxZ + -1, -1, 0, // MinX, MinY, MinZ + 15, 8, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ - "c: 67: 0\n" /* stairs */ - "d: 67: 2\n" /* stairs */ - "e: 67: 1\n" /* stairs */ - "f: 4: 0\n" /* cobblestone */ - "g: 17: 0\n" /* tree */ - "h:107: 0\n" /* fencegate */ - "i:107: 4\n" /* fencegate */ - "j: 5: 0\n" /* wood */ - "k:107: 6\n" /* fencegate */ - "l: 85: 0\n" /* fence */ + "a: 4: 0\n" /* cobblestone */ + "b: 67: 0\n" /* stairs */ + "c: 67: 2\n" /* stairs */ + "d: 67: 1\n" /* stairs */ + "e: 3: 0\n" /* dirt */ + "f: 17: 0\n" /* tree */ + "g:107: 0\n" /* fencegate */ + "h:107: 4\n" /* fencegate */ + "i: 5: 0\n" /* wood */ + "j:107: 6\n" /* fencegate */ + "k: 85: 0\n" /* fence */ + "l:170: 0\n" /* haybale */ "m: 19: 0\n" /* sponge */ - "n:170: 0\n" /* haybale */ - "o:170: 4\n" /* haybale */ - "p:170: 8\n" /* haybale */ - "q: 50: 1\n" /* torch */ - "r: 50: 2\n" /* torch */ - "s: 53: 2\n" /* woodstairs */ - "t: 53: 7\n" /* woodstairs */ - "u: 53: 6\n" /* woodstairs */ - "v: 53: 3\n" /* woodstairs */, + "n:170: 4\n" /* haybale */ + "o:170: 8\n" /* haybale */ + "p: 50: 1\n" /* torch */ + "q: 50: 2\n" /* torch */ + "r: 53: 2\n" /* woodstairs */ + "s: 53: 7\n" /* woodstairs */ + "t: 53: 6\n" /* woodstairs */ + "u: 53: 3\n" /* woodstairs */, // Block data: // Level 0 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "aaaaaaaaaaaaaaa" - /* 1 */ "aaaaaaaaaaaaaaa" - /* 2 */ "aaaaaaaaaaaaaaa" - /* 3 */ "aaaaaaaaaaaaaaa" - /* 4 */ "aaaaaaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaaaaaa" - /* 7 */ "aaaaaaaaaaaaaaa" - /* 8 */ "aaaaaaaaaaaaaaa" + /* 0 */ "maaaaaaaaaaaaam" + /* 1 */ "maaaaaaaaaaaaam" + /* 2 */ "maaaaaaaaaaaaam" + /* 3 */ "maaaaaaaaaaaaam" + /* 4 */ "maaaaaaaaaaaaam" + /* 5 */ "maaaaaaaaaaaaam" + /* 6 */ "maaaaaaaaaaaaam" + /* 7 */ "maaaaaaaaaaaaam" + /* 8 */ "mmmmmmmmmmmmmmm" // Level 1 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "baaaaaaaaaaaaab" - /* 1 */ "baaaaaaaaaaaaab" - /* 2 */ "baaaaaaaaaaaaab" - /* 3 */ "baaaaaaaaaaaaab" - /* 4 */ "baaaaaaaaaaaaab" - /* 5 */ "baaaaaaaaaaaaab" - /* 6 */ "baaaaaaaaaaaaab" - /* 7 */ "baaaaaaaaaaaaab" - /* 8 */ "bbbbbbbbbbbbbbb" + /* 0 */ ".bcccccccccccd." + /* 1 */ ".aaaaaaaaaaaaa." + /* 2 */ ".aeeeeeeeeeeea." + /* 3 */ ".aeeeeeeeeeeea." + /* 4 */ ".aeeeeeeeeeeea." + /* 5 */ ".aeeeeeeeeeeea." + /* 6 */ ".aeeeeeeeeeeea." + /* 7 */ ".aaaaaaaaaaaaa." + /* 8 */ "..............." // Level 2 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ ".cddddddddddde." - /* 1 */ ".fffffffffffff." - /* 2 */ ".faaaaaaaaaaaf." - /* 3 */ ".faaaaaaaaaaaf." - /* 4 */ ".faaaaaaaaaaaf." - /* 5 */ ".faaaaaaaaaaaf." - /* 6 */ ".faaaaaaaaaaaf." - /* 7 */ ".fffffffffffff." + /* 0 */ "..............." + /* 1 */ ".fghgighgigjgf." + /* 2 */ ".k...k...k...k." + /* 3 */ ".k...k...k...k." + /* 4 */ ".k...k...k...k." + /* 5 */ ".k...k...k...k." + /* 6 */ ".kl..k..nko..k." + /* 7 */ ".fkkkikkkikkkf." /* 8 */ "..............." // Level 3 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".ghihjhihjhkhg." - /* 2 */ ".l...l...l...l." - /* 3 */ ".l...l...l...l." - /* 4 */ ".l...l...l...l." - /* 5 */ ".l...l...l...l." - /* 6 */ ".ln..l..olp..l." - /* 7 */ ".gllljllljlllg." + /* 1 */ ".f...i...i...f." + /* 2 */ "..............." + /* 3 */ "..............." + /* 4 */ "..............." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ ".f...i...i...f." /* 8 */ "..............." // Level 4 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".g...j...j...g." + /* 1 */ ".fp.qip.qip.qf." /* 2 */ "..............." /* 3 */ "..............." /* 4 */ "..............." /* 5 */ "..............." /* 6 */ "..............." - /* 7 */ ".g...j...j...g." + /* 7 */ ".f...i...i...f." /* 8 */ "..............." // Level 5 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ ".gq.rjq.rjq.rg." - /* 2 */ "..............." - /* 3 */ "..............." - /* 4 */ "..............." - /* 5 */ "..............." - /* 6 */ "..............." - /* 7 */ ".g...j...j...g." - /* 8 */ "..............." + /* 0 */ "rrrrrrrrrrrrrrr" + /* 1 */ "siiiiiiiiiiiiis" + /* 2 */ ".i...........i." + /* 3 */ ".i...........i." + /* 4 */ ".i...........i." + /* 5 */ ".i...........i." + /* 6 */ ".i...........i." + /* 7 */ "tiiiiiiiiiiiiit" + /* 8 */ "uuuuuuuuuuuuuuu" // Level 6 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "sssssssssssssss" - /* 1 */ "tjjjjjjjjjjjjjt" - /* 2 */ ".j...........j." - /* 3 */ ".j...........j." - /* 4 */ ".j...........j." - /* 5 */ ".j...........j." - /* 6 */ ".j...........j." - /* 7 */ "ujjjjjjjjjjjjju" - /* 8 */ "vvvvvvvvvvvvvvv" + /* 0 */ "..............." + /* 1 */ "rrrrrrrrrrrrrrr" + /* 2 */ "siiiiiiiiiiiiis" + /* 3 */ ".i...........i." + /* 4 */ ".i...........i." + /* 5 */ ".i...........i." + /* 6 */ "tiiiiiiiiiiiiit" + /* 7 */ "uuuuuuuuuuuuuuu" + /* 8 */ "..............." // Level 7 /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ "sssssssssssssss" - /* 2 */ "tjjjjjjjjjjjjjt" - /* 3 */ ".j...........j." - /* 4 */ ".j...........j." - /* 5 */ ".j...........j." - /* 6 */ "ujjjjjjjjjjjjju" - /* 7 */ "vvvvvvvvvvvvvvv" + /* 1 */ "..............." + /* 2 */ "rrrrrrrrrrrrrrr" + /* 3 */ "siiiiiiiiiiiiis" + /* 4 */ ".i...........i." + /* 5 */ "tiiiiiiiiiiiiit" + /* 6 */ "uuuuuuuuuuuuuuu" + /* 7 */ "..............." /* 8 */ "..............." // Level 8 @@ -3931,29 +4433,16 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* * 012345678901234 */ /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ "sssssssssssssss" - /* 3 */ "tjjjjjjjjjjjjjt" - /* 4 */ ".j...........j." - /* 5 */ "ujjjjjjjjjjjjju" - /* 6 */ "vvvvvvvvvvvvvvv" - /* 7 */ "..............." - /* 8 */ "..............." - - // Level 9 - /* z\x* 11111 */ - /* * 012345678901234 */ - /* 0 */ "..............." - /* 1 */ "..............." /* 2 */ "..............." - /* 3 */ "sssssssssssssss" - /* 4 */ "jjjjjjjjjjjjjjj" - /* 5 */ "vvvvvvvvvvvvvvv" + /* 3 */ "rrrrrrrrrrrrrrr" + /* 4 */ "iiiiiiiiiiiiiii" + /* 5 */ "uuuuuuuuuuuuuuu" /* 6 */ "..............." /* 7 */ "..............." /* 8 */ "...............", // Connectors: - "-1: 7, 2, -1: 2\n" /* Type -1, direction Z- */, + "-1: 7, 1, -1: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3972,6 +4461,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // WoodenStables }; // g_PlainsVillagePrefabs @@ -4109,17 +4601,467 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = true, // DefaultWeight: - 100, + 0, // DepthWeight: "", // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // CobbleWell4x4 + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineEntrance: + // The data has been exported from the gallery Plains, area index 138, ID 446, created by STR_Warrior + { + // Size: + 7, 38, 7, // SizeX = 7, SizeY = 38, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 37, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "b: 77: 2\n" /* stonebutton */ + "c: 66: 6\n" /* tracks */ + "d: 27: 1\n" /* poweredrail */ + "e: 66: 5\n" /* tracks */ + "f: 66: 9\n" /* tracks */ + "g: 66: 2\n" /* tracks */ + "h: 50: 4\n" /* torch */ + "i: 66: 4\n" /* tracks */ + "j: 66: 8\n" /* tracks */ + "k: 66: 3\n" /* tracks */ + "l: 66: 7\n" /* tracks */ + "m: 19: 0\n" /* sponge */ + "n: 50: 2\n" /* torch */ + "o: 2: 0\n" /* grass */ + "p: 53: 2\n" /* woodstairs */ + "q: 77: 1\n" /* stonebutton */ + "r: 27: 0\n" /* poweredrail */ + "s: 53: 7\n" /* woodstairs */ + "t: 53: 6\n" /* woodstairs */ + "u: 53: 3\n" /* woodstairs */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "maaaaam" + /* 1 */ "maaaaam" + /* 2 */ "maaaaam" + /* 3 */ "maaaaam" + /* 4 */ "maaaaam" + /* 5 */ "maaaaam" + /* 6 */ "mmmmmmm" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "mm...mm" + /* 1 */ "mm.abam" + /* 2 */ "mmcddam" + /* 3 */ "mae..am" + /* 4 */ "mmaa.mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "mm...mm" + /* 1 */ "mm.a.mm" + /* 2 */ "mm...mm" + /* 3 */ "ma..aam" + /* 4 */ "mmfgamm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "mm.h.mm" + /* 1 */ "mm.a.mm" + /* 2 */ "mm.aamm" + /* 3 */ "ma..iam" + /* 4 */ "mm..jmm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmaklmm" + /* 3 */ "maa..am" + /* 4 */ "mm...mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmc..mm" + /* 3 */ "mae.nam" + /* 4 */ "mmaa.mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm...mm" + /* 3 */ "ma..aam" + /* 4 */ "mmfgamm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm.aamm" + /* 3 */ "ma..iam" + /* 4 */ "mm..jmm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmaklmm" + /* 3 */ "maa..am" + /* 4 */ "mm...mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmc..mm" + /* 3 */ "mae.nam" + /* 4 */ "mmaa.mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 10 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm...mm" + /* 3 */ "ma..aam" + /* 4 */ "mmfgamm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 11 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm.aamm" + /* 3 */ "ma..iam" + /* 4 */ "mm..jmm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 12 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmaklmm" + /* 3 */ "maa..am" + /* 4 */ "mm...mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 13 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmc..mm" + /* 3 */ "mae.nam" + /* 4 */ "mmaa.mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 14 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm...mm" + /* 3 */ "ma..aam" + /* 4 */ "mmfgamm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 15 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm.aamm" + /* 3 */ "ma..iam" + /* 4 */ "mm..jmm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 16 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmaklmm" + /* 3 */ "maa..am" + /* 4 */ "mm...mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 17 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmc..mm" + /* 3 */ "mae.nam" + /* 4 */ "mmaa.mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 18 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm...mm" + /* 3 */ "ma..aam" + /* 4 */ "mmfgamm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 19 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm.aamm" + /* 3 */ "ma..iam" + /* 4 */ "mm..jmm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 20 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmaklmm" + /* 3 */ "maa..am" + /* 4 */ "mm...mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 21 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmc..mm" + /* 3 */ "mae.nam" + /* 4 */ "mmaa.mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 22 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm...mm" + /* 3 */ "ma..aam" + /* 4 */ "mmfgamm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 23 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm.aamm" + /* 3 */ "ma..iam" + /* 4 */ "mm..jmm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 24 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmaklmm" + /* 3 */ "maa..am" + /* 4 */ "mm...mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 25 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmc..mm" + /* 3 */ "mae.nam" + /* 4 */ "mmaa.mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 26 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm...mm" + /* 3 */ "ma..aam" + /* 4 */ "mmfgamm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 27 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm.aamm" + /* 3 */ "ma..iam" + /* 4 */ "mm..jmm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 28 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmaklmm" + /* 3 */ "maa..am" + /* 4 */ "mm...mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 29 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mmc..mm" + /* 3 */ "mae.nam" + /* 4 */ "mmaa.mm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 30 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmammm" + /* 2 */ "mm...mm" + /* 3 */ "ma..aam" + /* 4 */ "mmfgamm" + /* 5 */ "mmmammm" + /* 6 */ "mmmmmmm" + + // Level 31 + /* z\x* 0123456 */ + /* 0 */ "ooomooo" + /* 1 */ "oaaaaao" + /* 2 */ "oa.aaao" + /* 3 */ "oa..iao" + /* 4 */ "oa..jao" + /* 5 */ "oaaaaao" + /* 6 */ "ooooooo" + + // Level 32 + /* z\x* 0123456 */ + /* 0 */ "...p..." + /* 1 */ ".aqrba." + /* 2 */ "...fl.." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ ".a...a." + /* 6 */ "......." + + // Level 33 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".a...a." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ ".a...a." + /* 6 */ "......." + + // Level 34 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".a...a." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ ".a...a." + /* 6 */ "......." + + // Level 35 + /* z\x* 0123456 */ + /* 0 */ "ppppppp" + /* 1 */ "saaaaas" + /* 2 */ ".a...a." + /* 3 */ ".a...a." + /* 4 */ ".a...a." + /* 5 */ "taaaaat" + /* 6 */ "uuuuuuu" + + // Level 36 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "ppppppp" + /* 2 */ "saaaaas" + /* 3 */ ".aaaaa." + /* 4 */ "taaaaat" + /* 5 */ "uuuuuuu" + /* 6 */ "......." + + // Level 37 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "ppppppp" + /* 3 */ "aaaaaaa" + /* 4 */ "uuuuuuu" + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "2: 6, 32, 3: 5\n" /* Type 2, direction X+ */ + "2: 3, 32, 6: 3\n" /* Type 2, direction Z+ */ + "2: 0, 32, 3: 4\n" /* Type 2, direction X- */ + "2: 3, 32, 0: 2\n" /* Type 2, direction Z- */ + "3: 3, 1, 0: 2\n" /* Type 3, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 1000, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // MineEntrance + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // RoofedWell: // The data has been exported from the gallery Plains, area index 119, ID 271, created by STR_Warrior @@ -4317,13 +5259,16 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = true, // DefaultWeight: - 100, + 0, // DepthWeight: "", // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // RoofedWell }; diff --git a/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp b/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp index 93aa405c2..4f0efdcc6 100644 --- a/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp +++ b/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp @@ -141,6 +141,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Forge @@ -264,6 +267,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House11x7 @@ -363,6 +369,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House5x4 @@ -468,6 +477,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House5x5 @@ -573,6 +585,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House7x5 @@ -683,6 +698,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House8x5 @@ -805,6 +823,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House8x7 @@ -928,6 +949,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House9x7 @@ -1078,6 +1102,9 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // HouseL13x12 @@ -1087,75 +1114,86 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = // The data has been exported from the gallery Desert, area index 34, ID 175, created by Aloe_vera { // Size: - 7, 5, 7, // SizeX = 7, SizeY = 5, SizeZ = 7 + 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 6, 4, 6, // MaxX, MaxY, MaxZ + 6, 5, 6, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "a: 85: 0\n" /* fence */ - "b:171:14\n" /* carpet */ - "c:171:15\n" /* carpet */ - "d:171: 0\n" /* carpet */ - "e: 35:14\n" /* wool */ - "f: 35: 0\n" /* wool */ + "a: 12: 0\n" /* sand */ + "b: 85: 0\n" /* fence */ + "c:171:14\n" /* carpet */ + "d:171:15\n" /* carpet */ + "e:171: 0\n" /* carpet */ + "f: 35:14\n" /* wool */ + "g: 35: 0\n" /* wool */ "m: 19: 0\n" /* sponge */, // Block data: // Level 0 /* z\x* 0123456 */ - /* 0 */ "a.....a" - /* 1 */ "bccdccb" - /* 2 */ "bcdddcb" - /* 3 */ "bcdddcb" - /* 4 */ "bccdccb" - /* 5 */ "a.....a" - /* 6 */ "......." + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaaaaa" + /* 3 */ "aaaaaaa" + /* 4 */ "aaaaaaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" // Level 1 /* z\x* 0123456 */ - /* 0 */ "a.....a" - /* 1 */ "......." - /* 2 */ "......." - /* 3 */ "......." - /* 4 */ "......." - /* 5 */ "a.....a" + /* 0 */ "b.....b" + /* 1 */ "cddeddc" + /* 2 */ "cdeeedc" + /* 3 */ "cdeeedc" + /* 4 */ "cddeddc" + /* 5 */ "b.....b" /* 6 */ "......." // Level 2 /* z\x* 0123456 */ - /* 0 */ "a.....a" + /* 0 */ "b.....b" /* 1 */ "......." /* 2 */ "......." /* 3 */ "......." /* 4 */ "......." - /* 5 */ "a.....a" - /* 6 */ "efefefe" + /* 5 */ "b.....b" + /* 6 */ "......." // Level 3 /* z\x* 0123456 */ - /* 0 */ "efefefe" + /* 0 */ "b.....b" /* 1 */ "......." /* 2 */ "......." /* 3 */ "......." /* 4 */ "......." - /* 5 */ "efefefe" - /* 6 */ "......." + /* 5 */ "b.....b" + /* 6 */ "fgfgfgf" // Level 4 /* z\x* 0123456 */ + /* 0 */ "fgfgfgf" + /* 1 */ "......." + /* 2 */ "......." + /* 3 */ "......." + /* 4 */ "......." + /* 5 */ "fgfgfgf" + /* 6 */ "......." + + // Level 5 + /* z\x* 0123456 */ /* 0 */ "......." - /* 1 */ "efefefe" - /* 2 */ "efefefe" - /* 3 */ "efefefe" - /* 4 */ "efefefe" + /* 1 */ "fgfgfgf" + /* 2 */ "fgfgfgf" + /* 3 */ "fgfgfgf" + /* 4 */ "fgfgfgf" /* 5 */ "......." /* 6 */ ".......", // Connectors: - "-1: 2, -1, 0: 2\n" /* Type -1, direction Z- */, + "-1: 2, 0, 0: 2\n" /* Type -1, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -1167,13 +1205,16 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = true, // DefaultWeight: - 100, + 5, // DepthWeight: "", // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // MarketStall @@ -1300,13 +1341,16 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] = true, // DefaultWeight: - 100, + 20, // DepthWeight: "", // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Marketplace }; // g_SandFlatRoofVillagePrefabs @@ -1496,6 +1540,9 @@ const cPrefab::sDef g_SandFlatRoofVillageStartingPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Well }; diff --git a/src/Generating/Prefabs/SandVillagePrefabs.cpp b/src/Generating/Prefabs/SandVillagePrefabs.cpp index 539f57b9d..a062f8cd4 100644 --- a/src/Generating/Prefabs/SandVillagePrefabs.cpp +++ b/src/Generating/Prefabs/SandVillagePrefabs.cpp @@ -82,6 +82,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // DoubleField @@ -202,6 +205,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House11x7 @@ -345,6 +351,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House11x9 @@ -463,6 +472,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House13x7 @@ -606,6 +618,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House13x9 @@ -749,6 +764,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House15x9 @@ -892,6 +910,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House16x9 @@ -1003,6 +1024,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House7x7 @@ -1115,6 +1139,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // House9x7 @@ -1251,159 +1278,10 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, - }, // House9x9 - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // HouseL14x12: - // The data has been exported from the gallery Desert, area index 7, ID 82, created by Aloe_vera - { - // Size: - 14, 6, 12, // SizeX = 14, SizeY = 6, SizeZ = 12 - - // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 13, 5, 11, // MaxX, MaxY, MaxZ - - // Block definitions: - ".: 0: 0\n" /* air */ - "a:128: 0\n" /* sandstonestairs */ - "b:128: 2\n" /* sandstonestairs */ - "c:128: 1\n" /* sandstonestairs */ - "d: 24: 0\n" /* sandstone */ - "e:128: 3\n" /* sandstonestairs */ - "f: 64: 7\n" /* wooddoorblock */ - "g: 64: 5\n" /* wooddoorblock */ - "h:102: 0\n" /* glasspane */ - "i: 64:12\n" /* wooddoorblock */ - "j:128: 7\n" /* sandstonestairs */ - "k: 50: 3\n" /* torch */ - "l: 50: 4\n" /* torch */ - "m: 19: 0\n" /* sponge */ - "n:128: 6\n" /* sandstonestairs */ - "o:128: 5\n" /* sandstonestairs */ - "p:128: 4\n" /* sandstonestairs */ - "q: 50: 1\n" /* torch */, - - // Block data: - // Level 0 - /* z\x* 1111 */ - /* * 01234567890123 */ - /* 0 */ ".......abc...." - /* 1 */ ".dddddddddddd." - /* 2 */ ".dddddddddddd." - /* 3 */ ".dddddddddddd." - /* 4 */ ".dddddddddddd." - /* 5 */ ".dddddddddddd." - /* 6 */ "....aec.ddddd." - /* 7 */ "mmmmmmm.ddddd." - /* 8 */ "mmmmmmm.ddddd." - /* 9 */ "mmmmmmm.ddddd." - /* 10 */ "mmmmmmm.ddddd." - /* 11 */ "mmmmmmm......." - - // Level 1 - /* z\x* 1111 */ - /* * 01234567890123 */ - /* 0 */ ".............." - /* 1 */ ".dddddddfdddd." - /* 2 */ ".d..........d." - /* 3 */ ".d..........d." - /* 4 */ ".d..........d." - /* 5 */ ".ddddgddd...d." - /* 6 */ "........d...d." - /* 7 */ "mmmmmmm.d...d." - /* 8 */ "mmmmmmm.d...d." - /* 9 */ "mmmmmmm.d...d." - /* 10 */ "mmmmmmm.ddddd." - /* 11 */ "mmmmmmm......." - - // Level 2 - /* z\x* 1111 */ - /* * 01234567890123 */ - /* 0 */ ".............." - /* 1 */ ".dhhdhhdidhhd." - /* 2 */ ".h..........h." - /* 3 */ ".h..........h." - /* 4 */ ".h..........d." - /* 5 */ ".dhhdidhh...h." - /* 6 */ "........h...h." - /* 7 */ "mmmmmmm.d...d." - /* 8 */ "mmmmmmm.h...h." - /* 9 */ "mmmmmmm.h...h." - /* 10 */ "mmmmmmm.dhhhd." - /* 11 */ "mmmmmmm......." - - // Level 3 - /* z\x* 1111 */ - /* * 01234567890123 */ - /* 0 */ "bbbbbbbbbbbbbb" - /* 1 */ "jddddddddddddc" - /* 2 */ ".d.....k.k..dc" - /* 3 */ ".d..........dc" - /* 4 */ ".d..l.l.....dc" - /* 5 */ "ndddddddd...dc" - /* 6 */ "eeeeeeead...dc" - /* 7 */ "mmmmmmmad...dc" - /* 8 */ "mmmmmmmad...dc" - /* 9 */ "mmmmmmmad...dc" - /* 10 */ "mmmmmmmadddddc" - /* 11 */ "mmmmmmmao...pc" - - // Level 4 - /* z\x* 1111 */ - /* * 01234567890123 */ - /* 0 */ ".............." - /* 1 */ "bbbbbbbbbbbbb." - /* 2 */ "jdddddddddddc." - /* 3 */ ".dq........dc." - /* 4 */ "nddddddddd.dc." - /* 5 */ "eeeeeeeead.dc." - /* 6 */ "........ad.dc." - /* 7 */ "mmmmmmm.ad.dc." - /* 8 */ "mmmmmmm.ad.dc." - /* 9 */ "mmmmmmm.adldc." - /* 10 */ "mmmmmmm.adddc." - /* 11 */ "mmmmmmm.ao.pc." - - // Level 5 - /* z\x* 1111 */ - /* * 01234567890123 */ - /* 0 */ ".............." - /* 1 */ ".............." - /* 2 */ "bbbbbbbbbbbb.." - /* 3 */ "dddddddddddc.." - /* 4 */ "eeeeeeeeeadc.." - /* 5 */ ".........adc.." - /* 6 */ ".........adc.." - /* 7 */ "mmmmmmm..adc.." - /* 8 */ "mmmmmmm..adc.." - /* 9 */ "mmmmmmm..adc.." - /* 10 */ "mmmmmmm..adc.." - /* 11 */ "mmmmmmm..adc..", - - // Connectors: - "-1: 8, 0, 0: 2\n" /* Type -1, direction Z- */, - - // AllowedRotations: - 7, /* 1, 2, 3 CCW rotation allowed */ - - // Merge strategy: - cBlockArea::msSpongePrint, - - // ShouldExtendFloor: + // MoveToGround: true, - - // DefaultWeight: - 100, - - // DepthWeight: - "", - - // AddWeightIfSame: - 0, - }, // HouseL14x12 + }, // House9x9 @@ -1571,6 +1449,164 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, + }, // HouseL14x12 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // HouseL14x12: + // The data has been exported from the gallery Desert, area index 7, ID 82, created by Aloe_vera + { + // Size: + 14, 6, 12, // SizeX = 14, SizeY = 6, SizeZ = 12 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 13, 5, 11, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a:128: 0\n" /* sandstonestairs */ + "b:128: 2\n" /* sandstonestairs */ + "c:128: 1\n" /* sandstonestairs */ + "d: 24: 0\n" /* sandstone */ + "e:128: 3\n" /* sandstonestairs */ + "f: 64: 7\n" /* wooddoorblock */ + "g: 64: 5\n" /* wooddoorblock */ + "h:102: 0\n" /* glasspane */ + "i: 64:12\n" /* wooddoorblock */ + "j:128: 7\n" /* sandstonestairs */ + "k: 50: 3\n" /* torch */ + "l: 50: 4\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n:128: 6\n" /* sandstonestairs */ + "o:128: 5\n" /* sandstonestairs */ + "p:128: 4\n" /* sandstonestairs */ + "q: 50: 1\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".......abc...." + /* 1 */ ".dddddddddddd." + /* 2 */ ".dddddddddddd." + /* 3 */ ".dddddddddddd." + /* 4 */ ".dddddddddddd." + /* 5 */ ".dddddddddddd." + /* 6 */ "....aec.ddddd." + /* 7 */ "mmmmmmm.ddddd." + /* 8 */ "mmmmmmm.ddddd." + /* 9 */ "mmmmmmm.ddddd." + /* 10 */ "mmmmmmm.ddddd." + /* 11 */ "mmmmmmm......." + + // Level 1 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".dddddddfdddd." + /* 2 */ ".d..........d." + /* 3 */ ".d..........d." + /* 4 */ ".d..........d." + /* 5 */ ".ddddgddd...d." + /* 6 */ "........d...d." + /* 7 */ "mmmmmmm.d...d." + /* 8 */ "mmmmmmm.d...d." + /* 9 */ "mmmmmmm.d...d." + /* 10 */ "mmmmmmm.ddddd." + /* 11 */ "mmmmmmm......." + + // Level 2 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".dhhdhhdidhhd." + /* 2 */ ".h..........h." + /* 3 */ ".h..........h." + /* 4 */ ".h..........d." + /* 5 */ ".dhhdidhh...h." + /* 6 */ "........h...h." + /* 7 */ "mmmmmmm.d...d." + /* 8 */ "mmmmmmm.h...h." + /* 9 */ "mmmmmmm.h...h." + /* 10 */ "mmmmmmm.dhhhd." + /* 11 */ "mmmmmmm......." + + // Level 3 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ "bbbbbbbbbbbbbb" + /* 1 */ "jddddddddddddc" + /* 2 */ ".d.....k.k..dc" + /* 3 */ ".d..........dc" + /* 4 */ ".d..l.l.....dc" + /* 5 */ "ndddddddd...dc" + /* 6 */ "eeeeeeead...dc" + /* 7 */ "mmmmmmmad...dc" + /* 8 */ "mmmmmmmad...dc" + /* 9 */ "mmmmmmmad...dc" + /* 10 */ "mmmmmmmadddddc" + /* 11 */ "mmmmmmmao...pc" + + // Level 4 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ "bbbbbbbbbbbbb." + /* 2 */ "jdddddddddddc." + /* 3 */ ".dq........dc." + /* 4 */ "nddddddddd.dc." + /* 5 */ "eeeeeeeead.dc." + /* 6 */ "........ad.dc." + /* 7 */ "mmmmmmm.ad.dc." + /* 8 */ "mmmmmmm.ad.dc." + /* 9 */ "mmmmmmm.adldc." + /* 10 */ "mmmmmmm.adddc." + /* 11 */ "mmmmmmm.ao.pc." + + // Level 5 + /* z\x* 1111 */ + /* * 01234567890123 */ + /* 0 */ ".............." + /* 1 */ ".............." + /* 2 */ "bbbbbbbbbbbb.." + /* 3 */ "dddddddddddc.." + /* 4 */ "eeeeeeeeeadc.." + /* 5 */ ".........adc.." + /* 6 */ ".........adc.." + /* 7 */ "mmmmmmm..adc.." + /* 8 */ "mmmmmmm..adc.." + /* 9 */ "mmmmmmm..adc.." + /* 10 */ "mmmmmmm..adc.." + /* 11 */ "mmmmmmm..adc..", + + // Connectors: + "-1: 8, 0, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, }, // HouseL14x12 @@ -1638,6 +1674,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // SingleField @@ -1731,6 +1770,9 @@ const cPrefab::sDef g_SandVillagePrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // SmallHut }; // g_SandVillagePrefabs @@ -1741,6 +1783,204 @@ const cPrefab::sDef g_SandVillagePrefabs[] = const cPrefab::sDef g_SandVillageStartingPrefabs[] = { + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // RoofedWell: + // The data has been exported from the gallery Desert, area index 43, ID 274, created by Aloe_vera + { + // Size: + 7, 14, 7, // SizeX = 7, SizeY = 14, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 13, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 1: 0\n" /* stone */ + "b: 24: 0\n" /* sandstone */ + "c: 8: 0\n" /* water */ + "d: 12: 0\n" /* sand */ + "e:118: 3\n" /* cauldronblock */ + "f: 85: 0\n" /* fence */ + "g:128: 2\n" /* sandstonestairs */ + "h:128: 7\n" /* sandstonestairs */ + "i:128: 4\n" /* sandstonestairs */ + "j:128: 5\n" /* sandstonestairs */ + "k:128: 6\n" /* sandstonestairs */ + "l:128: 3\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaaaaa" + /* 3 */ "aaaaaaa" + /* 4 */ "aaaaaaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "abbbbba" + /* 2 */ "abcccba" + /* 3 */ "abcccba" + /* 4 */ "abcccba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "ddddddd" + /* 1 */ "dbbbbbd" + /* 2 */ "dbcccbd" + /* 3 */ "dbcccbd" + /* 4 */ "dbcccbd" + /* 5 */ "dbbbbbd" + /* 6 */ "ddddddd" + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "ddbbbdd" + /* 1 */ "dbbbbbd" + /* 2 */ "bbcccbb" + /* 3 */ "bbcccbb" + /* 4 */ "bbcccbb" + /* 5 */ "dbbbbbd" + /* 6 */ "ddbbbdd" + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".bbbbb." + /* 2 */ ".b...b." + /* 3 */ ".b.e.b." + /* 4 */ ".b...b." + /* 5 */ ".bbbbb." + /* 6 */ "......." + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".f...f." + /* 2 */ "......." + /* 3 */ "...f..." + /* 4 */ "......." + /* 5 */ ".f...f." + /* 6 */ "......." + + // Level 10 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".f...f." + /* 2 */ "......." + /* 3 */ "...f..." + /* 4 */ "......." + /* 5 */ ".f...f." + /* 6 */ "......." + + // Level 11 + /* z\x* 0123456 */ + /* 0 */ "ggggggg" + /* 1 */ "hbhhhbh" + /* 2 */ ".i...j." + /* 3 */ ".i.f.j." + /* 4 */ ".i...j." + /* 5 */ "kbkkkbk" + /* 6 */ "lllllll" + + // Level 12 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "ggggggg" + /* 2 */ "hb...bh" + /* 3 */ ".b.f.b." + /* 4 */ "kb...bk" + /* 5 */ "lllllll" + /* 6 */ "......." + + // Level 13 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "ggggggg" + /* 3 */ "bbbbbbb" + /* 4 */ "lllllll" + /* 5 */ "......." + /* 6 */ ".......", + + // Connectors: + "2: 6, 8, 3: 5\n" /* Type 2, direction X+ */ + "2: 3, 8, 6: 3\n" /* Type 2, direction Z+ */ + "2: 0, 8, 3: 4\n" /* Type 2, direction X- */ + "2: 3, 8, 0: 2\n" /* Type 2, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // RoofedWell + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Well: // The data has been exported from the gallery Desert, area index 0, ID 1, created by Aloe_vera @@ -1875,6 +2115,9 @@ const cPrefab::sDef g_SandVillageStartingPrefabs[] = // AddWeightIfSame: 0, + + // MoveToGround: + true, }, // Well }; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index 62822c33b..cb1f4fe0d 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -127,10 +127,23 @@ public: m_HeightGen(a_HeightGen), m_RoadBlock(a_RoadBlock) { + // Generate the pieces for this village; don't care about the Y coord: cBFSPieceGenerator pg(*this, a_Seed); - // Generate the pieces at very negative Y coords, so that we can later test - // Piece has negative Y coord -> hasn't been height-adjusted yet - pg.PlacePieces(a_OriginX, -1000, a_OriginZ, a_MaxRoadDepth + 1, m_Pieces); + pg.PlacePieces(a_OriginX, 0, a_OriginZ, a_MaxRoadDepth + 1, m_Pieces); + if (m_Pieces.empty()) + { + return; + } + + // If the central piece should be moved to ground, move it, and + // check all of its dependents and move those that are strictly connector-driven based on its new Y coord: + if (((cPrefab &)m_Pieces[0]->GetPiece()).ShouldMoveToGround()) + { + int OrigPosY = m_Pieces[0]->GetCoords().y; + PlacePieceOnGround(*m_Pieces[0]); + int NewPosY = m_Pieces[0]->GetCoords().y; + MoveAllDescendants(m_Pieces, 0, NewPosY - OrigPosY); + } } protected: @@ -179,7 +192,7 @@ protected: DrawRoad(a_Chunk, **itr, HeightMap); continue; } - if ((*itr)->GetCoords().y < 0) + if (Prefab.ShouldMoveToGround() && !(*itr)->HasBeenMovedToGround()) { PlacePieceOnGround(**itr); } @@ -201,7 +214,7 @@ protected: cChunkDef::HeightMap HeightMap; m_HeightGen.GenHeightMap(ChunkX, ChunkZ, HeightMap); int TerrainHeight = cChunkDef::GetHeight(HeightMap, BlockX, BlockZ); - a_Piece.GetCoords().y += TerrainHeight - FirstConnector.m_Pos.y + 1; + a_Piece.MoveToGroundBy(TerrainHeight - FirstConnector.m_Pos.y + 1); } @@ -232,11 +245,13 @@ protected: return m_Prefabs.GetPiecesWithConnector(a_ConnectorType); } + virtual cPieces GetStartingPieces(void) { return m_Prefabs.GetStartingPieces(); } + virtual int GetPieceWeight( const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, @@ -258,15 +273,35 @@ protected: return m_Prefabs.GetPieceWeight(a_PlacedPiece, a_ExistingConnector, a_NewPiece); } + virtual void PiecePlaced(const cPiece & a_Piece) override { m_Prefabs.PiecePlaced(a_Piece); } + virtual void Reset(void) override { m_Prefabs.Reset(); } + + + void MoveAllDescendants(cPlacedPieces & a_PlacedPieces, size_t a_Pivot, int a_HeightDifference) + { + size_t num = a_PlacedPieces.size(); + cPlacedPiece * Pivot = a_PlacedPieces[a_Pivot]; + for (size_t i = a_Pivot + 1; i < num; i++) + { + if ( + (a_PlacedPieces[i]->GetParent() == Pivot) && // It is a direct dependant of the pivot + !((const cPrefab &)a_PlacedPieces[i]->GetPiece()).ShouldMoveToGround() // It attaches strictly by connectors + ) + { + a_PlacedPieces[i]->MoveToGroundBy(a_HeightDifference); + MoveAllDescendants(a_PlacedPieces, i, a_HeightDifference); + } + } // for i - a_PlacedPieces[] + } } ; From 24137e282bc97497bcf8c50745d2d45da59b1a27 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 26 May 2014 10:05:51 +0200 Subject: [PATCH 164/214] Fixed prefab test initialization. --- src/Generating/Prefab.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index e41907325..2ab1455b9 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -108,6 +108,9 @@ static const cPrefab::sDef g_TestPrefabDef = // AddWeightIfSame: 1000, + + // MoveToGround: + false, }; static cPrefab g_TestPrefab(g_TestPrefabDef); From 16e4af0793c55533dd999a5c2e8ade4ddd212d72 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 26 May 2014 10:50:17 +0100 Subject: [PATCH 165/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22befc822..5847cdd17 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) +MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/mcs_team.svg)](https://www.gittip.com/on/github/mc-server/) [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) ======== MCServer is a Minecraft server that is written in C++ and designed to be efficient with memory and CPU, as well as having a flexible Lua Plugin API. From 69c39648750e2f752212103cc12998f7f73751fc Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 26 May 2014 10:50:42 +0100 Subject: [PATCH 166/214] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5847cdd17..9b9694841 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/mcs_team.svg)](https://www.gittip.com/on/github/mc-server/) [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) +MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) [![Support via Gittip](http://img.shields.io/gittip/mcs_team.svg)](https://www.gittip.com/mcs_team) [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) ======== MCServer is a Minecraft server that is written in C++ and designed to be efficient with memory and CPU, as well as having a flexible Lua Plugin API. From 1d6dbb6278d9700ffaa69717508eac72fde05f59 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 26 May 2014 12:29:45 +0100 Subject: [PATCH 167/214] Minor fixes. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9b9694841..e6d9492f0 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Normally, you will want to download a pre-compiled version of MCServer from one * [Linux and Raspberry Pi](http://ci.bearbin.net) (Bearbin's CI Server) * [Windows](http://mc-server.xoft.cz) (xoft's nightly build service) -You simply need to download and extract these files before you can use the server. +You simply need to download and extract these files before you can use the server. If you're a more advanced user, you may want to compile the server yourself for more performance. See the [COMPILING.md](https://github.com/mc-server/MCServer/blob/master/COMPILING.md) file for more details. @@ -24,7 +24,7 @@ Contributing MCServer is licensed under the Apache license V2, and we welcome anybody to fork and submit a Pull Request back with their changes, and if you want to join as a permanent member we can add you to the team. -Check out the [CONTRIBUTING.md](https://github.com/mc-server/MCServer/blob/master/CONTRIBUTING.md) file for more infos. +Check out the [CONTRIBUTING.md](https://github.com/mc-server/MCServer/blob/master/CONTRIBUTING.md) file for more details. Other Stuff ----------- @@ -33,7 +33,7 @@ For other stuff, including plugins and discussion, check the [forums](http://for Earn bitcoins for commits or donate to reward the MCServer developers: [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74) -Support Via Gittip: [![Support via Gittip](http://img.shields.io/gittip/on%2Fgithub%2Fmc-server.svg)](https://www.gittip.com/on/github/mc-server/) +Support Us on Gittip: [![Support via Gittip](http://img.shields.io/gittip/mcs_team.svg)](https://www.gittip.com/mcs_team) Travis CI: [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer) From 6449b5d11b5a07183812189d5eead0734f9dc191 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 26 May 2014 16:38:14 +0200 Subject: [PATCH 168/214] Revert "Add more move checks" This reverts commit 989312c4e7f517ae324e857cb255211e3fd8bb06. --- src/ClientHandle.cpp | 74 ++++++++++---------------------------------- src/ClientHandle.h | 2 +- 2 files changed, 17 insertions(+), 59 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index e7537d74d..83b21ae3c 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -582,37 +582,16 @@ void cClientHandle::HandlePlayerPos(double a_PosX, double a_PosY, double a_PosZ, return; } - if (m_Player->GetHealth() <= 0) + /* + // TODO: Invalid stance check + if ((a_PosY >= a_Stance) || (a_Stance > a_PosY + 1.65)) { - // The player is dead. He can't move :D + LOGD("Invalid stance"); + SendPlayerMoveLook(); return; } - - if (std::isnan(a_PosX) || std::isnan(a_PosY) || std::isnan(a_PosZ) || std::isnan(a_Stance)) - { - LOGWARN("%s was caught trying to crash the server with an invalid position.", m_Player->GetName().c_str()); - Kick("Nope!"); - return; - } - - // Invalid stance check - if (!m_Player->IsInBed()) - { - double Difference = a_Stance - a_PosY; - if ((Difference > 1.65) || (Difference < 1.0)) - { - Kick("Illegal stance!"); - LOGWARN("%s had an illegal stance: %f", m_Player->GetName().c_str(), a_Stance); - return; - } - } - - if ((std::abs(a_PosX) > 32000000.0) || (std::abs(a_PosZ) > 32000000.0)) - { - Kick("Illegal position!"); - return; - } - + */ + // If the player has moved too far, "repair" them: Vector3d Pos(a_PosX, a_PosY, a_PosZ); if ((m_Player->GetPosition() - Pos).SqrLength() > 100 * 100) @@ -1410,7 +1389,7 @@ void cClientHandle::HandlePlayerLook(float a_Rotation, float a_Pitch, bool a_IsO -void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Yaw, float a_Pitch, bool a_IsOnGround) +void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Rotation, float a_Pitch, bool a_IsOnGround) { if ((m_Player == NULL) || (m_State != csPlaying)) { @@ -1418,42 +1397,21 @@ void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_ return; } - if (m_Player->GetHealth() <= 0) + /* + // TODO: Invalid stance check + if ((a_PosY >= a_Stance) || (a_Stance > a_PosY + 1.65)) { - // The player is dead. He can't move :D - return; - } - - if (std::isnan(a_PosX) || std::isnan(a_PosY) || std::isnan(a_PosZ) || std::isnan(a_Stance)) - { - LOGWARN("%s was caught trying to crash the server with an invalid position.", m_Player->GetName().c_str()); - Kick("Nope!"); - return; - } - - // Invalid stance check - if (!m_Player->IsInBed()) - { - double Difference = a_Stance - a_PosY; - if ((Difference > 1.65) || (Difference < 1.0)) - { - Kick("Illegal stance!"); - LOGWARN("%s had an illegal stance: %f", m_Player->GetName().c_str(), a_Stance); - return; - } - } - - if ((std::abs(a_PosX) > 32000000.0) || (std::abs(a_PosZ) > 32000000.0)) - { - Kick("Illegal position!"); + LOGD("Invalid stance"); + SendPlayerMoveLook(); return; } + */ m_Player->MoveTo(Vector3d(a_PosX, a_PosY, a_PosZ)); m_Player->SetStance (a_Stance); m_Player->SetTouchGround(a_IsOnGround); - m_Player->SetHeadYaw (a_Yaw); - m_Player->SetYaw (a_Yaw); + m_Player->SetHeadYaw (a_Rotation); + m_Player->SetYaw (a_Rotation); m_Player->SetPitch (a_Pitch); } diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 04d93e2c0..659c67658 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -225,7 +225,7 @@ public: void HandlePing (void); void HandlePlayerAbilities (bool a_CanFly, bool a_IsFlying, float FlyingSpeed, float WalkingSpeed); void HandlePlayerLook (float a_Rotation, float a_Pitch, bool a_IsOnGround); - void HandlePlayerMoveLook (double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Yaw, float a_Pitch, bool a_IsOnGround); // While m_bPositionConfirmed (normal gameplay) + void HandlePlayerMoveLook (double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Rotation, float a_Pitch, bool a_IsOnGround); // While m_bPositionConfirmed (normal gameplay) void HandlePlayerPos (double a_PosX, double a_PosY, double a_PosZ, double a_Stance, bool a_IsOnGround); void HandlePluginMessage (const AString & a_Channel, const AString & a_Message); void HandleRespawn (void); From 2194238ef0b376353e7260df5a964976d0b72c5f Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 26 May 2014 17:17:54 +0100 Subject: [PATCH 169/214] Update main.css --- MCServer/Plugins/APIDump/main.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MCServer/Plugins/APIDump/main.css b/MCServer/Plugins/APIDump/main.css index aa26bd186..0a779bfb8 100644 --- a/MCServer/Plugins/APIDump/main.css +++ b/MCServer/Plugins/APIDump/main.css @@ -39,7 +39,8 @@ pre body { - min-width: 800px; + min-width: 400px; + max-width: 900px; width: 95%; margin: 10px auto; background-color: white; From 0a3570bc9daab9fb8772dee48aab1ba6bf4da92a Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 26 May 2014 14:13:40 -0700 Subject: [PATCH 170/214] ClientHandle.cpp: remove redundant code HandlePlayerMoveLook() calls HandlePlayerPos() and HandlePlayerLook() to reduce code redundancy. --- src/ClientHandle.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 83b21ae3c..4aa42a489 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1391,28 +1391,8 @@ void cClientHandle::HandlePlayerLook(float a_Rotation, float a_Pitch, bool a_IsO void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Rotation, float a_Pitch, bool a_IsOnGround) { - if ((m_Player == NULL) || (m_State != csPlaying)) - { - // The client hasn't been spawned yet and sends nonsense, we know better - return; - } - - /* - // TODO: Invalid stance check - if ((a_PosY >= a_Stance) || (a_Stance > a_PosY + 1.65)) - { - LOGD("Invalid stance"); - SendPlayerMoveLook(); - return; - } - */ - - m_Player->MoveTo(Vector3d(a_PosX, a_PosY, a_PosZ)); - m_Player->SetStance (a_Stance); - m_Player->SetTouchGround(a_IsOnGround); - m_Player->SetHeadYaw (a_Rotation); - m_Player->SetYaw (a_Rotation); - m_Player->SetPitch (a_Pitch); + HandlePlayerPos(a_PosX, a_PosY, a_PosZ, a_Stance, a_IsOnGround); + HandlePlayerLook(a_Rotation, a_Pitch, a_IsOnGround); } From c204735f3840d2199c48b13bd26e9b8d80394b83 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 27 May 2014 00:28:46 -0700 Subject: [PATCH 171/214] ClientHandle.cpp: Process look before pos --- src/ClientHandle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 4aa42a489..9b03bead9 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1391,8 +1391,8 @@ void cClientHandle::HandlePlayerLook(float a_Rotation, float a_Pitch, bool a_IsO void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Rotation, float a_Pitch, bool a_IsOnGround) { - HandlePlayerPos(a_PosX, a_PosY, a_PosZ, a_Stance, a_IsOnGround); HandlePlayerLook(a_Rotation, a_Pitch, a_IsOnGround); + HandlePlayerPos(a_PosX, a_PosY, a_PosZ, a_Stance, a_IsOnGround); } From 19df18c46199f06f3bf2058cc0efee9126e7670a Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 27 May 2014 12:44:56 +0100 Subject: [PATCH 172/214] Fixed test globals to work with precompiled headers --- src/ChunkData.cpp | 4 - src/Globals.h | 48 ++++++++--- tests/ChunkData/ArraytoCoord.cpp | 2 +- tests/ChunkData/Coordinates.cpp | 2 +- tests/ChunkData/Copies.cpp | 2 +- tests/ChunkData/creatable.cpp | 2 +- tests/TestGlobals.h | 139 ------------------------------- 7 files changed, 40 insertions(+), 159 deletions(-) delete mode 100644 tests/TestGlobals.h diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 79029f0cf..c41dcb265 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -1,9 +1,5 @@ -#ifdef TEST_GLOBALS -#include "TestGlobals.h" -#else #include "Globals.h" -#endif #include "ChunkData.h" cChunkData::cChunkData() diff --git a/src/Globals.h b/src/Globals.h index 71e9191e4..85cfd2f18 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -225,16 +225,28 @@ template class SizeChecker; +#ifndef TEST_GLOBALS + // Common headers (part 1, without macros): + #include "StringUtils.h" + #include "OSSupport/Sleep.h" + #include "OSSupport/CriticalSection.h" + #include "OSSupport/Semaphore.h" + #include "OSSupport/Event.h" + #include "OSSupport/Thread.h" + #include "OSSupport/File.h" + #include "MCLogger.h" +#else + // Logging functions +void inline LOGERROR(const char* a_Format, ...) FORMATSTRING(1,2); -// Common headers (part 1, without macros): -#include "StringUtils.h" -#include "OSSupport/Sleep.h" -#include "OSSupport/CriticalSection.h" -#include "OSSupport/Semaphore.h" -#include "OSSupport/Event.h" -#include "OSSupport/Thread.h" -#include "OSSupport/File.h" -#include "MCLogger.h" +void inline LOGERROR(const char* a_Format, ...) +{ + va_list argList; + va_start(argList, a_Format); + vprintf(a_Format, argList); + va_end(argList); +} +#endif @@ -253,10 +265,22 @@ template class SizeChecker; #define FAST_FLOOR_DIV( x, div ) (((x) - (((x) < 0) ? ((div) - 1) : 0)) / (div)) // Own version of assert() that writes failed assertions to the log for review -#ifdef _DEBUG - #define ASSERT( x ) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__ ), assert(0), 0 ) ) +#ifdef TEST_GLOBALS + + class cAssertFailure + { + }; + + #define ASSERT(x) do { if (!(x)) { throw cAssertFailure();} } while (0) + #define testassert(x) do { if(!(x)) { exit(1); } } while (0) + #define CheckAsserts(x) do { try {x} catch (cAssertFailure) { break; } exit(1); } while (0) + #else - #define ASSERT(x) ((void)(x)) + #ifdef _DEBUG + #define ASSERT( x ) ( !!(x) || ( LOGERROR("Assertion failed: %s, file %s, line %i", #x, __FILE__, __LINE__ ), assert(0), 0 ) ) + #else + #define ASSERT(x) ((void)(x)) + #endif #endif // Pretty much the same as ASSERT() but stays in Release builds diff --git a/tests/ChunkData/ArraytoCoord.cpp b/tests/ChunkData/ArraytoCoord.cpp index 1138fb5b6..37533de77 100644 --- a/tests/ChunkData/ArraytoCoord.cpp +++ b/tests/ChunkData/ArraytoCoord.cpp @@ -1,5 +1,5 @@ -#include "TestGlobals.h" +#include "Globals.h" #include "ChunkData.h" diff --git a/tests/ChunkData/Coordinates.cpp b/tests/ChunkData/Coordinates.cpp index f02b68d40..938c66dcc 100644 --- a/tests/ChunkData/Coordinates.cpp +++ b/tests/ChunkData/Coordinates.cpp @@ -1,5 +1,5 @@ -#include "TestGlobals.h" +#include "Globals.h" #include "ChunkData.h" diff --git a/tests/ChunkData/Copies.cpp b/tests/ChunkData/Copies.cpp index b10ddb759..78a458f5b 100644 --- a/tests/ChunkData/Copies.cpp +++ b/tests/ChunkData/Copies.cpp @@ -1,5 +1,5 @@ -#include "TestGlobals.h" +#include "Globals.h" #include "ChunkData.h" diff --git a/tests/ChunkData/creatable.cpp b/tests/ChunkData/creatable.cpp index 74025cb14..1321bf49b 100644 --- a/tests/ChunkData/creatable.cpp +++ b/tests/ChunkData/creatable.cpp @@ -1,5 +1,5 @@ -#include "TestGlobals.h" +#include "Globals.h" #include "ChunkData.h" int main(int argc, char** argv) diff --git a/tests/TestGlobals.h b/tests/TestGlobals.h deleted file mode 100644 index ea43de733..000000000 --- a/tests/TestGlobals.h +++ /dev/null @@ -1,139 +0,0 @@ - - -#include -#include -#include - - -// Compiler-dependent stuff: -#if defined(_MSC_VER) - // MSVC produces warning C4481 on the override keyword usage, so disable the warning altogether - #pragma warning(disable:4481) - - // Disable some warnings that we don't care about: - #pragma warning(disable:4100) // Unreferenced formal parameter - - // Useful warnings from warning level 4: - #pragma warning(3 : 4127) // Conditional expression is constant - #pragma warning(3 : 4189) // Local variable is initialized but not referenced - #pragma warning(3 : 4245) // Conversion from 'type1' to 'type2', signed/unsigned mismatch - #pragma warning(3 : 4310) // Cast truncates constant value - #pragma warning(3 : 4389) // Signed/unsigned mismatch - #pragma warning(3 : 4505) // Unreferenced local function has been removed - #pragma warning(3 : 4701) // Potentially unitialized local variable used - #pragma warning(3 : 4702) // Unreachable code - #pragma warning(3 : 4706) // Assignment within conditional expression - - // Disabling this warning, because we know what we're doing when we're doing this: - #pragma warning(disable: 4355) // 'this' used in initializer list - - // Disabled because it's useless: - #pragma warning(disable: 4512) // 'class': assignment operator could not be generated - reported for each class that has a reference-type member - - // 2014_01_06 xoft: Disabled this warning because MSVC is stupid and reports it in obviously wrong places - // #pragma warning(3 : 4244) // Conversion from 'type1' to 'type2', possible loss of data - - #define OBSOLETE __declspec(deprecated) - - // No alignment needed in MSVC - #define ALIGN_8 - #define ALIGN_16 - - #define FORMATSTRING(formatIndex, va_argsIndex) - - // MSVC has its own custom version of zu format - #define SIZE_T_FMT "%Iu" - #define SIZE_T_FMT_PRECISION(x) "%" #x "Iu" - #define SIZE_T_FMT_HEX "%Ix" - - #define NORETURN __declspec(noreturn) - -#elif defined(__GNUC__) - - // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? - #define abstract - - // override is part of c++11 - #if __cplusplus < 201103L - #define override - #endif - - #define OBSOLETE __attribute__((deprecated)) - - #define ALIGN_8 __attribute__((aligned(8))) - #define ALIGN_16 __attribute__((aligned(16))) - - // Some portability macros :) - #define stricmp strcasecmp - - #define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex))) - - #define SIZE_T_FMT "%zu" - #define SIZE_T_FMT_PRECISION(x) "%" #x "zu" - #define SIZE_T_FMT_HEX "%zx" - - #define NORETURN __attribute((__noreturn__)) - -#else - - #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" - - /* - // Copy and uncomment this into another #elif section based on your compiler identification - - // Explicitly mark classes as abstract (no instances can be created) - #define abstract - - // Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class) - #define override - - // Mark functions as obsolete, so that their usage results in a compile-time warning - #define OBSOLETE - - // Mark types / variables for alignment. Do the platforms need it? - #define ALIGN_8 - #define ALIGN_16 - */ - -#endif - - - -// Integral types with predefined sizes: -typedef long long Int64; -typedef int Int32; -typedef short Int16; - -typedef unsigned long long UInt64; -typedef unsigned int UInt32; -typedef unsigned short UInt16; - -typedef unsigned char Byte; - -class cAssertFailure -{ -}; - -#define ASSERT(x) do { if (!(x)) { throw cAssertFailure();} } while (0) -#define testassert(x) do { if(!(x)) { exit(1); } } while (0) -#define CheckAsserts(x) do { try {x} catch (cAssertFailure) { break; } exit(1); } while (0) - -#ifndef TOLUA_TEMPLATE_BIND -#define TOLUA_TEMPLATE_BIND(x) -#endif - -// A macro that is used to mark unused function parameters, to avoid pedantic warnings in gcc -#define UNUSED(X) (void)(X) - -// Logging functions -void inline LOGERROR(const char* a_Format, ...) FORMATSTRING(1,2); - -void inline LOGERROR(const char* a_Format, ...) -{ - va_list argList; - va_start(argList, a_Format); - vprintf(a_Format, argList); - va_end(argList); -} - - From 6c25c356c7769b64fd43b0dd2611deb18bdd5619 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 27 May 2014 21:18:15 +0200 Subject: [PATCH 173/214] Biome generators: biome lists can contain spaces. --- src/Generating/BioGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index 32a687201..47ba080c6 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -212,7 +212,7 @@ void cBioGenCache::InitializeBiomeGen(cIniFile & a_IniFile) void cBiomeGenList::InitializeBiomes(const AString & a_Biomes) { - AStringVector Split = StringSplit(a_Biomes, ","); + AStringVector Split = StringSplitAndTrim(a_Biomes, ","); // Convert each string in the list into biome: for (AStringVector::const_iterator itr = Split.begin(); itr != Split.end(); ++itr) From e06f786f1151e1934890a2555de080b1a6860ec4 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 27 May 2014 20:24:04 +0100 Subject: [PATCH 174/214] Stuff. --- MCServer/Plugins/APIDump/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MCServer/Plugins/APIDump/main.css b/MCServer/Plugins/APIDump/main.css index 0a779bfb8..8041e0d01 100644 --- a/MCServer/Plugins/APIDump/main.css +++ b/MCServer/Plugins/APIDump/main.css @@ -40,7 +40,7 @@ pre body { min-width: 400px; - max-width: 900px; + max-width: 1200px; width: 95%; margin: 10px auto; background-color: white; From ff99373237178e9f7da02f51581f9a83d0e624d9 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 27 May 2014 22:05:50 +0200 Subject: [PATCH 175/214] cPieceGenerator chooses starting pieces based on weights. Fixes #1033. --- src/Generating/PieceGenerator.cpp | 26 +++++++++++++++++++++++++- src/Generating/PieceGenerator.h | 9 +++++++++ src/Generating/PrefabPiecePool.cpp | 9 +++++++++ src/Generating/PrefabPiecePool.h | 1 + 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/Generating/PieceGenerator.cpp b/src/Generating/PieceGenerator.cpp index 1880a20d5..5de231f75 100644 --- a/src/Generating/PieceGenerator.cpp +++ b/src/Generating/PieceGenerator.cpp @@ -362,7 +362,31 @@ cPlacedPiece * cPieceGenerator::PlaceStartingPiece(int a_BlockX, int a_BlockY, i // Choose a random one of the starting pieces: cPieces StartingPieces = m_PiecePool.GetStartingPieces(); - cPiece * StartingPiece = StartingPieces[rnd % StartingPieces.size()]; + int Total = 0; + for (cPieces::const_iterator itr = StartingPieces.begin(), end = StartingPieces.end(); itr != end; ++itr) + { + Total += m_PiecePool.GetStartingPieceWeight(**itr); + } + cPiece * StartingPiece; + if (Total > 0) + { + int Chosen = rnd % Total; + StartingPiece = StartingPieces.front(); + for (cPieces::const_iterator itr = StartingPieces.begin(), end = StartingPieces.end(); itr != end; ++itr) + { + Chosen -= m_PiecePool.GetStartingPieceWeight(**itr); + if (Chosen <= 0) + { + StartingPiece = *itr; + break; + } + } + } + else + { + // All pieces returned zero weight, but we need one to start. Choose with equal chance: + StartingPiece = StartingPieces[rnd % StartingPieces.size()]; + } rnd = rnd >> 16; // Choose a random supported rotation: diff --git a/src/Generating/PieceGenerator.h b/src/Generating/PieceGenerator.h index 21c155c96..fd8576706 100644 --- a/src/Generating/PieceGenerator.h +++ b/src/Generating/PieceGenerator.h @@ -120,6 +120,15 @@ public: const cPiece & a_NewPiece ) { return 1; } + /** Returns the relative weight with which the a_NewPiece is to be selected for placing as the first piece. + This allows the pool to tweak the piece's chances. + The higher the number returned, the higher the chance the piece will be chosen. 0 means the piece will not be chosen. + If all pieces return 0, a random piece is chosen, with all equal chances. + */ + virtual int GetStartingPieceWeight( + const cPiece & a_NewPiece + ) { return 1; } + /** Called after a piece is placed, to notify the pool that it has been used. The pool may adjust the pieces it will return the next time. */ virtual void PiecePlaced(const cPiece & a_Piece) = 0; diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp index ed9340815..ad97ab0e7 100644 --- a/src/Generating/PrefabPiecePool.cpp +++ b/src/Generating/PrefabPiecePool.cpp @@ -101,6 +101,15 @@ int cPrefabPiecePool::GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const c +int cPrefabPiecePool::GetStartingPieceWeight(const cPiece & a_NewPiece) +{ + return ((const cPrefab &)a_NewPiece).GetDefaultWeight(); +} + + + + + void cPrefabPiecePool::PiecePlaced(const cPiece & a_Piece) { // Do nothing diff --git a/src/Generating/PrefabPiecePool.h b/src/Generating/PrefabPiecePool.h index c6a5ad360..695ab4ea5 100644 --- a/src/Generating/PrefabPiecePool.h +++ b/src/Generating/PrefabPiecePool.h @@ -70,6 +70,7 @@ protected: virtual cPieces GetPiecesWithConnector(int a_ConnectorType) override; virtual cPieces GetStartingPieces(void) override; virtual int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, const cPiece & a_NewPiece) override; + virtual int GetStartingPieceWeight(const cPiece & a_NewPiece) override; virtual void PiecePlaced(const cPiece & a_Piece) override; virtual void Reset(void) override; } ; From 71256c98ed748d5cd789f94404e7984e11bdf115 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 27 May 2014 22:06:49 +0200 Subject: [PATCH 176/214] Fixed testing weights in PlainsVillages. --- src/Generating/Prefabs/PlainsVillagePrefabs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index fee6610c9..f8cf867e5 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -4601,7 +4601,7 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = true, // DefaultWeight: - 0, + 100, // DepthWeight: "", @@ -5048,7 +5048,7 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = false, // DefaultWeight: - 1000, + 100, // DepthWeight: "", @@ -5259,7 +5259,7 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] = true, // DefaultWeight: - 0, + 100, // DepthWeight: "", From 6b41d1a4220aa032f53b67637bbc3276272e5047 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 27 May 2014 22:08:20 +0200 Subject: [PATCH 177/214] Added AlchemistVillage prefabs (Thanks, KingsCraftAu). --- .../Prefabs/AlchemistVillagePrefabs.cpp | 2969 +++++++++++++++++ .../Prefabs/AlchemistVillagePrefabs.h | 15 + src/Generating/VillageGen.cpp | 32 +- 3 files changed, 3007 insertions(+), 9 deletions(-) create mode 100644 src/Generating/Prefabs/AlchemistVillagePrefabs.cpp create mode 100644 src/Generating/Prefabs/AlchemistVillagePrefabs.h diff --git a/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp b/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp new file mode 100644 index 000000000..32ffe5b88 --- /dev/null +++ b/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp @@ -0,0 +1,2969 @@ + +// AlchemistVillagePrefabs.cpp + +// Defines the prefabs in the group AlchemistVillage + +// NOTE: This file has been generated automatically by GalExport! +// Any manual changes will be overwritten by the next automatic export! + +#include "Globals.h" +#include "AlchemistVillagePrefabs.h" + + + + + +const cPrefab::sDef g_AlchemistVillagePrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // BarWithBasement: + // The data has been exported from the gallery Desert, area index 82, ID 598, created by STR_Warrior + { + // Size: + 11, 12, 9, // SizeX = 11, SizeY = 12, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 11, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A:101: 0\n" /* ironbars */ + "B: 64:12\n" /* wooddoorblock */ + "C:128: 2\n" /* sandstonestairs */ + "D: 24: 1\n" /* sandstone */ + "E: 44: 9\n" /* step */ + "F:126: 8\n" /* woodenslab */ + "G:128: 7\n" /* sandstonestairs */ + "H: 44: 1\n" /* step */ + "I: 64: 7\n" /* wooddoorblock */ + "J:128: 6\n" /* sandstonestairs */ + "a: 1: 0\n" /* stone */ + "b: 24: 0\n" /* sandstone */ + "c: 12: 0\n" /* sand */ + "d:134: 4\n" /* 134 */ + "e: 5: 1\n" /* wood */ + "f:134: 5\n" /* 134 */ + "g: 65: 5\n" /* ladder */ + "h: 17: 3\n" /* tree */ + "i: 69:11\n" /* lever */ + "j:134: 0\n" /* 134 */ + "k:134: 1\n" /* 134 */ + "l: 50: 4\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 5: 0\n" /* wood */ + "o: 96:12\n" /* trapdoor */ + "p: 24: 2\n" /* sandstone */ + "q:128: 5\n" /* sandstonestairs */ + "r:107: 6\n" /* fencegate */ + "s:128: 4\n" /* sandstonestairs */ + "t:134: 3\n" /* 134 */ + "u: 85: 0\n" /* fence */ + "v:134: 7\n" /* 134 */ + "w:107: 5\n" /* fencegate */ + "x: 64: 5\n" /* wooddoorblock */ + "y: 50: 3\n" /* torch */ + "z:171: 8\n" /* carpet */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aabbbbbbbaa" + /* 3 */ "aabbbbbbbaa" + /* 4 */ "aabbbbbbbaa" + /* 5 */ "aabbbbbbbaa" + /* 6 */ "aabbbbbbbaa" + /* 7 */ "aabbbbbbbaa" + /* 8 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "ccccccccccc" + /* 1 */ "cbbbbbbbbbc" + /* 2 */ "cbdef.defbc" + /* 3 */ "cbdef.defbc" + /* 4 */ "cbdef.defbc" + /* 5 */ "cb.......bc" + /* 6 */ "cb.......bc" + /* 7 */ "cbg......bc" + /* 8 */ "cbbbbbbbbbc" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "ccccccccccc" + /* 1 */ "cbbbbbbbbbc" + /* 2 */ "cbeee.eeebc" + /* 3 */ "cbeee.eeebc" + /* 4 */ "cbehe.ehebc" + /* 5 */ "cb.i...i.bc" + /* 6 */ "cb.......bc" + /* 7 */ "cbg......bc" + /* 8 */ "cbbbbbbbbbc" + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "ccccccccccc" + /* 1 */ "cbbbbbbbbbc" + /* 2 */ "cbjek.jekbc" + /* 3 */ "cbjek.jekbc" + /* 4 */ "cbjek.jekbc" + /* 5 */ "cb.......bc" + /* 6 */ "cb.......bc" + /* 7 */ "cbg..l...bc" + /* 8 */ "cbbbbbbbbbc" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "ccccccccccc" + /* 1 */ "ccccccccccc" + /* 2 */ "ccnnnnnnncc" + /* 3 */ "cnnnnnnnnnc" + /* 4 */ "cnnnnnnnnnc" + /* 5 */ "cnnnnnnnnnc" + /* 6 */ "cnnnnnnnnnc" + /* 7 */ "cnonnnnnnnc" + /* 8 */ "cnccccccccc" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...p...p..." + /* 1 */ "..........." + /* 2 */ "pbbbqrsbbbp" + /* 3 */ "bkt.....ttb" + /* 4 */ "bku.....ujb" + /* 5 */ "b.........b" + /* 6 */ "bfvvd.....b" + /* 7 */ "b...w..kujb" + /* 8 */ "pxbbbbbbbbp" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...p...p..." + /* 1 */ "..........." + /* 2 */ "pbbb...bbbp" + /* 3 */ "b..y...y..b" + /* 4 */ "b.z.....z.b" + /* 5 */ "A.........A" + /* 6 */ "b.........b" + /* 7 */ "b.......z.b" + /* 8 */ "pBbbAAAbbbp" + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...C...C..." + /* 1 */ "...D...b..." + /* 2 */ "pbbbqEsbbbp" + /* 3 */ "bFFFFFFFFFb" + /* 4 */ "bFFFFFFFFFb" + /* 5 */ "sFFFFFFFFFq" + /* 6 */ "bFFFFFFFFFb" + /* 7 */ "bFFFFFFFFFb" + /* 8 */ "pbbbGGGbbbp" + + // Level 8 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "bHHHHbHHHHb" + /* 3 */ "HpbbbbbbbpH" + /* 4 */ "Hb.......bH" + /* 5 */ "bb.......bb" + /* 6 */ "Hb.......bH" + /* 7 */ "HpIbbbbbbpH" + /* 8 */ "bH.HHbHHHHb" + + // Level 9 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ ".pbbAAAbbp." + /* 4 */ ".b.......b." + /* 5 */ ".A.......A." + /* 6 */ ".b.......b." + /* 7 */ ".pBbAAAbbp." + /* 8 */ "..........." + + // Level 10 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ ".pbbJJJbbp." + /* 4 */ ".bFFFFFFFb." + /* 5 */ ".sFFFFFFFq." + /* 6 */ ".bFFFFFFFb." + /* 7 */ ".pbbGGGbbp." + /* 8 */ "..........." + + // Level 11 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ ".bHHHbHHHb." + /* 4 */ ".H.......H." + /* 5 */ ".b.......b." + /* 6 */ ".H.......H." + /* 7 */ ".bHHHbHHHb." + /* 8 */ "...........", + + // Connectors: + "-1: 5, 5, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // BarWithBasement + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // BarWithoutBasement: + // The data has been exported from the gallery Desert, area index 81, ID 597, created by STR_Warrior + { + // Size: + 11, 8, 9, // SizeX = 11, SizeY = 8, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 7, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A: 44: 1\n" /* step */ + "B: 64: 3\n" /* wooddoorblock */ + "C: 64: 8\n" /* wooddoorblock */ + "D:128: 6\n" /* sandstonestairs */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e:128: 5\n" /* sandstonestairs */ + "f:107: 6\n" /* fencegate */ + "g:128: 4\n" /* sandstonestairs */ + "h:134: 1\n" /* 134 */ + "i:134: 3\n" /* 134 */ + "j: 85: 0\n" /* fence */ + "k:134: 0\n" /* 134 */ + "l:134: 5\n" /* 134 */ + "m: 19: 0\n" /* sponge */ + "n:134: 7\n" /* 134 */ + "o:134: 4\n" /* 134 */ + "p:107: 5\n" /* fencegate */ + "q: 64: 5\n" /* wooddoorblock */ + "r: 50: 3\n" /* torch */ + "s:171: 8\n" /* carpet */ + "t:101: 0\n" /* ironbars */ + "u: 64:12\n" /* wooddoorblock */ + "v:128: 2\n" /* sandstonestairs */ + "w: 24: 1\n" /* sandstone */ + "x: 44: 9\n" /* step */ + "y:126: 8\n" /* woodenslab */ + "z:128: 7\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaabbbaaaa" + /* 3 */ "abbbbbbbbba" + /* 4 */ "abbbbbbbbba" + /* 5 */ "abbbbbbbbba" + /* 6 */ "abbbbbbbbba" + /* 7 */ "abbbbbbbbba" + /* 8 */ "abaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...c...c..." + /* 1 */ "..........." + /* 2 */ "cdddefgdddc" + /* 3 */ "dhi.....iid" + /* 4 */ "dhj.....jkd" + /* 5 */ "d.........d" + /* 6 */ "dlnno.....d" + /* 7 */ "d...p..hjkd" + /* 8 */ "cqddddddddc" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...c...c..." + /* 1 */ "..........." + /* 2 */ "cddd...dddc" + /* 3 */ "d..r...r..d" + /* 4 */ "d.s.....s.d" + /* 5 */ "t.........t" + /* 6 */ "d.........d" + /* 7 */ "d.......s.d" + /* 8 */ "cuddtttdddc" + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "...v...v..." + /* 1 */ "...w...d..." + /* 2 */ "cdddexgdddc" + /* 3 */ "dyyyyyyyyyd" + /* 4 */ "dyyyyyyyyyd" + /* 5 */ "gyyyyyyyyye" + /* 6 */ "dyyyyyyyyyd" + /* 7 */ "dyyyyyyyyyd" + /* 8 */ "cdddzzzdddc" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "dAAAAdAAAAd" + /* 3 */ "AcdddddddcA" + /* 4 */ "Ad.......dA" + /* 5 */ "dd.......dd" + /* 6 */ "Ad.......dA" + /* 7 */ "AcBddddddcA" + /* 8 */ "dA.AAdAAAAd" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ ".cddtttddc." + /* 4 */ ".d.......d." + /* 5 */ ".t.......t." + /* 6 */ ".d.......d." + /* 7 */ ".cCdtttddc." + /* 8 */ "..........." + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ ".cddDDDddc." + /* 4 */ ".dyyyyyyyd." + /* 5 */ ".gyyyyyyye." + /* 6 */ ".dyyyyyyyd." + /* 7 */ ".cddzzzddc." + /* 8 */ "..........." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ ".dAAAdAAAd." + /* 4 */ ".A.......A." + /* 5 */ ".d.......d." + /* 6 */ ".A.......A." + /* 7 */ ".dAAAdAAAd." + /* 8 */ "...........", + + // Connectors: + "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // BarWithoutBasement + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // BlackSmith: + // The data has been exported from the gallery Desert, area index 92, ID 633, created by STR_Warrior + { + // Size: + 11, 5, 13, // SizeX = 11, SizeY = 5, SizeZ = 13 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 4, 12, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 0\n" /* sandstone */ + "d: 24: 2\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f: 43: 0\n" /* doubleslab */ + "g: 53: 5\n" /* woodstairs */ + "h: 53: 4\n" /* woodstairs */ + "i: 10: 0\n" /* lava */ + "j: 54: 5\n" /* chest */ + "k: 64:12\n" /* wooddoorblock */ + "l: 50: 3\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n:101: 0\n" /* ironbars */ + "o: 50: 1\n" /* torch */ + "p: 50: 2\n" /* torch */ + "q:128: 2\n" /* sandstonestairs */ + "r: 44: 9\n" /* step */ + "s:126: 8\n" /* woodenslab */ + "t:128: 4\n" /* sandstonestairs */ + "u:128: 5\n" /* sandstonestairs */ + "v:128: 7\n" /* sandstonestairs */ + "w: 44: 1\n" /* step */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaaaaaabaa" + /* 3 */ "acaaacabbba" + /* 4 */ "acaccaabbba" + /* 5 */ "acccccabbba" + /* 6 */ "acaadddbbba" + /* 7 */ "aaacdddbbba" + /* 8 */ "aaaadddbbba" + /* 9 */ "abbbbbbbbba" + /* 10 */ "abbbbbbbbba" + /* 11 */ "abbbbbbbbba" + /* 12 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "......d...d" + /* 1 */ "..........." + /* 2 */ "......dcecd" + /* 3 */ ".d....c...c" + /* 4 */ "......c...c" + /* 5 */ "...f..c...c" + /* 6 */ ".....dc...c" + /* 7 */ ".gh.dic...c" + /* 8 */ "dcccccd...c" + /* 9 */ "cj........c" + /* 10 */ "c.........c" + /* 11 */ "c.........c" + /* 12 */ "dcccccccccd" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "......d...d" + /* 1 */ "..........." + /* 2 */ "......dckcd" + /* 3 */ ".d....c..lc" + /* 4 */ "......n...c" + /* 5 */ "......c...c" + /* 6 */ "......c...n" + /* 7 */ "......c...n" + /* 8 */ "dcccccd...n" + /* 9 */ "co........c" + /* 10 */ "n.........c" + /* 11 */ "c........pc" + /* 12 */ "dcccnnncccd" + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "......q...q" + /* 1 */ "......c...c" + /* 2 */ "......dcccd" + /* 3 */ ".drrrrcsssc" + /* 4 */ ".rsssstsssc" + /* 5 */ ".rsssscsssc" + /* 6 */ ".rsssscsssu" + /* 7 */ ".rsssscsssu" + /* 8 */ "dcccccdsssu" + /* 9 */ "csssssssssc" + /* 10 */ "tsssssssssc" + /* 11 */ "csssssssssc" + /* 12 */ "dcccvvvcccd" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "......cwwwc" + /* 3 */ ".w.w.ww...w" + /* 4 */ "......w...w" + /* 5 */ ".w....w...w" + /* 6 */ "......w...w" + /* 7 */ ".w....w...c" + /* 8 */ "cwwwwwc...w" + /* 9 */ "w.........w" + /* 10 */ "w.........w" + /* 11 */ "w.........w" + /* 12 */ "cwwwwcwwwwc", + + // Connectors: + "-1: 8, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // BlackSmith + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LargeHouse1: + // The data has been exported from the gallery Desert, area index 77, ID 577, created by STR_Warrior + { + // Size: + 15, 13, 11, // SizeX = 15, SizeY = 13, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 12, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A:128: 2\n" /* sandstonestairs */ + "B:128: 0\n" /* sandstonestairs */ + "C: 87: 0\n" /* netherstone */ + "D:128: 3\n" /* sandstonestairs */ + "E: 51: 0\n" /* fire */ + "F: 44: 9\n" /* step */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 85: 0\n" /* fence */ + "f: 5: 1\n" /* wood */ + "g: 64: 2\n" /* wooddoorblock */ + "h: 64: 0\n" /* wooddoorblock */ + "i: 61: 2\n" /* furnace */ + "j:118: 0\n" /* cauldronblock */ + "k:134: 4\n" /* 134 */ + "l: 65: 2\n" /* ladder */ + "m: 19: 0\n" /* sponge */ + "n:101: 0\n" /* ironbars */ + "o:140: 0\n" /* flowerpotblock */ + "p: 64: 8\n" /* wooddoorblock */ + "q: 69:12\n" /* lever */ + "r: 44:10\n" /* step */ + "s:128: 1\n" /* sandstonestairs */ + "t: 47: 0\n" /* bookshelf */ + "u: 96:12\n" /* trapdoor */ + "v:128: 4\n" /* sandstonestairs */ + "w:128: 5\n" /* sandstonestairs */ + "x:128: 7\n" /* sandstonestairs */ + "y: 44: 1\n" /* step */ + "z:128: 6\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "aaaaaaaaaaaaaaa" + /* 1 */ "aaaaabbbbbbbaaa" + /* 2 */ "aaaabbbbbbbbaaa" + /* 3 */ "aaaaabbbbbbbbaa" + /* 4 */ "aaaaabbbbbbbaaa" + /* 5 */ "aaaaabbbbbbbaaa" + /* 6 */ "aaaaabbbbbbbaaa" + /* 7 */ "aaaaabbbbbbbaaa" + /* 8 */ "aaaaabbbbbbbaaa" + /* 9 */ "aaaaabbbbbbbaaa" + /* 10 */ "aaaaaaaaaaaaaaa" + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "....cdddddddc.." + /* 1 */ "eeeed......fd.c" + /* 2 */ "e...g.......d.." + /* 3 */ "e...d.......h.." + /* 4 */ "e...dijk..l.d.." + /* 5 */ "e...dddd.dddd.c" + /* 6 */ "eeeed.......d.." + /* 7 */ "mmmmd.......d.." + /* 8 */ "mmmmd.......d.." + /* 9 */ "mmmmd.......d.." + /* 10 */ "mmmmcdddddddc.." + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "....cddnnnddc.." + /* 1 */ "....d......od.c" + /* 2 */ "....p.......d.." + /* 3 */ "....d.......p.." + /* 4 */ "....d.q...l.d.." + /* 5 */ "....dddd.dddd.c" + /* 6 */ "....n.......n.." + /* 7 */ "mmmmn.......n.." + /* 8 */ "mmmmn.......n.." + /* 9 */ "mmmmd.......d.." + /* 10 */ "mmmmcddnnnddc.." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "....cdddddddc.." + /* 1 */ "....drrrrrrrdds" + /* 2 */ "....drrrrrrrd.." + /* 3 */ "....drrrrrrrd.." + /* 4 */ "....dtttrrurd.." + /* 5 */ "....dddddddddds" + /* 6 */ "....vrrrrrrrw.." + /* 7 */ "mmmmvrrrrrrrw.." + /* 8 */ "mmmmvrrrrrrrw.." + /* 9 */ "mmmmdrrrrrrrd.." + /* 10 */ "mmmmcddxxxddc.." + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "....dyyydyyyd.." + /* 1 */ "....ycdddddcy.." + /* 2 */ "....yd.....dy.." + /* 3 */ "....yd.....dy.." + /* 4 */ "....yd.....dy.." + /* 5 */ "....dcdd.ddcd.." + /* 6 */ "....y.......y.." + /* 7 */ "mmmmy.......y.." + /* 8 */ "mmmmy.......y.." + /* 9 */ "mmmmy.......y.." + /* 10 */ "mmmmdyyydyyyd.." + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".....cddnddc..." + /* 2 */ ".....n.....n..." + /* 3 */ ".....n.....n..." + /* 4 */ ".....n.....n..." + /* 5 */ ".....cdd.ddc..." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "..............." + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".....cddzddc..." + /* 2 */ ".....vrrrrrw..." + /* 3 */ ".....vrrrrrw..." + /* 4 */ ".....vrrrrrw..." + /* 5 */ ".....cdddddc..." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "..............." + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ ".....dyydyyd..." + /* 2 */ ".....y.ddd.y..." + /* 3 */ ".....d.ddd.d..." + /* 4 */ ".....y.ddd.y..." + /* 5 */ ".....dyydyyd..." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "..............." + + // Level 8 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ ".......cAc....." + /* 3 */ ".......BCs....." + /* 4 */ ".......cDc....." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "..............." + + // Level 9 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ ".......c.c....." + /* 3 */ "........E......" + /* 4 */ ".......c.c....." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "..............." + + // Level 10 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ ".......c.c....." + /* 3 */ "..............." + /* 4 */ ".......c.c....." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "..............." + + // Level 11 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ ".......ddd....." + /* 3 */ ".......dFd....." + /* 4 */ ".......ddd....." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "..............." + + // Level 12 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ ".......y.y....." + /* 3 */ "..............." + /* 4 */ ".......y.y....." + /* 5 */ "..............." + /* 6 */ "..............." + /* 7 */ "..............." + /* 8 */ "..............." + /* 9 */ "..............." + /* 10 */ "...............", + + // Connectors: + "-1: 14, 1, 3: 5\n" /* Type -1, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LargeHouse1 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LargeTower: + // The data has been exported from the gallery Desert, area index 80, ID 596, created by STR_Warrior + { + // Size: + 7, 11, 7, // SizeX = 7, SizeY = 11, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 10, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c:128: 2\n" /* sandstonestairs */ + "d:128: 0\n" /* sandstonestairs */ + "e: 24: 2\n" /* sandstone */ + "f: 24: 0\n" /* sandstone */ + "g: 71: 3\n" /* irondoorblock */ + "h:128: 1\n" /* sandstonestairs */ + "i:128: 3\n" /* sandstonestairs */ + "j: 77: 4\n" /* stonebutton */ + "k: 71: 8\n" /* irondoorblock */ + "l:128: 6\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:128: 4\n" /* sandstonestairs */ + "o:128: 5\n" /* sandstonestairs */ + "p: 50: 4\n" /* torch */ + "q:128: 7\n" /* sandstonestairs */ + "r: 85: 0\n" /* fence */ + "s: 24: 1\n" /* sandstone */ + "t: 44: 1\n" /* step */ + "u: 89: 0\n" /* lightstone */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaabaaa" + /* 2 */ "aabbbaa" + /* 3 */ "aabbbaa" + /* 4 */ "aabbbaa" + /* 5 */ "aaaaaaa" + /* 6 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "mc...cm" + /* 1 */ "defgfeh" + /* 2 */ ".f...f." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ "defffeh" + /* 6 */ "mi...im" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "m.j...m" + /* 1 */ ".efkfe." + /* 2 */ ".f...f." + /* 3 */ ".f...f." + /* 4 */ ".f...f." + /* 5 */ ".efffe." + /* 6 */ "m.....m" + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..lfl.." + /* 2 */ ".n...o." + /* 3 */ ".f...f." + /* 4 */ ".n.p.o." + /* 5 */ "..qfq.." + /* 6 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..frf.." + /* 2 */ ".f...f." + /* 3 */ ".r...r." + /* 4 */ ".f...f." + /* 5 */ "..frf.." + /* 6 */ "......." + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..frf.." + /* 2 */ ".f...f." + /* 3 */ ".r...r." + /* 4 */ ".f...f." + /* 5 */ "..frf.." + /* 6 */ "......." + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..frf.." + /* 2 */ ".f...f." + /* 3 */ ".r...r." + /* 4 */ ".f...f." + /* 5 */ "..frf.." + /* 6 */ "......." + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "..cfc.." + /* 2 */ ".d...h." + /* 3 */ ".f...f." + /* 4 */ ".d...h." + /* 5 */ "..ifi.." + /* 6 */ "......." + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ ".ffsff." + /* 2 */ ".f...f." + /* 3 */ ".s...s." + /* 4 */ ".f...f." + /* 5 */ ".ffsff." + /* 6 */ "......." + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "...l..." + /* 1 */ ".efffe." + /* 2 */ ".ftttf." + /* 3 */ "nftftfo" + /* 4 */ ".ftttf." + /* 5 */ ".efffe." + /* 6 */ "...q..." + + // Level 10 + /* z\x* 0123456 */ + /* 0 */ "...t..." + /* 1 */ ".t...t." + /* 2 */ "......." + /* 3 */ "t..u..t" + /* 4 */ "......." + /* 5 */ ".t...t." + /* 6 */ "...t...", + + // Connectors: + "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LargeTower + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LittleHouse: + // The data has been exported from the gallery Desert, area index 65, ID 551, created by STR_Warrior + { + // Size: + 5, 5, 7, // SizeX = 5, SizeY = 5, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 4, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 3\n" /* wooddoorblock */ + "f: 61: 2\n" /* furnace */ + "g: 65: 2\n" /* ladder */ + "h: 64: 8\n" /* wooddoorblock */ + "i:101: 0\n" /* ironbars */ + "j: 50: 4\n" /* torch */ + "k:128: 2\n" /* sandstonestairs */ + "l:126: 8\n" /* woodenslab */ + "m: 19: 0\n" /* sponge */ + "n:128: 4\n" /* sandstonestairs */ + "o:128: 5\n" /* sandstonestairs */ + "p:128: 7\n" /* sandstonestairs */ + "q: 44: 1\n" /* step */ + "r: 96: 6\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aaaaa" + /* 2 */ "aabaa" + /* 3 */ "abbba" + /* 4 */ "abbba" + /* 5 */ "abbba" + /* 6 */ "aaaaa" + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "c...c" + /* 1 */ "....." + /* 2 */ "cdedc" + /* 3 */ "d...d" + /* 4 */ "d...d" + /* 5 */ "df.gd" + /* 6 */ "cdddc" + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "c...c" + /* 1 */ "....." + /* 2 */ "cdhdc" + /* 3 */ "d...d" + /* 4 */ "i...i" + /* 5 */ "dj.gd" + /* 6 */ "cdidc" + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "k...k" + /* 1 */ "d...d" + /* 2 */ "cdddc" + /* 3 */ "dllld" + /* 4 */ "nlllo" + /* 5 */ "dllgd" + /* 6 */ "cdpdc" + + // Level 4 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "dqdqd" + /* 3 */ "q...q" + /* 4 */ "d...d" + /* 5 */ "q..rq" + /* 6 */ "dqdqd", + + // Connectors: + "-1: 2, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LittleHouse + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LittleHouse2: + // The data has been exported from the gallery Desert, area index 72, ID 562, created by STR_Warrior + { + // Size: + 7, 5, 11, // SizeX = 7, SizeY = 5, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 4, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 3\n" /* wooddoorblock */ + "f: 65: 5\n" /* ladder */ + "g: 85: 0\n" /* fence */ + "h:101: 0\n" /* ironbars */ + "i: 64: 8\n" /* wooddoorblock */ + "j: 50: 3\n" /* torch */ + "k:128: 2\n" /* sandstonestairs */ + "l:128: 6\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:126: 8\n" /* woodenslab */ + "o:128: 4\n" /* sandstonestairs */ + "p:128: 5\n" /* sandstonestairs */ + "q:128: 7\n" /* sandstonestairs */ + "r: 44: 1\n" /* step */ + "s: 96: 0\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaaaaaa" + /* 1 */ "aaaaaaa" + /* 2 */ "aaaabaa" + /* 3 */ "abbbbba" + /* 4 */ "abbbbba" + /* 5 */ "abbbbba" + /* 6 */ "aaaaaaa" + /* 7 */ "aaaaaaa" + /* 8 */ "aaaaaaa" + /* 9 */ "aaaaaaa" + /* 10 */ "aaaaaaa" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ ".c...c." + /* 1 */ "......." + /* 2 */ "cdddedc" + /* 3 */ "d.....d" + /* 4 */ "d.....d" + /* 5 */ "df....d" + /* 6 */ "cd.dddc" + /* 7 */ "g.....g" + /* 8 */ "g.....g" + /* 9 */ "g.....g" + /* 10 */ "ggggggg" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ ".c...c." + /* 1 */ "......." + /* 2 */ "cdhdidc" + /* 3 */ "d..j..d" + /* 4 */ "h.....h" + /* 5 */ "df....d" + /* 6 */ "cd.dhdc" + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ ".k...k." + /* 1 */ ".d...d." + /* 2 */ "cdldddc" + /* 3 */ "dnnnnnd" + /* 4 */ "onnnnnp" + /* 5 */ "dfnnnnd" + /* 6 */ "cdddqdc" + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ "......." + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "......." + /* 1 */ "......." + /* 2 */ "drrdrrd" + /* 3 */ "r.....r" + /* 4 */ "d.....d" + /* 5 */ "rs....r" + /* 6 */ "drrdrrd" + /* 7 */ "......." + /* 8 */ "......." + /* 9 */ "......." + /* 10 */ ".......", + + // Connectors: + "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LittleHouse2 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LittleHouse3: + // The data has been exported from the gallery Desert, area index 66, ID 553, created by STR_Warrior + { + // Size: + 9, 5, 7, // SizeX = 9, SizeY = 5, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 4, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f: 65: 2\n" /* ladder */ + "g: 64:12\n" /* wooddoorblock */ + "h:101: 0\n" /* ironbars */ + "i: 50: 4\n" /* torch */ + "j:128: 2\n" /* sandstonestairs */ + "k:126: 8\n" /* woodenslab */ + "l:128: 4\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:128: 5\n" /* sandstonestairs */ + "o:128: 7\n" /* sandstonestairs */ + "p: 44: 1\n" /* step */ + "q: 96: 2\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "aaaaaaaaa" + /* 1 */ "aaaaaaaaa" + /* 2 */ "aaaabaaaa" + /* 3 */ "abbbbbbba" + /* 4 */ "abbbbbbba" + /* 5 */ "abbbbbbba" + /* 6 */ "aaaaaaaaa" + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "..c...c.." + /* 1 */ "........." + /* 2 */ "cdddedddc" + /* 3 */ "d.......d" + /* 4 */ "d.......d" + /* 5 */ "d......fd" + /* 6 */ "cdddddddc" + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "..c...c.." + /* 1 */ "........." + /* 2 */ "cdddgdddc" + /* 3 */ "d.......d" + /* 4 */ "h.......h" + /* 5 */ "d.i....fd" + /* 6 */ "cddhhhddc" + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "..j...j.." + /* 1 */ "..d...d.." + /* 2 */ "cdddddddc" + /* 3 */ "dkkkkkkkd" + /* 4 */ "lkkkkkkkn" + /* 5 */ "dkkkkkkfd" + /* 6 */ "cddoooddc" + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "dpppdpppd" + /* 3 */ "p.......p" + /* 4 */ "d.......d" + /* 5 */ "p......qp" + /* 6 */ "dpppdpppd", + + // Connectors: + "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LittleHouse3 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LittleHouse4: + // The data has been exported from the gallery Desert, area index 70, ID 560, created by STR_Warrior + { + // Size: + 5, 5, 11, // SizeX = 5, SizeY = 5, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 4, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 3\n" /* wooddoorblock */ + "f: 65: 5\n" /* ladder */ + "g:134: 3\n" /* 134 */ + "h: 85: 0\n" /* fence */ + "i:134: 2\n" /* 134 */ + "j: 61: 2\n" /* furnace */ + "k:134: 6\n" /* 134 */ + "l:134: 4\n" /* 134 */ + "m: 19: 0\n" /* sponge */ + "n: 64: 8\n" /* wooddoorblock */ + "o: 50: 2\n" /* torch */ + "p:101: 0\n" /* ironbars */ + "q:171: 8\n" /* carpet */ + "r:128: 2\n" /* sandstonestairs */ + "s:126: 8\n" /* woodenslab */ + "t:128: 5\n" /* sandstonestairs */ + "u:128: 7\n" /* sandstonestairs */ + "v: 44: 1\n" /* step */ + "w: 96: 7\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aaaaa" + /* 2 */ "aabaa" + /* 3 */ "abbba" + /* 4 */ "abbba" + /* 5 */ "abbba" + /* 6 */ "abbba" + /* 7 */ "abbba" + /* 8 */ "abbba" + /* 9 */ "abbba" + /* 10 */ "aaaaa" + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "c...c" + /* 1 */ "....." + /* 2 */ "cdedc" + /* 3 */ "df..d" + /* 4 */ "d...d" + /* 5 */ "d..gd" + /* 6 */ "d..hd" + /* 7 */ "d..id" + /* 8 */ "d...d" + /* 9 */ "djkld" + /* 10 */ "cdddc" + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "c...c" + /* 1 */ "....." + /* 2 */ "cdndc" + /* 3 */ "df..d" + /* 4 */ "d..od" + /* 5 */ "p...p" + /* 6 */ "p..qp" + /* 7 */ "p...p" + /* 8 */ "d...d" + /* 9 */ "d...d" + /* 10 */ "cdpdc" + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "r...r" + /* 1 */ "d...d" + /* 2 */ "cdddc" + /* 3 */ "dfssd" + /* 4 */ "dsssd" + /* 5 */ "tssst" + /* 6 */ "tssst" + /* 7 */ "tssst" + /* 8 */ "dsssd" + /* 9 */ "dsssd" + /* 10 */ "cdudc" + + // Level 4 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "dvdvd" + /* 3 */ "vw..v" + /* 4 */ "v...v" + /* 5 */ "v...v" + /* 6 */ "d...d" + /* 7 */ "v...v" + /* 8 */ "v...v" + /* 9 */ "v...v" + /* 10 */ "dvdvd", + + // Connectors: + "-1: 2, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LittleHouse4 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LittleHouse5: + // The data has been exported from the gallery Desert, area index 68, ID 558, created by STR_Warrior + { + // Size: + 9, 5, 9, // SizeX = 9, SizeY = 5, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 4, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f: 65: 2\n" /* ladder */ + "g: 64:12\n" /* wooddoorblock */ + "h:101: 0\n" /* ironbars */ + "i: 50: 1\n" /* torch */ + "j: 50: 4\n" /* torch */ + "k:128: 2\n" /* sandstonestairs */ + "l:126: 8\n" /* woodenslab */ + "m: 19: 0\n" /* sponge */ + "n:128: 6\n" /* sandstonestairs */ + "o:128: 5\n" /* sandstonestairs */ + "p:128: 4\n" /* sandstonestairs */ + "q:128: 7\n" /* sandstonestairs */ + "r: 44: 1\n" /* step */ + "s: 96: 6\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "aaaaaaaaa" + /* 1 */ "aaaaaaaaa" + /* 2 */ "aaaaaabaa" + /* 3 */ "aaaaabbba" + /* 4 */ "aaaaabbba" + /* 5 */ "abbbbbbba" + /* 6 */ "abbbbbbba" + /* 7 */ "abbbbbbba" + /* 8 */ "aaaaaaaaa" + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "mmmmc...c" + /* 1 */ "mmmm....." + /* 2 */ "mmmmcdedc" + /* 3 */ "mmmmd...d" + /* 4 */ "cdddd...d" + /* 5 */ "d.......d" + /* 6 */ "d.......d" + /* 7 */ "d......fd" + /* 8 */ "cdddddddc" + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "mmmmc...c" + /* 1 */ "mmmm....." + /* 2 */ "mmmmcdgdc" + /* 3 */ "mmmmd...d" + /* 4 */ "cdhdd...h" + /* 5 */ "d.......h" + /* 6 */ "h.......d" + /* 7 */ "di....jfd" + /* 8 */ "cddhhhddc" + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "mmmmk...k" + /* 1 */ "mmmmd...d" + /* 2 */ "mmmmcdddc" + /* 3 */ "mmmmdllld" + /* 4 */ "cdnddlllo" + /* 5 */ "dlllllllo" + /* 6 */ "pllllllld" + /* 7 */ "dllllllfd" + /* 8 */ "cddqqqddc" + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "mmmm....." + /* 1 */ "mmmm....." + /* 2 */ "mmmmcrdrd" + /* 3 */ "mmmmr...r" + /* 4 */ "drrrd...d" + /* 5 */ "r.......r" + /* 6 */ "r.......r" + /* 7 */ "r......sr" + /* 8 */ "drrrdrrrd", + + // Connectors: + "-1: 6, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LittleHouse5 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LittleHouse6: + // The data has been exported from the gallery Desert, area index 69, ID 559, created by STR_Warrior + { + // Size: + 9, 5, 9, // SizeX = 9, SizeY = 5, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 4, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 2: 0\n" /* grass */ + "c: 5: 0\n" /* wood */ + "d: 85: 0\n" /* fence */ + "e: 24: 2\n" /* sandstone */ + "f: 24: 0\n" /* sandstone */ + "g: 64: 7\n" /* wooddoorblock */ + "h: 38: 1\n" /* rose */ + "i: 38: 2\n" /* rose */ + "j: 38: 5\n" /* rose */ + "k: 65: 2\n" /* ladder */ + "l: 64:12\n" /* wooddoorblock */ + "m: 19: 0\n" /* sponge */ + "n:101: 0\n" /* ironbars */ + "o: 50: 1\n" /* torch */ + "p: 50: 4\n" /* torch */ + "q:128: 2\n" /* sandstonestairs */ + "r:126: 8\n" /* woodenslab */ + "s:128: 6\n" /* sandstonestairs */ + "t:128: 5\n" /* sandstonestairs */ + "u:128: 4\n" /* sandstonestairs */ + "v:128: 7\n" /* sandstonestairs */ + "w: 44: 1\n" /* step */ + "x: 96: 6\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "aaaaaaaaa" + /* 1 */ "abbbaaaaa" + /* 2 */ "abbbaacaa" + /* 3 */ "abbbaccca" + /* 4 */ "aaaaaccca" + /* 5 */ "accccccca" + /* 6 */ "accccccca" + /* 7 */ "accccccca" + /* 8 */ "aaaaaaaaa" + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "dddde...e" + /* 1 */ "d........" + /* 2 */ "d...efgfe" + /* 3 */ "dhijf...f" + /* 4 */ "effff...f" + /* 5 */ "f.......f" + /* 6 */ "f.......f" + /* 7 */ "f......kf" + /* 8 */ "efffffffe" + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "....e...e" + /* 1 */ "........." + /* 2 */ "....eflfe" + /* 3 */ "....f...f" + /* 4 */ "efnff...n" + /* 5 */ "f.......n" + /* 6 */ "n.......f" + /* 7 */ "fo....pkf" + /* 8 */ "effnnnffe" + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "....q...q" + /* 1 */ "....f...f" + /* 2 */ "....efffe" + /* 3 */ "....frrrf" + /* 4 */ "efsffrrrt" + /* 5 */ "frrrrrrrt" + /* 6 */ "urrrrrrrf" + /* 7 */ "frrrrrrkf" + /* 8 */ "effvvvffe" + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "....ewfwf" + /* 3 */ "....w...w" + /* 4 */ "fwwwf...f" + /* 5 */ "w.......w" + /* 6 */ "w.......w" + /* 7 */ "w......xw" + /* 8 */ "fwwwfwwwf", + + // Connectors: + "-1: 6, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LittleHouse6 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LittleHouse7: + // The data has been exported from the gallery Desert, area index 73, ID 563, created by xoft + { + // Size: + 9, 5, 11, // SizeX = 9, SizeY = 5, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 4, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f: 65: 2\n" /* ladder */ + "g:101: 0\n" /* ironbars */ + "h: 64:12\n" /* wooddoorblock */ + "i: 50: 1\n" /* torch */ + "j: 50: 2\n" /* torch */ + "k:128: 2\n" /* sandstonestairs */ + "l:128: 6\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:126: 8\n" /* woodenslab */ + "o:128: 4\n" /* sandstonestairs */ + "p:128: 5\n" /* sandstonestairs */ + "q:128: 7\n" /* sandstonestairs */ + "r: 44: 1\n" /* step */ + "s: 96: 6\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "aaaaaaaaa" + /* 1 */ "aaaaaaaaa" + /* 2 */ "aaaaaabaa" + /* 3 */ "abbbbbbba" + /* 4 */ "abbbbbbba" + /* 5 */ "abbbbbbba" + /* 6 */ "aaaaabbba" + /* 7 */ "aaaaabbba" + /* 8 */ "aaaaabbba" + /* 9 */ "aaaaabbba" + /* 10 */ "aaaaaaaaa" + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "....c...c" + /* 1 */ "........." + /* 2 */ "cdddddedc" + /* 3 */ "d.......d" + /* 4 */ "d.......d" + /* 5 */ "d.......d" + /* 6 */ "cdddd...d" + /* 7 */ "mmmmd...d" + /* 8 */ "mmmmd...d" + /* 9 */ "mmmmd..fd" + /* 10 */ "mmmmddddc" + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "....c...c" + /* 1 */ "........." + /* 2 */ "cdgdddhdc" + /* 3 */ "d.......d" + /* 4 */ "g.......d" + /* 5 */ "di......g" + /* 6 */ "cdgdd...g" + /* 7 */ "mmmmd...g" + /* 8 */ "mmmmg..jd" + /* 9 */ "mmmmd..fd" + /* 10 */ "mmmmddgdc" + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "....k...k" + /* 1 */ "....d...d" + /* 2 */ "cdldddddc" + /* 3 */ "dnnnnnnnd" + /* 4 */ "onnnnnnnd" + /* 5 */ "dnnnnnnnp" + /* 6 */ "cdqddnnnp" + /* 7 */ "mmmmdnnnp" + /* 8 */ "mmmmonnnd" + /* 9 */ "mmmmdnnfd" + /* 10 */ "mmmmddqdc" + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "........." + /* 1 */ "........." + /* 2 */ "drrrdrdrd" + /* 3 */ "r.......r" + /* 4 */ "r.......r" + /* 5 */ "r.......r" + /* 6 */ "drrrd...d" + /* 7 */ "mmmmr...r" + /* 8 */ "mmmmr...r" + /* 9 */ "mmmmr..sr" + /* 10 */ "mmmmdrrrd", + + // Connectors: + "-1: 6, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LittleHouse7 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // LittleTower: + // The data has been exported from the gallery Desert, area index 79, ID 595, created by STR_Warrior + { + // Size: + 5, 8, 7, // SizeX = 5, SizeY = 8, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 7, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f: 65: 5\n" /* ladder */ + "g: 64:12\n" /* wooddoorblock */ + "h:101: 0\n" /* ironbars */ + "i: 50: 4\n" /* torch */ + "j:128: 2\n" /* sandstonestairs */ + "k:126: 8\n" /* woodenslab */ + "l:128: 4\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:128: 5\n" /* sandstonestairs */ + "o:128: 7\n" /* sandstonestairs */ + "p:128: 6\n" /* sandstonestairs */ + "q: 44: 1\n" /* step */ + "r: 96: 5\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aaaaa" + /* 2 */ "aabaa" + /* 3 */ "abbba" + /* 4 */ "abbba" + /* 5 */ "abbba" + /* 6 */ "aaaaa" + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "c...c" + /* 1 */ "....." + /* 2 */ "cdedc" + /* 3 */ "df..d" + /* 4 */ "d...d" + /* 5 */ "d...d" + /* 6 */ "cdddc" + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "c...c" + /* 1 */ "....." + /* 2 */ "cdgdc" + /* 3 */ "df..d" + /* 4 */ "h...h" + /* 5 */ "d..id" + /* 6 */ "cdhdc" + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "j...j" + /* 1 */ "d...d" + /* 2 */ "cdddc" + /* 3 */ "dfkkd" + /* 4 */ "lkkkn" + /* 5 */ "dkkkd" + /* 6 */ "cdodc" + + // Level 4 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "cdddc" + /* 3 */ "df..d" + /* 4 */ "d...d" + /* 5 */ "d...d" + /* 6 */ "cdddc" + + // Level 5 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "cdhdc" + /* 3 */ "df..d" + /* 4 */ "h...h" + /* 5 */ "d..id" + /* 6 */ "cdhdc" + + // Level 6 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "cdpdc" + /* 3 */ "dfkkd" + /* 4 */ "lkkkn" + /* 5 */ "dkkkd" + /* 6 */ "cdodc" + + // Level 7 + /* z\x* 01234 */ + /* 0 */ "....." + /* 1 */ "....." + /* 2 */ "dqdqd" + /* 3 */ "qr..q" + /* 4 */ "d...d" + /* 5 */ "q...q" + /* 6 */ "dqdqd", + + // Connectors: + "-1: 2, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // LittleTower + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MediumHouse1: + // The data has been exported from the gallery Desert, area index 71, ID 561, created by STR_Warrior + { + // Size: + 15, 8, 9, // SizeX = 15, SizeY = 8, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 7, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 3\n" /* wooddoorblock */ + "f: 85: 0\n" /* fence */ + "g: 64: 0\n" /* wooddoorblock */ + "h: 65: 5\n" /* ladder */ + "i: 64: 8\n" /* wooddoorblock */ + "j:101: 0\n" /* ironbars */ + "k: 50: 4\n" /* torch */ + "l:128: 2\n" /* sandstonestairs */ + "m: 19: 0\n" /* sponge */ + "n:126: 8\n" /* woodenslab */ + "o:128: 4\n" /* sandstonestairs */ + "p:128: 7\n" /* sandstonestairs */ + "q: 44: 1\n" /* step */ + "r: 50: 3\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "aaaaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaaaa" + /* 2 */ "aaaaabaaaaaaaaa" + /* 3 */ "abbbbbbbbbaaaaa" + /* 4 */ "abbbbbbbbbaaaaa" + /* 5 */ "abbbbbbbbbbaaaa" + /* 6 */ "abbbbbbbbbaaaaa" + /* 7 */ "abbbbbbbbbaaaaa" + /* 8 */ "aaaaaaaaaaaaaaa" + + // Level 1 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "...c...c......." + /* 1 */ "..............." + /* 2 */ "cddddeddddcffff" + /* 3 */ "d.........d...f" + /* 4 */ "d.........d...f" + /* 5 */ "d.........g...f" + /* 6 */ "d.........d...f" + /* 7 */ "d.........dh..f" + /* 8 */ "cdddddddddcffff" + + // Level 2 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "...c...c......." + /* 1 */ "..............." + /* 2 */ "cddddiddddc...." + /* 3 */ "d.........d...." + /* 4 */ "j.........d...." + /* 5 */ "j.........i...." + /* 6 */ "j.........d...." + /* 7 */ "d..k...k..dh..." + /* 8 */ "cdddjjjdddc...." + + // Level 3 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "...l...l......." + /* 1 */ "...d...d......." + /* 2 */ "cdddddddddc...." + /* 3 */ "dnnnnnnnnnd...." + /* 4 */ "onnnnnnnnnd...." + /* 5 */ "onnnnnnnnnd...." + /* 6 */ "onnnnnnnnnd...." + /* 7 */ "dnnnnnnnnndh..." + /* 8 */ "cdddpppdddc...." + + // Level 4 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "dqqqqdqqqqd...." + /* 3 */ "q..cdddc..q...." + /* 4 */ "q..d...d..q...." + /* 5 */ "d.........d...." + /* 6 */ "q..d...d..q...." + /* 7 */ "q..cdddc..q...." + /* 8 */ "dqqqqdqqqqd...." + + // Level 5 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "...cdjdc......." + /* 4 */ "...dr..d......." + /* 5 */ "..............." + /* 6 */ "...d...d......." + /* 7 */ "...cdjdc......." + /* 8 */ "..............." + + // Level 6 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "...cdddc......." + /* 4 */ "...dnnnd......." + /* 5 */ "...dnnnd......." + /* 6 */ "...dnnnd......." + /* 7 */ "...cdddc......." + /* 8 */ "..............." + + // Level 7 + /* z\x* 11111 */ + /* * 012345678901234 */ + /* 0 */ "..............." + /* 1 */ "..............." + /* 2 */ "..............." + /* 3 */ "...dqdqd......." + /* 4 */ "...q...q......." + /* 5 */ "...d...d......." + /* 6 */ "...q...q......." + /* 7 */ "...dqdqd......." + /* 8 */ "...............", + + // Connectors: + "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // MediumHouse1 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MediumHouse2: + // The data has been exported from the gallery Desert, area index 74, ID 573, created by STR_Warrior + { + // Size: + 11, 9, 9, // SizeX = 11, SizeY = 9, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 8, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A: 96: 3\n" /* trapdoor */ + "B: 96: 6\n" /* trapdoor */ + "C:128: 2\n" /* sandstonestairs */ + "D:128: 0\n" /* sandstonestairs */ + "E: 87: 0\n" /* netherstone */ + "F:128: 1\n" /* sandstonestairs */ + "G:128: 3\n" /* sandstonestairs */ + "H: 51: 0\n" /* fire */ + "I: 44: 9\n" /* step */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 65: 3\n" /* ladder */ + "f: 85: 0\n" /* fence */ + "g: 64: 7\n" /* wooddoorblock */ + "h:134: 1\n" /* 134 */ + "i:134: 2\n" /* 134 */ + "j: 61: 2\n" /* furnace */ + "k:134: 6\n" /* 134 */ + "l:134: 4\n" /* 134 */ + "m: 19: 0\n" /* sponge */ + "n: 65: 2\n" /* ladder */ + "o:101: 0\n" /* ironbars */ + "p: 50: 2\n" /* torch */ + "q: 47: 0\n" /* bookshelf */ + "r: 64:12\n" /* wooddoorblock */ + "s: 50: 3\n" /* torch */ + "t:171: 8\n" /* carpet */ + "u:128: 6\n" /* sandstonestairs */ + "v:126: 8\n" /* woodenslab */ + "w:128: 5\n" /* sandstonestairs */ + "x:128: 4\n" /* sandstonestairs */ + "y:128: 7\n" /* sandstonestairs */ + "z: 44: 1\n" /* step */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "abbbaaaaaaa" + /* 2 */ "abbbaaaaaaa" + /* 3 */ "abbbaaaaaaa" + /* 4 */ "abbbaaaabaa" + /* 5 */ "abbbbbbbbba" + /* 6 */ "abbbbbbbbba" + /* 7 */ "abbbbbbbbba" + /* 8 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "cdddc......" + /* 1 */ "de..dfff.f." + /* 2 */ "d...d....f." + /* 3 */ "d...d....f." + /* 4 */ "d...ddddgdc" + /* 5 */ "d.........d" + /* 6 */ "dhf.......d" + /* 7 */ "dhi.jkl..nd" + /* 8 */ "cdddddddddc" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "cdodc......" + /* 1 */ "de..o......" + /* 2 */ "d...o......" + /* 3 */ "o..pd......" + /* 4 */ "o...qdodrdc" + /* 5 */ "o......s..d" + /* 6 */ "d.t.......o" + /* 7 */ "d........nd" + /* 8 */ "cdddooodddc" + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "cdudc......" + /* 1 */ "devvw......" + /* 2 */ "dvvvw......" + /* 3 */ "xvvvd......" + /* 4 */ "xvvvddudddc" + /* 5 */ "xvvvvvvvvvd" + /* 6 */ "dvvvvvvvvvw" + /* 7 */ "dvvvqqqvvnd" + /* 8 */ "cdddyyydddc" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "dzzzd......" + /* 1 */ "zA..z......" + /* 2 */ "z...z......" + /* 3 */ "z...z......" + /* 4 */ "d...dzzzzzd" + /* 5 */ "zddd......z" + /* 6 */ "zddd......z" + /* 7 */ "zddd.....Bz" + /* 8 */ "dzzzzdzzzzd" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "..........." + /* 4 */ "..........." + /* 5 */ ".cCc......." + /* 6 */ ".DEF......." + /* 7 */ ".cGc......." + /* 8 */ "..........." + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "..........." + /* 4 */ "..........." + /* 5 */ ".c.c......." + /* 6 */ "..H........" + /* 7 */ ".c.c......." + /* 8 */ "..........." + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "..........." + /* 4 */ "..........." + /* 5 */ ".ddd......." + /* 6 */ ".dId......." + /* 7 */ ".ddd......." + /* 8 */ "..........." + + // Level 8 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..........." + /* 1 */ "..........." + /* 2 */ "..........." + /* 3 */ "..........." + /* 4 */ "..........." + /* 5 */ ".z.z......." + /* 6 */ "..........." + /* 7 */ ".z.z......." + /* 8 */ "...........", + + // Connectors: + "-1: 8, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // MediumHouse2 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MediumHouse3: + // The data has been exported from the gallery Desert, area index 76, ID 575, created by STR_Warrior + { + // Size: + 12, 10, 11, // SizeX = 12, SizeY = 10, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 11, 9, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 3: 0\n" /* dirt */ + "c: 2: 0\n" /* grass */ + "d: 5: 0\n" /* wood */ + "e: 24: 0\n" /* sandstone */ + "f: 24: 2\n" /* sandstone */ + "g: 85: 0\n" /* fence */ + "h: 64: 3\n" /* wooddoorblock */ + "i: 64: 6\n" /* wooddoorblock */ + "j: 65: 4\n" /* ladder */ + "k: 65: 2\n" /* ladder */ + "l: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 50: 2\n" /* torch */ + "o:101: 0\n" /* ironbars */ + "p: 64: 8\n" /* wooddoorblock */ + "q: 64:12\n" /* wooddoorblock */ + "r:128: 2\n" /* sandstonestairs */ + "s:128: 6\n" /* sandstonestairs */ + "t:126: 8\n" /* woodenslab */ + "u:128: 5\n" /* sandstonestairs */ + "v:128: 7\n" /* sandstonestairs */ + "w: 44: 1\n" /* step */ + "x: 96: 6\n" /* trapdoor */ + "y:126: 0\n" /* woodenslab */ + "z:128: 4\n" /* sandstonestairs */, + + // Block data: + // Level 0 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "aaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaa" + /* 2 */ "bbbbbaaaaaaa" + /* 3 */ "bbbbbaaaaaaa" + /* 4 */ "bbbbbaaaaaaa" + /* 5 */ "bbbbbaaaaaaa" + /* 6 */ "bbbaaaaaaaaa" + /* 7 */ "aaaaaaaaaaaa" + /* 8 */ "aaaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaaa" + /* 10 */ "aaaaaaaaaaaa" + + // Level 1 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "aaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaa" + /* 2 */ "cccccaaaadaa" + /* 3 */ "cccccaddddda" + /* 4 */ "cccccdddddda" + /* 5 */ "cccccaddddda" + /* 6 */ "cccaadddddda" + /* 7 */ "aaaaddddddda" + /* 8 */ "aaaadddaaaaa" + /* 9 */ "aaaadddaaaaa" + /* 10 */ "aaaaaaaaaaaa" + + // Level 2 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ ".....e.....f" + /* 1 */ "............" + /* 2 */ "gggggfeeehef" + /* 3 */ "g....e.....e" + /* 4 */ "g....i.....e" + /* 5 */ "g....e.....e" + /* 6 */ "gggfe......e" + /* 7 */ "mmme......je" + /* 8 */ "mmme...eeeef" + /* 9 */ "mmme..kemmmm" + /* 10 */ "mmmfeeefmmmm" + + // Level 3 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ ".....el...nf" + /* 1 */ "............" + /* 2 */ ".....fooepef" + /* 3 */ ".....e.....e" + /* 4 */ ".....q.....e" + /* 5 */ ".....e.....o" + /* 6 */ "...ge......e" + /* 7 */ "mmme......je" + /* 8 */ "mmme...eeoof" + /* 9 */ "mmme..kemmmm" + /* 10 */ "mmmgeeegmmmm" + + // Level 4 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ ".....r.....r" + /* 1 */ ".....e.....e" + /* 2 */ ".....fsseeef" + /* 3 */ ".....ettttte" + /* 4 */ ".....ettttte" + /* 5 */ ".....etttttu" + /* 6 */ "...getttttte" + /* 7 */ "mmmettttttje" + /* 8 */ "mmmettteevvf" + /* 9 */ "mmmettkemmmm" + /* 10 */ "mmmgeeegmmmm" + + // Level 5 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ ".....ewwewwe" + /* 3 */ ".....w.....w" + /* 4 */ ".....w.....w" + /* 5 */ ".....w.....e" + /* 6 */ "...geeeg...w" + /* 7 */ "mmme...e..xw" + /* 8 */ "mmme...ewwwe" + /* 9 */ "mmme..kemmmm" + /* 10 */ "mmmgeeegmmmm" + + // Level 6 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "............" + /* 4 */ "............" + /* 5 */ "............" + /* 6 */ "...ge.eg...." + /* 7 */ "mmme...e...." + /* 8 */ "mmmo........" + /* 9 */ "mmme..kemmmm" + /* 10 */ "mmmgeoegmmmm" + + // Level 7 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "............" + /* 4 */ "............" + /* 5 */ "............" + /* 6 */ "...ge.eg...." + /* 7 */ "mmme...e...." + /* 8 */ "mmmo........" + /* 9 */ "mmmel.kemmmm" + /* 10 */ "mmmgeoegmmmm" + + // Level 8 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "............" + /* 4 */ "............" + /* 5 */ "............" + /* 6 */ "...fesef...." + /* 7 */ "mmmeyyye...." + /* 8 */ "mmmzyyyu...." + /* 9 */ "mmmeyykemmmm" + /* 10 */ "mmmfevefmmmm" + + // Level 9 + /* z\x* 11 */ + /* * 012345678901 */ + /* 0 */ "............" + /* 1 */ "............" + /* 2 */ "............" + /* 3 */ "............" + /* 4 */ "............" + /* 5 */ "............" + /* 6 */ "...w.w.w...." + /* 7 */ "mmm........." + /* 8 */ "mmmw...w...." + /* 9 */ "mmm.....mmmm" + /* 10 */ "mmmw.w.wmmmm", + + // Connectors: + "-1: 9, 2, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // MediumHouse3 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // SmallHouse9: + // The data has been exported from the gallery Desert, area index 67, ID 556, created by STR_Warrior + { + // Size: + 9, 5, 11, // SizeX = 9, SizeY = 5, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 4, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f: 65: 2\n" /* ladder */ + "g: 64:12\n" /* wooddoorblock */ + "h:101: 0\n" /* ironbars */ + "i: 50: 2\n" /* torch */ + "j: 50: 1\n" /* torch */ + "k:128: 2\n" /* sandstonestairs */ + "l:126: 8\n" /* woodenslab */ + "m: 19: 0\n" /* sponge */ + "n:128: 5\n" /* sandstonestairs */ + "o:128: 6\n" /* sandstonestairs */ + "p:128: 4\n" /* sandstonestairs */ + "q:128: 7\n" /* sandstonestairs */ + "r: 44: 1\n" /* step */ + "s: 96: 6\n" /* trapdoor */, + + // Block data: + // Level 0 + /* z\x* 012345678 */ + /* 0 */ "aaaaaaaaa" + /* 1 */ "aaaaaaaaa" + /* 2 */ "aaaaaabaa" + /* 3 */ "aaaaabbba" + /* 4 */ "aaaaabbba" + /* 5 */ "aaaaabbba" + /* 6 */ "aaaaabbba" + /* 7 */ "abbbbbbba" + /* 8 */ "abbbbbbba" + /* 9 */ "abbbbbbba" + /* 10 */ "aaaaaaaaa" + + // Level 1 + /* z\x* 012345678 */ + /* 0 */ "mmmmc...c" + /* 1 */ "mmmm....." + /* 2 */ "mmmmcdedc" + /* 3 */ "mmmmd...d" + /* 4 */ "mmmmd...d" + /* 5 */ "mmmmd...d" + /* 6 */ "cdddd...d" + /* 7 */ "d.......d" + /* 8 */ "d.......d" + /* 9 */ "d......fd" + /* 10 */ "cdddddddc" + + // Level 2 + /* z\x* 012345678 */ + /* 0 */ "mmmmc...c" + /* 1 */ "mmmm....." + /* 2 */ "mmmmcdgdc" + /* 3 */ "mmmmd...d" + /* 4 */ "mmmmd...d" + /* 5 */ "mmmmd...h" + /* 6 */ "cdhdd...h" + /* 7 */ "d.......h" + /* 8 */ "h......id" + /* 9 */ "dj.....fd" + /* 10 */ "cddhhhddc" + + // Level 3 + /* z\x* 012345678 */ + /* 0 */ "mmmmk...k" + /* 1 */ "mmmmd...d" + /* 2 */ "mmmmcdddc" + /* 3 */ "mmmmdllld" + /* 4 */ "mmmmdllld" + /* 5 */ "mmmmdllln" + /* 6 */ "cdoddllln" + /* 7 */ "dllllllln" + /* 8 */ "pllllllld" + /* 9 */ "dllllllfd" + /* 10 */ "cddqqqddc" + + // Level 4 + /* z\x* 012345678 */ + /* 0 */ "mmmm....." + /* 1 */ "mmmm....." + /* 2 */ "mmmmcrdrd" + /* 3 */ "mmmmr...r" + /* 4 */ "mmmmr...r" + /* 5 */ "mmmmr...r" + /* 6 */ "drrrd...d" + /* 7 */ "r.......r" + /* 8 */ "r.......r" + /* 9 */ "r......sr" + /* 10 */ "drrrdrrrd", + + // Connectors: + "-1: 6, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // SmallHouse9 +}; // g_AlchemistVillagePrefabs + + + + + + +const cPrefab::sDef g_AlchemistVillageStartingPrefabs[] = +{ + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Well: + // The data has been exported from the gallery Desert, area index 90, ID 631, created by STR_Warrior + { + // Size: + 5, 21, 5, // SizeX = 5, SizeY = 21, SizeZ = 5 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 20, 4, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 1: 0\n" /* stone */ + "b: 24: 0\n" /* sandstone */ + "c: 8: 0\n" /* water */ + "d: 24: 2\n" /* sandstone */ + "e:128: 1\n" /* sandstonestairs */ + "f: 44: 1\n" /* step */ + "g:128: 0\n" /* sandstonestairs */ + "h:128: 3\n" /* sandstonestairs */ + "i:128: 2\n" /* sandstonestairs */ + "j: 44: 9\n" /* step */ + "k:126: 0\n" /* woodenslab */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 01234 */ + /* 0 */ "aaaaa" + /* 1 */ "aaaaa" + /* 2 */ "aaaaa" + /* 3 */ "aaaaa" + /* 4 */ "aaaaa" + + // Level 1 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 2 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 3 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 4 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 5 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 6 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 7 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 8 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 9 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 10 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 11 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 12 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 13 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 14 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 15 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bcccb" + /* 2 */ "bcccb" + /* 3 */ "bcccb" + /* 4 */ "bbbbb" + + // Level 16 + /* z\x* 01234 */ + /* 0 */ "defgd" + /* 1 */ "h...h" + /* 2 */ "f...f" + /* 3 */ "i...i" + /* 4 */ "defgd" + + // Level 17 + /* z\x* 01234 */ + /* 0 */ "d...d" + /* 1 */ "....." + /* 2 */ "....." + /* 3 */ "....." + /* 4 */ "d...d" + + // Level 18 + /* z\x* 01234 */ + /* 0 */ "djjjd" + /* 1 */ "j...j" + /* 2 */ "j...j" + /* 3 */ "j...j" + /* 4 */ "djjjd" + + // Level 19 + /* z\x* 01234 */ + /* 0 */ "bbbbb" + /* 1 */ "bkkkb" + /* 2 */ "bkkkb" + /* 3 */ "bkkkb" + /* 4 */ "bbbbb" + + // Level 20 + /* z\x* 01234 */ + /* 0 */ "f.f.f" + /* 1 */ "....." + /* 2 */ "f...f" + /* 3 */ "....." + /* 4 */ "f.f.f", + + // Connectors: + "2: 2, 16, 4: 3\n" /* Type 2, direction Z+ */ + "2: 0, 16, 2: 4\n" /* Type 2, direction X- */ + "2: 2, 16, 0: 2\n" /* Type 2, direction Z- */ + "2: 4, 16, 2: 5\n" /* Type 2, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // Well +}; + + + + + +// The prefab counts: + +const size_t g_AlchemistVillagePrefabsCount = ARRAYCOUNT(g_AlchemistVillagePrefabs); + +const size_t g_AlchemistVillageStartingPrefabsCount = ARRAYCOUNT(g_AlchemistVillageStartingPrefabs); + diff --git a/src/Generating/Prefabs/AlchemistVillagePrefabs.h b/src/Generating/Prefabs/AlchemistVillagePrefabs.h new file mode 100644 index 000000000..dddc5530a --- /dev/null +++ b/src/Generating/Prefabs/AlchemistVillagePrefabs.h @@ -0,0 +1,15 @@ + +// AlchemistVillagePrefabs.h + +// Declares the prefabs in the group AlchemistVillage + +#include "../Prefab.h" + + + + + +extern const cPrefab::sDef g_AlchemistVillagePrefabs[]; +extern const cPrefab::sDef g_AlchemistVillageStartingPrefabs[]; +extern const size_t g_AlchemistVillagePrefabsCount; +extern const size_t g_AlchemistVillageStartingPrefabsCount; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index cb1f4fe0d..dfcdf6ef7 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -5,6 +5,7 @@ #include "Globals.h" #include "VillageGen.h" +#include "Prefabs/AlchemistVillagePrefabs.h" #include "Prefabs/JapaneseVillagePrefabs.h" #include "Prefabs/PlainsVillagePrefabs.h" #include "Prefabs/SandVillagePrefabs.h" @@ -274,6 +275,12 @@ protected: } + virtual int GetStartingPieceWeight(const cPiece & a_NewPiece) override + { + return m_Prefabs.GetStartingPieceWeight(a_NewPiece); + } + + virtual void PiecePlaced(const cPiece & a_Piece) override { m_Prefabs.PiecePlaced(a_Piece); @@ -311,18 +318,25 @@ protected: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cVillageGen: -/** The prefabs for the sand village. */ static cVillagePiecePool g_SandVillage(g_SandVillagePrefabs, g_SandVillagePrefabsCount, g_SandVillageStartingPrefabs, g_SandVillageStartingPrefabsCount); - -/** The prefabs for the flat-roofed sand village. */ static cVillagePiecePool g_SandFlatRoofVillage(g_SandFlatRoofVillagePrefabs, g_SandFlatRoofVillagePrefabsCount, g_SandFlatRoofVillageStartingPrefabs, g_SandFlatRoofVillageStartingPrefabsCount); - -/** The prefabs for the plains village. */ +static cVillagePiecePool g_AlchemistVillage(g_AlchemistVillagePrefabs, g_AlchemistVillagePrefabsCount, g_AlchemistVillageStartingPrefabs, g_AlchemistVillageStartingPrefabsCount); static cVillagePiecePool g_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVillagePrefabsCount, g_PlainsVillageStartingPrefabs, g_PlainsVillageStartingPrefabsCount); - -/** The prefabs for the Japanese village. */ static cVillagePiecePool g_JapaneseVillage(g_JapaneseVillagePrefabs, g_JapaneseVillagePrefabsCount, g_JapaneseVillageStartingPrefabs, g_JapaneseVillageStartingPrefabsCount); +static cVillagePiecePool * g_DesertVillagePools[] = +{ + &g_SandVillage, + &g_SandFlatRoofVillage, + &g_AlchemistVillage, +} ; + +static cVillagePiecePool * g_PlainsVillagePools[] = +{ + &g_PlainsVillage, + &g_JapaneseVillage, +} ; + @@ -356,8 +370,8 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_OriginX, int a_ cVillagePiecePool * VillagePrefabs = NULL; BLOCKTYPE RoadBlock = E_BLOCK_GRAVEL; int rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 11; - cVillagePiecePool * PlainsVillage = (rnd % 2 == 0) ? &g_PlainsVillage : &g_JapaneseVillage; - cVillagePiecePool * DesertVillage = (rnd % 2 == 0) ? &g_SandVillage : &g_SandFlatRoofVillage; + cVillagePiecePool * PlainsVillage = g_PlainsVillagePools[rnd % ARRAYCOUNT(g_PlainsVillagePools)]; + cVillagePiecePool * DesertVillage = g_DesertVillagePools[rnd % ARRAYCOUNT(g_DesertVillagePools)]; for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) { switch (Biomes[i]) From 5a9e49fbeb582e47df7359d351fe952dcb0f536b Mon Sep 17 00:00:00 2001 From: worktycho Date: Wed, 28 May 2014 11:49:36 +0100 Subject: [PATCH 178/214] Fix cmake errors in msvc --- SetFlags.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SetFlags.cmake b/SetFlags.cmake index d9d0409e2..6e2417a51 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -184,7 +184,11 @@ macro(enable_profile) CMAKE_EXE_LINKER_FLAGS_RELEASEPROFILE CMAKE_SHARED_LINKER_FLAGS_RELEASEPROFILE ) # The configuration types need to be set after their respective c/cxx/linker flags and before the project directive - set(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugProfile;ReleaseProfile;Coverage" CACHE STRING "" FORCE) + if(MSVC) + set(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugProfile;ReleaseProfile" CACHE STRING "" FORCE) + else() + set(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugProfile;ReleaseProfile;Coverage" CACHE STRING "" FORCE) + endif() endmacro() macro(set_exe_flags) From d29b242674fbf89035c8908753496522edf8eaee Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 28 May 2014 16:33:10 +0200 Subject: [PATCH 179/214] Fixed a memory leak in cPrefabPiecePool. The pool pieces weren't freed upon pool destruction. --- src/Generating/PrefabPiecePool.cpp | 28 ++++++++++++++++++++++++++++ src/Generating/PrefabPiecePool.h | 7 ++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp index ed9340815..145474bcc 100644 --- a/src/Generating/PrefabPiecePool.cpp +++ b/src/Generating/PrefabPiecePool.cpp @@ -26,6 +26,34 @@ cPrefabPiecePool::cPrefabPiecePool( +cPrefabPiecePool::~cPrefabPiecePool() +{ + Clear(); +} + + + + + +void cPrefabPiecePool::Clear(void) +{ + m_PiecesByConnector.clear(); + for (cPieces::iterator itr = m_AllPieces.begin(), end = m_AllPieces.end(); itr != end; ++itr) + { + delete *itr; + } + m_AllPieces.clear(); + for (cPieces::iterator itr = m_StartingPieces.begin(), end = m_StartingPieces.end(); itr != end; ++itr) + { + delete *itr; + } + m_StartingPieces.clear(); +} + + + + + void cPrefabPiecePool::AddPieceDefs(const cPrefab::sDef * a_PieceDefs, size_t a_NumPieceDefs) { ASSERT(a_PieceDefs != NULL); diff --git a/src/Generating/PrefabPiecePool.h b/src/Generating/PrefabPiecePool.h index c6a5ad360..50ae63c0c 100644 --- a/src/Generating/PrefabPiecePool.h +++ b/src/Generating/PrefabPiecePool.h @@ -34,6 +34,12 @@ public: const cPrefab::sDef * a_StartingPieceDefs, size_t a_NumStartingPieceDefs ); + /** Destroys the pool, freeing all pieces. */ + ~cPrefabPiecePool(); + + /** Removes and frees all pieces from this pool. */ + void Clear(void); + /** Adds pieces from the specified definitions into m_AllPieces. Also adds the pieces into the m_PiecesByConnector map. May be called multiple times with different PieceDefs, will add all such pieces. */ @@ -44,7 +50,6 @@ public: May be called multiple times with different PieceDefs, will add all such pieces. */ void AddStartingPieceDefs(const cPrefab::sDef * a_StartingPieceDefs, size_t a_NumStartingPieceDefs); - protected: /** The type used to map a connector type to the list of pieces with that connector */ From 7ec44951a0841734be53e81088dcdbc79a104d02 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 28 May 2014 11:35:55 +0200 Subject: [PATCH 180/214] Fixed cChunkData formatting. --- src/ChunkData.cpp | 118 +++++++++++++++++++++++++++++++++++----------- src/ChunkData.h | 22 ++++----- 2 files changed, 101 insertions(+), 39 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index c41dcb265..8aed62000 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -5,64 +5,86 @@ cChunkData::cChunkData() #if __cplusplus < 201103L // auto_ptr style interface for memory management - : IsOwner(true) + : m_IsOwner(true) #endif { - memset(m_Sections, 0, sizeof(m_Sections)); + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + m_Sections[i] = NULL; + } } + + + cChunkData::~cChunkData() { #if __cplusplus < 201103L // auto_ptr style interface for memory management - if (!IsOwner) + if (!m_IsOwner) { return; } #endif for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - if (m_Sections[i] == NULL) Free(m_Sections[i]);; + Free(m_Sections[i]); } } + + + + #if __cplusplus < 201103L // auto_ptr style interface for memory management - cChunkData::cChunkData(const cChunkData& other) : - IsOwner(true) + cChunkData::cChunkData(const cChunkData & a_Other) : + m_IsOwner(true) { + // Move contents and ownership from a_Other to this, pointer-wise: for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - m_Sections[i] = other.m_Sections[i]; + m_Sections[i] = a_Other.m_Sections[i]; } - other.IsOwner = false; + a_Other.m_IsOwner = false; } - cChunkData& cChunkData::operator=(const cChunkData& other) + + + + + cChunkData & cChunkData::operator =(const cChunkData & a_Other) { - if (&other != this) + // If assigning to self, no-op + if (&a_Other == this) + { + return *this; + } + + // Free any currently held contents: + if (m_IsOwner) { - if (IsOwner) - { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) - { - if (m_Sections[i]) Free(m_Sections[i]);; - } - } - IsOwner = true; for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - m_Sections[i] = other.m_Sections[i]; + Free(m_Sections[i]); } - other.IsOwner = false; } + + // Move contents and ownership from a_Other to this, pointer-wise: + m_IsOwner = true; + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + { + m_Sections[i] = a_Other.m_Sections[i]; + } + a_Other.m_IsOwner = false; return *this; - } + #else + // unique_ptr style interface for memory management - cChunkData::cChunkData(cChunkData&& other) + cChunkData::cChunkData(cChunkData && other) { for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { @@ -70,14 +92,18 @@ cChunkData::~cChunkData() other.m_Sections[i] = NULL; } } + + + + - cChunkData& cChunkData::operator=(cChunkData&& other) + cChunkData & cChunkData::operator =(cChunkData && other) { if (&other != this) { for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - Free(m_Sections[i]);; + Free(m_Sections[i]); m_Sections[i] = other.m_Sections[i]; other.m_Sections[i] = NULL; } @@ -86,6 +112,10 @@ cChunkData::~cChunkData() } #endif + + + + BLOCKTYPE cChunkData::GetBlock(int a_X, int a_Y, int a_Z) const { ASSERT((a_X >= 0) && (a_X < cChunkDef::Width)); @@ -103,6 +133,10 @@ BLOCKTYPE cChunkData::GetBlock(int a_X, int a_Y, int a_Z) const } } + + + + void cChunkData::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) { if ( @@ -134,6 +168,10 @@ void cChunkData::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) m_Sections[Section]->m_BlockTypes[Index] = a_Block; } + + + + NIBBLETYPE cChunkData::GetMeta(int a_RelX, int a_RelY, int a_RelZ) const { if ( @@ -156,6 +194,10 @@ NIBBLETYPE cChunkData::GetMeta(int a_RelX, int a_RelY, int a_RelZ) const return 0; } + + + + bool cChunkData::SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble) { if ( @@ -192,9 +234,17 @@ bool cChunkData::SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble return oldval == a_Nibble; } + + + + NIBBLETYPE cChunkData::GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const { - if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) + if ( + (a_RelX < cChunkDef::Width) && (a_RelX > -1) && + (a_RelY < cChunkDef::Height) && (a_RelY > -1) && + (a_RelZ < cChunkDef::Width) && (a_RelZ > -1) + ) { int Section = a_RelY / CHUNK_SECTION_HEIGHT; if (m_Sections[Section] != NULL) @@ -211,6 +261,10 @@ NIBBLETYPE cChunkData::GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const return 0; } + + + + NIBBLETYPE cChunkData::GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const { if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) @@ -230,7 +284,11 @@ NIBBLETYPE cChunkData::GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const return 0; } -cChunkData cChunkData::Copy() const + + + + +cChunkData cChunkData::Copy(void) const { cChunkData copy; for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) @@ -248,11 +306,11 @@ cChunkData cChunkData::Copy() const -void cChunkData::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length) const +void cChunkData::CopyBlocks(BLOCKTYPE * a_dest, size_t a_Idx, size_t length) const { for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; + const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; if (a_Idx > 0) { a_Idx = std::max(a_Idx - length, (size_t) 0); @@ -588,6 +646,8 @@ cChunkData::sChunkSection * cChunkData::Allocate() const + + void cChunkData::Free(cChunkData::sChunkSection * ptr) const { delete ptr; @@ -595,6 +655,8 @@ void cChunkData::Free(cChunkData::sChunkSection * ptr) const + + void cChunkData::ZeroSection(cChunkData::sChunkSection * ptr) const { memset( diff --git a/src/ChunkData.h b/src/ChunkData.h index 16fcc4d37..6544b246e 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -25,12 +25,12 @@ public: #if __cplusplus < 201103L // auto_ptr style interface for memory management - cChunkData(const cChunkData& other); - cChunkData& operator=(const cChunkData& other); + cChunkData(const cChunkData & other); + cChunkData & operator =(const cChunkData & other); #else // unique_ptr style interface for memory management - cChunkData(cChunkData&& other); - cChunkData& operator=(cChunkData&& other); + cChunkData(cChunkData && other); + cChunkData & operator =(cChunkData && other); #endif BLOCKTYPE GetBlock(int a_X, int a_Y, int a_Z) const; @@ -43,15 +43,15 @@ public: NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const; - cChunkData Copy() const; + cChunkData Copy(void) const; void CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx = 0, size_t length = cChunkDef::NumBlocks) const; void CopyMeta (NIBBLETYPE * a_dest) const; - void CopyBlockLight (NIBBLETYPE * a_dest) const; + void CopyBlockLight(NIBBLETYPE * a_dest) const; void CopySkyLight (NIBBLETYPE * a_dest) const; void SetBlocks (const BLOCKTYPE * a_src); void SetMeta (const NIBBLETYPE * a_src); - void SetBlockLight (const NIBBLETYPE * a_src); + void SetBlockLight(const NIBBLETYPE * a_src); void SetSkyLight (const NIBBLETYPE * a_src); private: @@ -61,19 +61,19 @@ private: #if __cplusplus < 201103L // auto_ptr style interface for memory management - mutable bool IsOwner; + mutable bool m_IsOwner; #endif struct sChunkSection { - BLOCKTYPE m_BlockTypes [CHUNK_SECTION_HEIGHT * 16 * 16] ; + BLOCKTYPE m_BlockTypes [CHUNK_SECTION_HEIGHT * 16 * 16]; NIBBLETYPE m_BlockMeta [CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; NIBBLETYPE m_BlockLight [CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; NIBBLETYPE m_BlockSkyLight[CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; }; - sChunkSection *m_Sections[CHUNK_SECTION_COUNT]; + sChunkSection * m_Sections[CHUNK_SECTION_COUNT]; - sChunkSection * Allocate() const; + sChunkSection * Allocate(void) const; void Free(sChunkSection * ptr) const; void ZeroSection(sChunkSection * ptr) const; From 171e13de4f58cdc4f8a97cd8adfbfbfbcf1df615 Mon Sep 17 00:00:00 2001 From: worktycho Date: Wed, 28 May 2014 15:59:59 +0100 Subject: [PATCH 181/214] for compiliers other than msvc we need to tell lua that its building as a dll --- lib/lua/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/lua/CMakeLists.txt b/lib/lua/CMakeLists.txt index db112d557..6e5e0f565 100644 --- a/lib/lua/CMakeLists.txt +++ b/lib/lua/CMakeLists.txt @@ -20,6 +20,12 @@ endif() # Lua needs to be linked dynamically on Windows and statically on *nix, so that LuaRocks work if (WIN32) + + #for compiliers other than msvc we need to tell lua that its building as a dll + if (NOT MSVC) + add_flags_cxx(-DLUA_BUILD_AS_DLL=1) + endif() + add_library(lua SHARED ${SOURCE}) set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/MCServer) From 1cf426d881e1ea3dbfae5ebae701e02cd41c95a0 Mon Sep 17 00:00:00 2001 From: worktycho Date: Wed, 28 May 2014 20:39:47 +0100 Subject: [PATCH 182/214] FreeBSD requires __POSIX_VISIBLE macro to be defined --- lib/sqlite/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt index 0815127ef..d3bba6606 100644 --- a/lib/sqlite/CMakeLists.txt +++ b/lib/sqlite/CMakeLists.txt @@ -17,6 +17,10 @@ if (WIN32) source_group("Sources" FILES ${SOURCE}) endif() +# FreeBSD requires us to define this to get POSIX 2001 standard +if (SYSTEM_NAME STREQUAL "FreeBSD")) + add_flags_cxx(-D__POSIX_VISIBLE=200112) +endif() add_library(sqlite ${SOURCE}) From a2b741d904d55915fe041ff17d2ffadc7bf8221c Mon Sep 17 00:00:00 2001 From: worktycho Date: Wed, 28 May 2014 20:41:34 +0100 Subject: [PATCH 183/214] derp --- lib/sqlite/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt index d3bba6606..da16ce411 100644 --- a/lib/sqlite/CMakeLists.txt +++ b/lib/sqlite/CMakeLists.txt @@ -18,7 +18,7 @@ if (WIN32) endif() # FreeBSD requires us to define this to get POSIX 2001 standard -if (SYSTEM_NAME STREQUAL "FreeBSD")) +if (SYSTEM_NAME STREQUAL "FreeBSD") add_flags_cxx(-D__POSIX_VISIBLE=200112) endif() From 444cce1269b3efc3370358b389c4ebdfe1f2e5b2 Mon Sep 17 00:00:00 2001 From: worktycho Date: Wed, 28 May 2014 21:39:28 +0100 Subject: [PATCH 184/214] Cmake system name not System name --- lib/sqlite/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt index da16ce411..9add2280b 100644 --- a/lib/sqlite/CMakeLists.txt +++ b/lib/sqlite/CMakeLists.txt @@ -18,7 +18,7 @@ if (WIN32) endif() # FreeBSD requires us to define this to get POSIX 2001 standard -if (SYSTEM_NAME STREQUAL "FreeBSD") +if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") add_flags_cxx(-D__POSIX_VISIBLE=200112) endif() From 81f756cbda76507cc676fd50f20f33483c4ce6f8 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 28 May 2014 22:40:19 +0200 Subject: [PATCH 185/214] cChunkData: Normalized code style. --- src/ChunkData.cpp | 168 +++++++++++++++++++++++++--------------------- src/ChunkData.h | 27 +++++--- 2 files changed, 106 insertions(+), 89 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 8aed62000..beee6c64a 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -306,33 +306,33 @@ cChunkData cChunkData::Copy(void) const -void cChunkData::CopyBlocks(BLOCKTYPE * a_dest, size_t a_Idx, size_t length) const +void cChunkData::CopyBlocks(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) const { for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; + const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16; if (a_Idx > 0) { - a_Idx = std::max(a_Idx - length, (size_t) 0); + a_Idx = std::max(a_Idx - a_Length, (size_t) 0); } if (a_Idx == 0) { - size_t tocopy = std::min(segment_length, length); - length -= tocopy; + size_t ToCopy = std::min(SegmentLength, a_Length); + length -= ToCopy; if (m_Sections[i] != NULL) { memcpy( - &a_dest[i * segment_length], + &a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockTypes, - sizeof(BLOCKTYPE) * tocopy + sizeof(BLOCKTYPE) * ToCopy ); } else { memset( - &a_dest[i * segment_length], + &a_Dest[i * SegmentLength], 0, - sizeof(BLOCKTYPE) * tocopy + sizeof(BLOCKTYPE) * ToCopy ); } } @@ -343,25 +343,25 @@ void cChunkData::CopyBlocks(BLOCKTYPE * a_dest, size_t a_Idx, size_t length) co -void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const +void cChunkData::CopyMeta(NIBBLETYPE * a_Dest) const { for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) { memcpy( - &a_dest[i * segment_length], + &a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockMeta, - sizeof(NIBBLETYPE) * segment_length + sizeof(NIBBLETYPE) * SegmentLength ); } else { memset( - &a_dest[i * segment_length], + &a_Dest[i * SegmentLength], 0, - sizeof(BLOCKTYPE) * segment_length + sizeof(BLOCKTYPE) * SegmentLength ); } } @@ -371,25 +371,25 @@ void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const -void cChunkData::CopyBlockLight(NIBBLETYPE * a_dest) const +void cChunkData::CopyBlockLight(NIBBLETYPE * a_Dest) const { for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) { memcpy( - &a_dest[i * segment_length], + &a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockLight, - sizeof(NIBBLETYPE) * segment_length + sizeof(NIBBLETYPE) * SegmentLength ); } else { memset( - &a_dest[i * segment_length], + &a_Dest[i * SegmentLength], 0, - sizeof(BLOCKTYPE) * segment_length + sizeof(BLOCKTYPE) * SegmentLength ); } } @@ -399,25 +399,25 @@ void cChunkData::CopyBlockLight(NIBBLETYPE * a_dest) const -void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const +void cChunkData::CopySkyLight(NIBBLETYPE * a_Dest) const { for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) { memcpy( - &a_dest[i * segment_length], + &a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockSkyLight, - sizeof(NIBBLETYPE) * segment_length + sizeof(NIBBLETYPE) * SegmentLength ); } else { memset( - &a_dest[i * segment_length], + &a_Dest[i * SegmentLength], 0xFF, - sizeof(BLOCKTYPE) * segment_length + sizeof(BLOCKTYPE) * SegmentLength ); } } @@ -427,34 +427,36 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const -void cChunkData::SetBlocks(const BLOCKTYPE * a_src) +void cChunkData::SetBlocks(const BLOCKTYPE * a_Src) { + ASSERT(a_Src != NULL); + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16; + const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16; if (m_Sections[i] != NULL) { memcpy( &m_Sections[i]->m_BlockTypes, - &a_src[i * segment_length], - sizeof(BLOCKTYPE) * segment_length + &a_Src[i * SegmentLength], + sizeof(BLOCKTYPE) * SegmentLength ); } else { // j counts how many of leading zeros the buffer has - // if j == segment_length then the buffer is all zeros so there is no point + // if j == SegmentLength then the buffer is all zeros so there is no point // creating the buffer. size_t j = 0; // do nothing whilst 0 - for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != segment_length) + for (; (j < SegmentLength) && (a_Src[i * SegmentLength + j] == 0); j++); + if (j != SegmentLength) { m_Sections[i] = Allocate(); memcpy( &m_Sections[i]->m_BlockTypes, - &a_src[i * segment_length], - sizeof(BLOCKTYPE) * segment_length + &a_Src[i * SegmentLength], + sizeof(BLOCKTYPE) * SegmentLength ); memset( m_Sections[i]->m_BlockMeta, @@ -479,34 +481,36 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src) -void cChunkData::SetMeta(const NIBBLETYPE * a_src) +void cChunkData::SetMeta(const NIBBLETYPE * a_Src) { + ASSERT(a_Src != NULL); + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) { memcpy( &m_Sections[i]->m_BlockMeta, - &a_src[i * segment_length], - sizeof(NIBBLETYPE) * segment_length + &a_Src[i * SegmentLength], + sizeof(NIBBLETYPE) * SegmentLength ); } else { // j counts how many of leading zeros the buffer has - // if j == segment_length then the buffer is all zeros so there is no point + // if j == SegmentLength then the buffer is all zeros so there is no point // creating the buffer. size_t j = 0; // do nothing whilst 0 - for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != segment_length) + for (; (j < SegmentLength) && (a_Src[i * SegmentLength + j] == 0); j++); + if (j != SegmentLength) { m_Sections[i] = Allocate(); memcpy( &m_Sections[i]->m_BlockMeta, - &a_src[i * segment_length], - sizeof(BLOCKTYPE) * segment_length + &a_Src[i * SegmentLength], + sizeof(BLOCKTYPE) * SegmentLength ); memset( m_Sections[i]->m_BlockTypes, @@ -531,35 +535,38 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src) -void cChunkData::SetBlockLight(const NIBBLETYPE * a_src) +void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) { - if (!a_src) return; + if (a_Src == NULL) + { + return; + } for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) { memcpy( &m_Sections[i]->m_BlockLight, - &a_src[i * segment_length], - sizeof(NIBBLETYPE) * segment_length + &a_Src[i * SegmentLength], + sizeof(NIBBLETYPE) * SegmentLength ); } else { // j counts how many of leading zeros the buffer has - // if j == segment_length then the buffer is all zeros so there is no point + // if j == SegmentLength then the buffer is all zeros so there is no point // creating the buffer. size_t j = 0; // do nothing whilst 0 - for (; j < segment_length && a_src[i * segment_length + j] == 0; j++); - if (j != segment_length) + for (; (j < SegmentLength) && (a_Src[i * SegmentLength + j] == 0); j++); + if (j != SegmentLength) { m_Sections[i] = Allocate(); memcpy( &m_Sections[i]->m_BlockLight, - &a_src[i * segment_length], - sizeof(BLOCKTYPE) * segment_length + &a_Src[i * SegmentLength], + sizeof(BLOCKTYPE) * SegmentLength ); memset( m_Sections[i]->m_BlockTypes, @@ -584,35 +591,39 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_src) -void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) +void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) { - if (!a_src) return; + if (a_Src == NULL) + { + return; + } + for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) { - const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; if (m_Sections[i] != NULL) { memcpy( &m_Sections[i]->m_BlockSkyLight, - &a_src[i * segment_length], - sizeof(NIBBLETYPE) * segment_length + &a_Src[i * SegmentLength], + sizeof(NIBBLETYPE) * SegmentLength ); } else { // j counts how many of leading zeros the buffer has - // if j == segment_length then the buffer is all zeros so there is no point + // if j == SegmentLength then the buffer is all zeros so there is no point // creating the buffer. size_t j = 0; // do nothing whilst 0 - for (; j < segment_length && a_src[i * segment_length + j] == 0xFF; j++); - if (j != segment_length) + for (; (j < SegmentLength) && (a_Src[i * SegmentLength + j]) == 0xFF; j++); + if (j != SegmentLength) { m_Sections[i] = Allocate(); memcpy( &m_Sections[i]->m_BlockSkyLight, - &a_src[i * segment_length], - sizeof(BLOCKTYPE) * segment_length + &a_Src[i * SegmentLength], + sizeof(BLOCKTYPE) * SegmentLength ); memset( m_Sections[i]->m_BlockTypes, @@ -638,9 +649,9 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) -cChunkData::sChunkSection * cChunkData::Allocate() const +cChunkData::sChunkSection * cChunkData::Allocate(void) const { - // TODO: use a allocation pool + // TODO: Use an allocation pool return new cChunkData::sChunkSection; } @@ -648,36 +659,37 @@ cChunkData::sChunkSection * cChunkData::Allocate() const -void cChunkData::Free(cChunkData::sChunkSection * ptr) const +void cChunkData::Free(cChunkData::sChunkSection * a_Section) const { - delete ptr; + // TODO: Use an allocation pool + delete a_Section; } -void cChunkData::ZeroSection(cChunkData::sChunkSection * ptr) const +void cChunkData::ZeroSection(cChunkData::sChunkSection * a_Section) const { memset( - ptr->m_BlockTypes, + a_Section->m_BlockTypes, 0x00, - sizeof(ptr->m_BlockTypes) + sizeof(a_Section->m_BlockTypes) ); memset( - ptr->m_BlockMeta, + a_Section->m_BlockMeta, 0x00, - sizeof(ptr->m_BlockMeta) + sizeof(a_Section->m_BlockMeta) ); memset( - ptr->m_BlockLight, + a_Section->m_BlockLight, 0x00, - sizeof(ptr->m_BlockLight) + sizeof(a_Section->m_BlockLight) ); memset( - ptr->m_BlockSkyLight, + a_Section->m_BlockSkyLight, 0xFF, - sizeof(ptr->m_BlockSkyLight) + sizeof(a_Section->m_BlockSkyLight) ); } diff --git a/src/ChunkData.h b/src/ChunkData.h index 6544b246e..09b2cb563 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -25,12 +25,12 @@ public: #if __cplusplus < 201103L // auto_ptr style interface for memory management - cChunkData(const cChunkData & other); - cChunkData & operator =(const cChunkData & other); + cChunkData(const cChunkData & a_Other); + cChunkData & operator =(const cChunkData & a_Other); #else // unique_ptr style interface for memory management - cChunkData(cChunkData && other); - cChunkData & operator =(cChunkData && other); + cChunkData(cChunkData && a_Other); + cChunkData & operator =(cChunkData && a_ther); #endif BLOCKTYPE GetBlock(int a_X, int a_Y, int a_Z) const; @@ -44,10 +44,10 @@ public: NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const; cChunkData Copy(void) const; - void CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx = 0, size_t length = cChunkDef::NumBlocks) const; - void CopyMeta (NIBBLETYPE * a_dest) const; - void CopyBlockLight(NIBBLETYPE * a_dest) const; - void CopySkyLight (NIBBLETYPE * a_dest) const; + void CopyBlocks (BLOCKTYPE * a_Dest, size_t a_Idx = 0, size_t a_Length = cChunkDef::NumBlocks) const; + void CopyMeta (NIBBLETYPE * a_Dest) const; + void CopyBlockLight(NIBBLETYPE * a_Dest) const; + void CopySkyLight (NIBBLETYPE * a_Dest) const; void SetBlocks (const BLOCKTYPE * a_src); void SetMeta (const NIBBLETYPE * a_src); @@ -73,10 +73,15 @@ private: sChunkSection * m_Sections[CHUNK_SECTION_COUNT]; - sChunkSection * Allocate(void) const; - void Free(sChunkSection * ptr) const; + /** Allocates a new section. Entry-point to custom allocators. */ + static sChunkSection * Allocate(void); - void ZeroSection(sChunkSection * ptr) const; + /** Frees the specified section, previously allocated using Allocate(). + Note that a_Section may be NULL. */ + static void Free(sChunkSection * a_Section); + + /** Sets the data in the specified section to their default values. */ + void ZeroSection(sChunkSection * a_Section) const; }; From 10273f64a2ec326201d3553f3704d2d6f21b7a86 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 28 May 2014 22:41:23 +0200 Subject: [PATCH 186/214] Fixed a crash in message formatter. The code would fail if a message is sent to a player not yet added to a world. --- src/Protocol/Protocol17x.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 7c526d103..f7564fe6d 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -234,7 +234,8 @@ void cProtocol172::SendChat(const cCompositeChat & a_Message) // Compose the complete Json string to send: Json::Value msg; - msg["text"] = cClientHandle::FormatMessageType(m_Client->GetPlayer()->GetWorld()->ShouldUseChatPrefixes(), a_Message.GetMessageType(), a_Message.GetAdditionalMessageTypeData()); // The client crashes without this field being present + cWorld * World = m_Client->GetPlayer()->GetWorld(); + msg["text"] = cClientHandle::FormatMessageType((World == NULL) ? false : World->ShouldUseChatPrefixes(), a_Message.GetMessageType(), a_Message.GetAdditionalMessageTypeData()); // The client crashes without this field being present const cCompositeChat::cParts & Parts = a_Message.GetParts(); for (cCompositeChat::cParts::const_iterator itr = Parts.begin(), end = Parts.end(); itr != end; ++itr) { From 999662503a90e6acd4528be50f8b6232b357d9c3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 29 May 2014 09:09:11 +0200 Subject: [PATCH 187/214] Fixed forgotten changes. --- src/ChunkData.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index beee6c64a..172858e4e 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -318,7 +318,7 @@ void cChunkData::CopyBlocks(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) if (a_Idx == 0) { size_t ToCopy = std::min(SegmentLength, a_Length); - length -= ToCopy; + a_Length -= ToCopy; if (m_Sections[i] != NULL) { memcpy( @@ -649,7 +649,7 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) -cChunkData::sChunkSection * cChunkData::Allocate(void) const +cChunkData::sChunkSection * cChunkData::Allocate(void) { // TODO: Use an allocation pool return new cChunkData::sChunkSection; @@ -659,7 +659,7 @@ cChunkData::sChunkSection * cChunkData::Allocate(void) const -void cChunkData::Free(cChunkData::sChunkSection * a_Section) const +void cChunkData::Free(cChunkData::sChunkSection * a_Section) { // TODO: Use an allocation pool delete a_Section; From e5187aa645b0f06e58e347bed1f8d68916764ba1 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 29 May 2014 09:19:20 +0200 Subject: [PATCH 188/214] Fixed a memory leak in cPOCPieceGenerator --- src/Generating/POCPieceGenerator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Generating/POCPieceGenerator.cpp b/src/Generating/POCPieceGenerator.cpp index 9ed4b565e..491f4d206 100644 --- a/src/Generating/POCPieceGenerator.cpp +++ b/src/Generating/POCPieceGenerator.cpp @@ -186,6 +186,11 @@ cPOCPieceGenerator::cPOCPieceGenerator(int a_Seed) : cPOCPieceGenerator::~cPOCPieceGenerator() { cPieceGenerator::FreePieces(m_Pieces); + for (cPieces::iterator itr = m_AvailPieces.begin(), end = m_AvailPieces.end(); itr != end; ++itr) + { + delete *itr; + } + m_AvailPieces.clear(); } From d9c667d28f556e489b2779b7510f3b12034c3fad Mon Sep 17 00:00:00 2001 From: worktycho Date: Thu, 29 May 2014 12:04:37 +0100 Subject: [PATCH 189/214] Add comment --- src/ChunkData.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ChunkData.h b/src/ChunkData.h index 09b2cb563..e6aaa99b8 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -44,6 +44,10 @@ public: NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const; cChunkData Copy(void) const; + + // Copys data from this object into the buffer in the a_Dest param + // CopyBlocks also povides the optional parameters a_Idx and a_Length which specify an offset and length for + // copying part of the BlockTypes array. void CopyBlocks (BLOCKTYPE * a_Dest, size_t a_Idx = 0, size_t a_Length = cChunkDef::NumBlocks) const; void CopyMeta (NIBBLETYPE * a_Dest) const; void CopyBlockLight(NIBBLETYPE * a_Dest) const; From f7777e8c7559964f126a64af7673276e356dcedc Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 29 May 2014 18:25:08 +0200 Subject: [PATCH 190/214] Added comments, reformatted code. --- src/BlockArea.cpp | 2 +- src/Chunk.cpp | 6 +- src/ChunkData.cpp | 391 +++++++++++++++------------------------- src/ChunkData.h | 65 +++++-- src/ChunkDataCallback.h | 40 +++- src/LightingThread.cpp | 2 +- 6 files changed, 226 insertions(+), 280 deletions(-) diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 11bd76e6c..40fdd68c0 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -1903,7 +1903,7 @@ void cBlockArea::cChunkReader::ChunkData(const cChunkData & a_BlockBuffer) if (m_Area.m_BlockMetas != NULL) { - a_BlockBuffer.CopyMeta(m_Area.m_BlockMetas); + a_BlockBuffer.CopyMetas(m_Area.m_BlockMetas); } if (m_Area.m_BlockLight != NULL) diff --git a/src/Chunk.cpp b/src/Chunk.cpp index e5f8f1e29..23412a4c3 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -282,8 +282,8 @@ void cChunk::SetAllData( CalculateHeightmap(a_BlockTypes); } - m_ChunkData.SetBlocks(a_BlockTypes); - m_ChunkData.SetMeta(a_BlockMeta); + m_ChunkData.SetBlockTypes(a_BlockTypes); + m_ChunkData.SetMetas(a_BlockMeta); m_ChunkData.SetBlockLight(a_BlockLight); m_ChunkData.SetSkyLight(a_BlockSkyLight); @@ -339,7 +339,7 @@ void cChunk::SetLight( void cChunk::GetBlockTypes(BLOCKTYPE * a_BlockTypes) { - m_ChunkData.CopyBlocks(a_BlockTypes); + m_ChunkData.CopyBlockTypes(a_BlockTypes); } diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 172858e4e..cc4793ec3 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -1,14 +1,39 @@ +// ChunkData.cpp + +// Implements the cChunkData class that represents the block's type, meta, blocklight and skylight storage for a chunk + #include "Globals.h" #include "ChunkData.h" -cChunkData::cChunkData() + + + + +/** Returns true if all a_Array's elements between [0] and [a_NumElements - 1] are equal to a_Value. */ +template inline bool IsAllValue(const T * a_Array, size_t a_NumElements, T a_Value) +{ + for (size_t i = 0; i < a_NumElements; i++) + { + if (a_Array[i] != a_Value) + { + return false; + } + } + return true; +} + + + + + +cChunkData::cChunkData(void) #if __cplusplus < 201103L // auto_ptr style interface for memory management : m_IsOwner(true) #endif { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { m_Sections[i] = NULL; } @@ -27,7 +52,7 @@ cChunkData::~cChunkData() return; } #endif - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { Free(m_Sections[i]); } @@ -43,7 +68,7 @@ cChunkData::~cChunkData() m_IsOwner(true) { // Move contents and ownership from a_Other to this, pointer-wise: - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { m_Sections[i] = a_Other.m_Sections[i]; } @@ -65,7 +90,7 @@ cChunkData::~cChunkData() // Free any currently held contents: if (m_IsOwner) { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { Free(m_Sections[i]); } @@ -73,7 +98,7 @@ cChunkData::~cChunkData() // Move contents and ownership from a_Other to this, pointer-wise: m_IsOwner = true; - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { m_Sections[i] = a_Other.m_Sections[i]; } @@ -86,7 +111,7 @@ cChunkData::~cChunkData() // unique_ptr style interface for memory management cChunkData::cChunkData(cChunkData && other) { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { m_Sections[i] = other.m_Sections[i]; other.m_Sections[i] = NULL; @@ -101,7 +126,7 @@ cChunkData::~cChunkData() { if (&other != this) { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { Free(m_Sections[i]); m_Sections[i] = other.m_Sections[i]; @@ -121,10 +146,10 @@ BLOCKTYPE cChunkData::GetBlock(int a_X, int a_Y, int a_Z) const ASSERT((a_X >= 0) && (a_X < cChunkDef::Width)); ASSERT((a_Y >= 0) && (a_Y < cChunkDef::Height)); ASSERT((a_Z >= 0) && (a_Z < cChunkDef::Width)); - int Section = a_Y / CHUNK_SECTION_HEIGHT; + int Section = a_Y / SectionHeight; if (m_Sections[Section] != NULL) { - int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * CHUNK_SECTION_HEIGHT), a_Z); + int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * SectionHeight), a_Z); return m_Sections[Section]->m_BlockTypes[Index]; } else @@ -149,7 +174,7 @@ void cChunkData::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) return; } - int Section = a_RelY / CHUNK_SECTION_HEIGHT; + int Section = a_RelY / SectionHeight; if (m_Sections[Section] == NULL) { if (a_Block == 0x00) @@ -164,7 +189,7 @@ void cChunkData::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) } ZeroSection(m_Sections[Section]); } - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); m_Sections[Section]->m_BlockTypes[Index] = a_Block; } @@ -179,10 +204,10 @@ NIBBLETYPE cChunkData::GetMeta(int a_RelX, int a_RelY, int a_RelZ) const (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { - int Section = a_RelY / CHUNK_SECTION_HEIGHT; + int Section = a_RelY / SectionHeight; if (m_Sections[Section] != NULL) { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f; } else @@ -210,7 +235,7 @@ bool cChunkData::SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble return false; } - int Section = a_RelY / CHUNK_SECTION_HEIGHT; + int Section = a_RelY / SectionHeight; if (m_Sections[Section] == NULL) { if ((a_Nibble & 0xf) == 0x00) @@ -225,7 +250,7 @@ bool cChunkData::SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble } ZeroSection(m_Sections[Section]); } - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); NIBBLETYPE oldval = m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4) & 0xf; m_Sections[Section]->m_BlockMeta[Index / 2] = static_cast( (m_Sections[Section]->m_BlockMeta[Index / 2] & (0xf0 >> ((Index & 1) * 4))) | // The untouched nibble @@ -246,10 +271,10 @@ NIBBLETYPE cChunkData::GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const (a_RelZ < cChunkDef::Width) && (a_RelZ > -1) ) { - int Section = a_RelY / CHUNK_SECTION_HEIGHT; + int Section = a_RelY / SectionHeight; if (m_Sections[Section] != NULL) { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; } else @@ -269,10 +294,10 @@ NIBBLETYPE cChunkData::GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const { if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { - int Section = a_RelY / CHUNK_SECTION_HEIGHT; + int Section = a_RelY / SectionHeight; if (m_Sections[Section] != NULL) { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; } else @@ -291,7 +316,7 @@ NIBBLETYPE cChunkData::GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const cChunkData cChunkData::Copy(void) const { cChunkData copy; - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { if (m_Sections[i] != NULL) { @@ -306,11 +331,12 @@ cChunkData cChunkData::Copy(void) const -void cChunkData::CopyBlocks(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) const +void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) const { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + // TODO: This code seems wrong. It always copies into a_Dest[i * SegmentLength], even when a_Idx > 0 + for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16; + const size_t SegmentLength = SectionHeight * 16 * 16; if (a_Idx > 0) { a_Idx = std::max(a_Idx - a_Length, (size_t) 0); @@ -321,19 +347,11 @@ void cChunkData::CopyBlocks(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) a_Length -= ToCopy; if (m_Sections[i] != NULL) { - memcpy( - &a_Dest[i * SegmentLength], - &m_Sections[i]->m_BlockTypes, - sizeof(BLOCKTYPE) * ToCopy - ); + memcpy(&a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockTypes, sizeof(BLOCKTYPE) * ToCopy); } else { - memset( - &a_Dest[i * SegmentLength], - 0, - sizeof(BLOCKTYPE) * ToCopy - ); + memset(&a_Dest[i * SegmentLength], 0, sizeof(BLOCKTYPE) * ToCopy); } } } @@ -343,26 +361,18 @@ void cChunkData::CopyBlocks(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) -void cChunkData::CopyMeta(NIBBLETYPE * a_Dest) const +void cChunkData::CopyMetas(NIBBLETYPE * a_Dest) const { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = SectionHeight * 16 * 16 / 2; if (m_Sections[i] != NULL) { - memcpy( - &a_Dest[i * SegmentLength], - &m_Sections[i]->m_BlockMeta, - sizeof(NIBBLETYPE) * SegmentLength - ); + memcpy(&a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockMeta, sizeof(NIBBLETYPE) * SegmentLength); } else { - memset( - &a_Dest[i * SegmentLength], - 0, - sizeof(BLOCKTYPE) * SegmentLength - ); + memset(&a_Dest[i * SegmentLength], 0, sizeof(BLOCKTYPE) * SegmentLength); } } } @@ -373,24 +383,16 @@ void cChunkData::CopyMeta(NIBBLETYPE * a_Dest) const void cChunkData::CopyBlockLight(NIBBLETYPE * a_Dest) const { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = SectionHeight * 16 * 16 / 2; if (m_Sections[i] != NULL) { - memcpy( - &a_Dest[i * SegmentLength], - &m_Sections[i]->m_BlockLight, - sizeof(NIBBLETYPE) * SegmentLength - ); + memcpy(&a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockLight, sizeof(NIBBLETYPE) * SegmentLength); } else { - memset( - &a_Dest[i * SegmentLength], - 0, - sizeof(BLOCKTYPE) * SegmentLength - ); + memset(&a_Dest[i * SegmentLength], 0, sizeof(BLOCKTYPE) * SegmentLength); } } } @@ -401,24 +403,16 @@ void cChunkData::CopyBlockLight(NIBBLETYPE * a_Dest) const void cChunkData::CopySkyLight(NIBBLETYPE * a_Dest) const { - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + const size_t SegmentLength = SectionHeight * 16 * 16 / 2; if (m_Sections[i] != NULL) { - memcpy( - &a_Dest[i * SegmentLength], - &m_Sections[i]->m_BlockSkyLight, - sizeof(NIBBLETYPE) * SegmentLength - ); + memcpy(&a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockSkyLight, sizeof(NIBBLETYPE) * SegmentLength); } else { - memset( - &a_Dest[i * SegmentLength], - 0xFF, - sizeof(BLOCKTYPE) * SegmentLength - ); + memset(&a_Dest[i * SegmentLength], 0xff, sizeof(BLOCKTYPE) * SegmentLength); } } } @@ -427,165 +421,102 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_Dest) const -void cChunkData::SetBlocks(const BLOCKTYPE * a_Src) +void cChunkData::SetBlockTypes(const BLOCKTYPE * a_Src) { ASSERT(a_Src != NULL); - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + static const size_t SegmentLength = SectionHeight * 16 * 16; + for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16; + // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy( - &m_Sections[i]->m_BlockTypes, - &a_Src[i * SegmentLength], - sizeof(BLOCKTYPE) * SegmentLength - ); + memcpy(&m_Sections[i]->m_BlockTypes, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + continue; } - else + + // The section doesn't exist, find out if it is needed: + if (IsAllValue(a_Src + i * SegmentLength, SegmentLength, (const BLOCKTYPE)0)) { - // j counts how many of leading zeros the buffer has - // if j == SegmentLength then the buffer is all zeros so there is no point - // creating the buffer. - size_t j = 0; - // do nothing whilst 0 - for (; (j < SegmentLength) && (a_Src[i * SegmentLength + j] == 0); j++); - if (j != SegmentLength) - { - m_Sections[i] = Allocate(); - memcpy( - &m_Sections[i]->m_BlockTypes, - &a_Src[i * SegmentLength], - sizeof(BLOCKTYPE) * SegmentLength - ); - memset( - m_Sections[i]->m_BlockMeta, - 0x00, - sizeof(m_Sections[i]->m_BlockMeta) - ); - memset( - m_Sections[i]->m_BlockLight, - 0x00, - sizeof(m_Sections[i]->m_BlockLight) - ); - memset( - m_Sections[i]->m_BlockSkyLight, - 0xFF, - sizeof(m_Sections[i]->m_BlockSkyLight) - ); - } + // No need for the section, the data is all-air + continue; } - } + + // Allocate the section and copy the data into it: + m_Sections[i] = Allocate(); + memcpy(&m_Sections[i]->m_BlockTypes, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + memset(m_Sections[i]->m_BlockMeta, 0x00, sizeof(m_Sections[i]->m_BlockMeta)); + memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); + memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); + } // for i - m_Sections[] } -void cChunkData::SetMeta(const NIBBLETYPE * a_Src) +void cChunkData::SetMetas(const NIBBLETYPE * a_Src) { ASSERT(a_Src != NULL); - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy( - &m_Sections[i]->m_BlockMeta, - &a_Src[i * SegmentLength], - sizeof(NIBBLETYPE) * SegmentLength - ); + memcpy(&m_Sections[i]->m_BlockMeta, &a_Src[i * SegmentLength], sizeof(NIBBLETYPE) * SegmentLength); + continue; } - else + + // The section doesn't exist, find out if it is needed: + if (IsAllValue(a_Src + i * SegmentLength, SegmentLength, (NIBBLETYPE)0)) { - // j counts how many of leading zeros the buffer has - // if j == SegmentLength then the buffer is all zeros so there is no point - // creating the buffer. - size_t j = 0; - // do nothing whilst 0 - for (; (j < SegmentLength) && (a_Src[i * SegmentLength + j] == 0); j++); - if (j != SegmentLength) - { - m_Sections[i] = Allocate(); - memcpy( - &m_Sections[i]->m_BlockMeta, - &a_Src[i * SegmentLength], - sizeof(BLOCKTYPE) * SegmentLength - ); - memset( - m_Sections[i]->m_BlockTypes, - 0x00, - sizeof(m_Sections[i]->m_BlockTypes) - ); - memset( - m_Sections[i]->m_BlockLight, - 0x00, - sizeof(m_Sections[i]->m_BlockLight) - ); - memset( - m_Sections[i]->m_BlockSkyLight, - 0xFF, - sizeof(m_Sections[i]->m_BlockSkyLight) - ); - } + // No need for the section, the data is all zeroes + continue; } - } + + // Allocate the section and copy the data into it: + m_Sections[i] = Allocate(); + memcpy(&m_Sections[i]->m_BlockMeta, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); + memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); + memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); + } // for i - m_Sections[] } + void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) { if (a_Src == NULL) { return; } - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + + for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy( - &m_Sections[i]->m_BlockLight, - &a_Src[i * SegmentLength], - sizeof(NIBBLETYPE) * SegmentLength - ); + memcpy(&m_Sections[i]->m_BlockLight, &a_Src[i * SegmentLength], sizeof(NIBBLETYPE) * SegmentLength); + continue; } - else + + // The section doesn't exist, find out if it is needed: + if (IsAllValue(a_Src + i * SegmentLength, SegmentLength, (NIBBLETYPE)0)) { - // j counts how many of leading zeros the buffer has - // if j == SegmentLength then the buffer is all zeros so there is no point - // creating the buffer. - size_t j = 0; - // do nothing whilst 0 - for (; (j < SegmentLength) && (a_Src[i * SegmentLength + j] == 0); j++); - if (j != SegmentLength) - { - m_Sections[i] = Allocate(); - memcpy( - &m_Sections[i]->m_BlockLight, - &a_Src[i * SegmentLength], - sizeof(BLOCKTYPE) * SegmentLength - ); - memset( - m_Sections[i]->m_BlockTypes, - 0x00, - sizeof(m_Sections[i]->m_BlockTypes) - ); - memset( - m_Sections[i]->m_BlockMeta, - 0x00, - sizeof(m_Sections[i]->m_BlockMeta) - ); - memset( - m_Sections[i]->m_BlockSkyLight, - 0xFF, - sizeof(m_Sections[i]->m_BlockSkyLight) - ); - } + // No need for the section, the data is all zeroes + continue; } - } + + // Allocate the section and copy the data into it: + m_Sections[i] = Allocate(); + memcpy(&m_Sections[i]->m_BlockLight, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); + memset(m_Sections[i]->m_BlockMeta, 0x00, sizeof(m_Sections[i]->m_BlockMeta)); + memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); + } // for i - m_Sections[] } @@ -598,51 +529,29 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) return; } - for (size_t i = 0; i < CHUNK_SECTION_COUNT; i++) + for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = CHUNK_SECTION_HEIGHT * 16 * 16 / 2; + // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy( - &m_Sections[i]->m_BlockSkyLight, - &a_Src[i * SegmentLength], - sizeof(NIBBLETYPE) * SegmentLength - ); + memcpy(&m_Sections[i]->m_BlockSkyLight, &a_Src[i * SegmentLength], sizeof(NIBBLETYPE) * SegmentLength); + continue; } - else + + // The section doesn't exist, find out if it is needed: + if (IsAllValue(a_Src + i * SegmentLength, SegmentLength, (NIBBLETYPE)0xff)) { - // j counts how many of leading zeros the buffer has - // if j == SegmentLength then the buffer is all zeros so there is no point - // creating the buffer. - size_t j = 0; - // do nothing whilst 0 - for (; (j < SegmentLength) && (a_Src[i * SegmentLength + j]) == 0xFF; j++); - if (j != SegmentLength) - { - m_Sections[i] = Allocate(); - memcpy( - &m_Sections[i]->m_BlockSkyLight, - &a_Src[i * SegmentLength], - sizeof(BLOCKTYPE) * SegmentLength - ); - memset( - m_Sections[i]->m_BlockTypes, - 0x00, - sizeof(m_Sections[i]->m_BlockTypes) - ); - memset( - m_Sections[i]->m_BlockMeta, - 0x00, - sizeof(m_Sections[i]->m_BlockMeta) - ); - memset( - m_Sections[i]->m_BlockLight, - 0x00, - sizeof(m_Sections[i]->m_BlockLight) - ); - } + // No need for the section, the data is all zeroes + continue; } - } + + // Allocate the section and copy the data into it: + m_Sections[i] = Allocate(); + memcpy(&m_Sections[i]->m_BlockSkyLight, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); + memset(m_Sections[i]->m_BlockMeta, 0x00, sizeof(m_Sections[i]->m_BlockMeta)); + memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); + } // for i - m_Sections[] } @@ -671,26 +580,10 @@ void cChunkData::Free(cChunkData::sChunkSection * a_Section) void cChunkData::ZeroSection(cChunkData::sChunkSection * a_Section) const { - memset( - a_Section->m_BlockTypes, - 0x00, - sizeof(a_Section->m_BlockTypes) - ); - memset( - a_Section->m_BlockMeta, - 0x00, - sizeof(a_Section->m_BlockMeta) - ); - memset( - a_Section->m_BlockLight, - 0x00, - sizeof(a_Section->m_BlockLight) - ); - memset( - a_Section->m_BlockSkyLight, - 0xFF, - sizeof(a_Section->m_BlockSkyLight) - ); + memset(a_Section->m_BlockTypes, 0x00, sizeof(a_Section->m_BlockTypes)); + memset(a_Section->m_BlockMeta, 0x00, sizeof(a_Section->m_BlockMeta)); + memset(a_Section->m_BlockLight, 0x00, sizeof(a_Section->m_BlockLight)); + memset(a_Section->m_BlockSkyLight, 0xff, sizeof(a_Section->m_BlockSkyLight)); } diff --git a/src/ChunkData.h b/src/ChunkData.h index e6aaa99b8..341c15301 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -1,4 +1,12 @@ +// ChunkData.h + +// Declares the cChunkData class that represents the block's type, meta, blocklight and skylight storage for a chunk + + + + + #pragma once @@ -20,7 +28,7 @@ class cChunkData { public: - cChunkData(); + cChunkData(void); ~cChunkData(); #if __cplusplus < 201103L @@ -43,25 +51,48 @@ public: NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const; + /** Creates a (deep) copy of self. */ cChunkData Copy(void) const; - // Copys data from this object into the buffer in the a_Dest param - // CopyBlocks also povides the optional parameters a_Idx and a_Length which specify an offset and length for - // copying part of the BlockTypes array. - void CopyBlocks (BLOCKTYPE * a_Dest, size_t a_Idx = 0, size_t a_Length = cChunkDef::NumBlocks) const; - void CopyMeta (NIBBLETYPE * a_Dest) const; + /** Copies the blocktype data into the specified flat array. + Optionally, only a part of the data is copied, as specified by the a_Idx and a_Length parameters. */ + void CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx = 0, size_t a_Length = cChunkDef::NumBlocks) const; + + /** Copies the metadata into the specified flat array. */ + void CopyMetas(NIBBLETYPE * a_Dest) const; + + /** Copies the block light data into the specified flat array. */ void CopyBlockLight(NIBBLETYPE * a_Dest) const; + + /** Copies the skylight data into the specified flat array. */ void CopySkyLight (NIBBLETYPE * a_Dest) const; - void SetBlocks (const BLOCKTYPE * a_src); - void SetMeta (const NIBBLETYPE * a_src); - void SetBlockLight(const NIBBLETYPE * a_src); - void SetSkyLight (const NIBBLETYPE * a_src); + /** Copies the blocktype data from the specified flat array into the internal representation. + Allocates sections that are needed for the operation. + Requires that a_Src is a valid pointer. */ + void SetBlockTypes(const BLOCKTYPE * a_Src); + + /** Copies the metadata from the specified flat array into the internal representation. + Allocates sectios that are needed for the operation. + Requires that a_Src is a valid pointer. */ + void SetMetas(const NIBBLETYPE * a_Src); + + /** Copies the blocklight data from the specified flat array into the internal representation. + Allocates sectios that are needed for the operation. + Allows a_Src to be NULL, in which case it doesn't do anything. */ + void SetBlockLight(const NIBBLETYPE * a_Src); + + /** Copies the skylight data from the specified flat array into the internal representation. + Allocates sectios that are needed for the operation. + Allows a_Src to be NULL, in which case it doesn't do anything. */ + void SetSkyLight(const NIBBLETYPE * a_Src); private: - static const size_t CHUNK_SECTION_HEIGHT = 16; - static const size_t CHUNK_SECTION_COUNT = (256 / CHUNK_SECTION_HEIGHT); + static const size_t SectionHeight = 16; + static const size_t NumSections = (cChunkDef::Height / SectionHeight); + static const size_t SegmentLength = cChunkDef::Width * cChunkDef::Height * SectionHeight; + static const size_t SectionBlockCount = SectionHeight * cChunkDef::Width * cChunkDef::Width; #if __cplusplus < 201103L // auto_ptr style interface for memory management @@ -69,13 +100,13 @@ private: #endif struct sChunkSection { - BLOCKTYPE m_BlockTypes [CHUNK_SECTION_HEIGHT * 16 * 16]; - NIBBLETYPE m_BlockMeta [CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; - NIBBLETYPE m_BlockLight [CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; - NIBBLETYPE m_BlockSkyLight[CHUNK_SECTION_HEIGHT * 16 * 16 / 2]; + BLOCKTYPE m_BlockTypes [SectionBlockCount]; + NIBBLETYPE m_BlockMeta [SectionBlockCount / 2]; + NIBBLETYPE m_BlockLight [SectionBlockCount / 2]; + NIBBLETYPE m_BlockSkyLight[SectionBlockCount / 2]; }; - sChunkSection * m_Sections[CHUNK_SECTION_COUNT]; + sChunkSection * m_Sections[NumSections]; /** Allocates a new section. Entry-point to custom allocators. */ static sChunkSection * Allocate(void); diff --git a/src/ChunkDataCallback.h b/src/ChunkDataCallback.h index e916d6486..0c8b1098f 100644 --- a/src/ChunkDataCallback.h +++ b/src/ChunkDataCallback.h @@ -1,11 +1,20 @@ +// ChunkDataCallback.h + +// Declares the cChunkDataCallback interface and several trivial descendants, for reading chunk data + + + + #pragma once - #include "ChunkData.h" + + + /** Interface class used for getting data out of a chunk using the GetAllData() function. Implementation must use the pointers immediately and NOT store any of them for later use The virtual methods are called in the same order as they're declared here. @@ -41,6 +50,10 @@ public: virtual void BlockEntity(cBlockEntity * a_Entity) {UNUSED(a_Entity); }; } ; + + + + /** A simple implementation of the cChunkDataCallback interface that collects all block data into a buffer */ class cChunkDataCollector : @@ -59,6 +72,9 @@ protected: }; + + + /** A simple implementation of the cChunkDataCallback interface that collects all block data into a single buffer */ class cChunkDataArrayCollector : @@ -73,15 +89,18 @@ protected: virtual void ChunkData(const cChunkData & a_ChunkBuffer) override { - a_ChunkBuffer.CopyBlocks(m_BlockData); - a_ChunkBuffer.CopyMeta(m_BlockData + cChunkDef::NumBlocks); + a_ChunkBuffer.CopyBlockTypes(m_BlockData); + a_ChunkBuffer.CopyMetas(m_BlockData + cChunkDef::NumBlocks); a_ChunkBuffer.CopyBlockLight(m_BlockData + 3 * cChunkDef::NumBlocks / 2); a_ChunkBuffer.CopySkyLight(m_BlockData + 2 * cChunkDef::NumBlocks); } }; -/** A simple implementation of the cChunkDataCallback interface that collects all block data into a separate buffers -*/ + + + + +/** A simple implementation of the cChunkDataCallback interface that collects all block data into separate buffers */ class cChunkDataSeparateCollector : public cChunkDataCallback { @@ -96,10 +115,13 @@ protected: virtual void ChunkData(const cChunkData & a_ChunkBuffer) override { - a_ChunkBuffer.CopyBlocks(m_BlockTypes); - a_ChunkBuffer.CopyMeta(m_BlockMetas); - a_ChunkBuffer.CopyBlockLight(m_BlockLight); - a_ChunkBuffer.CopySkyLight(m_BlockSkyLight); + a_ChunkBuffer.CopyBlockTypes(m_BlockTypes); + a_ChunkBuffer.CopyMetas(m_BlockMetas); + a_ChunkBuffer.CopyBlockLight(m_BlockLight); + a_ChunkBuffer.CopySkyLight(m_BlockSkyLight); } } ; + + + diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index 879252c34..dc19bf500 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -27,7 +27,7 @@ class cReader : { for (int z = 0; z < cChunkDef::Width; z++) { - a_ChunkBuffer.CopyBlocks(OutputRows + OutputIdx * 16, InputIdx * 16, 16); + a_ChunkBuffer.CopyBlockTypes(OutputRows + OutputIdx * 16, InputIdx * 16, 16); InputIdx++; OutputIdx += 3; } // for z From 80fe19c0e2e4433d8332dbe5a9c2fcba0be06f68 Mon Sep 17 00:00:00 2001 From: worktycho Date: Thu, 29 May 2014 17:41:07 +0100 Subject: [PATCH 191/214] Fixed overflow bug --- src/ChunkData.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index cc4793ec3..13be65fd7 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -333,25 +333,28 @@ cChunkData cChunkData::Copy(void) const void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) const { - // TODO: This code seems wrong. It always copies into a_Dest[i * SegmentLength], even when a_Idx > 0 + size_t toskip = a_Idx; + for (size_t i = 0; i < NumSections; i++) { const size_t SegmentLength = SectionHeight * 16 * 16; - if (a_Idx > 0) + size_t startpos = 0; + if (toskip > 0) { - a_Idx = std::max(a_Idx - a_Length, (size_t) 0); + toskip = std::max(toskip - SegmentLength, (size_t) 0); + startpos = SegmentLength - toskip; } - if (a_Idx == 0) + if (toskip == 0) { size_t ToCopy = std::min(SegmentLength, a_Length); a_Length -= ToCopy; if (m_Sections[i] != NULL) { - memcpy(&a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockTypes, sizeof(BLOCKTYPE) * ToCopy); + memcpy(&a_Dest[(i * SegmentLength) - a_Idx], (&m_Sections[i]->m_BlockTypes) + startpos, sizeof(BLOCKTYPE) * (ToCopy - startpos)); } else { - memset(&a_Dest[i * SegmentLength], 0, sizeof(BLOCKTYPE) * ToCopy); + memset(&a_Dest[(i * SegmentLength) - a_Idx], 0, sizeof(BLOCKTYPE) * (ToCopy - startpos)); } } } From c5763f3af700fe2df0be0ceb2fe9a580384c839e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 29 May 2014 19:42:39 +0200 Subject: [PATCH 192/214] Fixed test compilation. --- tests/ChunkData/ArraytoCoord.cpp | 12 ++++++------ tests/ChunkData/Copies.cpp | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/ChunkData/ArraytoCoord.cpp b/tests/ChunkData/ArraytoCoord.cpp index 37533de77..4942ababb 100644 --- a/tests/ChunkData/ArraytoCoord.cpp +++ b/tests/ChunkData/ArraytoCoord.cpp @@ -13,13 +13,13 @@ int main(int argc, char** argv) BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); SrcBlockBuffer[7 + (4 * 16) + (5 * 16 * 16)] = 0xCD; - buffer.SetBlocks(SrcBlockBuffer); + buffer.SetBlockTypes(SrcBlockBuffer); testassert(buffer.GetBlock(7,5,4) == 0xCD); NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xE; - buffer.SetMeta(SrcNibbleBuffer); + buffer.SetMetas(SrcNibbleBuffer); testassert(buffer.GetMeta(6, 2, 1) == 0xE); memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); @@ -40,13 +40,13 @@ int main(int argc, char** argv) BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); SrcBlockBuffer[7 + (4 * 16) + (24 * 16 * 16)] = 0xCD; - buffer.SetBlocks(SrcBlockBuffer); + buffer.SetBlockTypes(SrcBlockBuffer); testassert(buffer.GetBlock(7, 24, 4) == 0xCD); NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); SrcNibbleBuffer[(6 + (1 * 16) + (24 * 16 * 16)) / 2] = 0xE; - buffer.SetMeta(SrcNibbleBuffer); + buffer.SetMetas(SrcNibbleBuffer); testassert(buffer.GetMeta(6, 24, 1) == 0xE); memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); @@ -66,12 +66,12 @@ int main(int argc, char** argv) BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - buffer.SetBlocks(SrcBlockBuffer); + buffer.SetBlockTypes(SrcBlockBuffer); testassert(buffer.GetBlock(7, 24, 4) == 0x00); NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256/2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - buffer.SetMeta(SrcNibbleBuffer); + buffer.SetMetas(SrcNibbleBuffer); testassert(buffer.GetMeta(6, 24, 1) == 0x0); memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); diff --git a/tests/ChunkData/Copies.cpp b/tests/ChunkData/Copies.cpp index 78a458f5b..ef0329451 100644 --- a/tests/ChunkData/Copies.cpp +++ b/tests/ChunkData/Copies.cpp @@ -25,14 +25,14 @@ int main(int argc, char** argv) SrcBlockBuffer[i+3] = 0xEF; } - buffer.SetBlocks(SrcBlockBuffer); + buffer.SetBlockTypes(SrcBlockBuffer); BLOCKTYPE DstBlockBuffer[16 * 16 * 256]; - buffer.CopyBlocks(DstBlockBuffer); + buffer.CopyBlockTypes(DstBlockBuffer); testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) - 1) == 0); memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - buffer.SetBlocks(SrcBlockBuffer); - buffer.CopyBlocks(DstBlockBuffer); + buffer.SetBlockTypes(SrcBlockBuffer); + buffer.CopyBlockTypes(DstBlockBuffer); testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) - 1) == 0); } @@ -48,14 +48,14 @@ int main(int argc, char** argv) SrcNibbleBuffer[i+3] = 0xBE; } - buffer.SetMeta(SrcNibbleBuffer); + buffer.SetMetas(SrcNibbleBuffer); NIBBLETYPE DstNibbleBuffer[16 * 16 * 256/ 2]; - buffer.CopyMeta(DstNibbleBuffer); + buffer.CopyMetas(DstNibbleBuffer); testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - buffer.SetMeta(SrcNibbleBuffer); - buffer.CopyMeta(DstNibbleBuffer); + buffer.SetMetas(SrcNibbleBuffer); + buffer.CopyMetas(DstNibbleBuffer); testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); @@ -114,13 +114,13 @@ int main(int argc, char** argv) BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); BLOCKTYPE DstBlockBuffer[16 * 16 * 256]; - buffer.CopyBlocks(DstBlockBuffer); + buffer.CopyBlockTypes(DstBlockBuffer); testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) - 1) == 0); NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); NIBBLETYPE DstNibbleBuffer[16 * 16 * 256 / 2]; - buffer.CopyMeta(DstNibbleBuffer); + buffer.CopyMetas(DstNibbleBuffer); testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); From 0cfee5d141f63d0d9ee339e4fab3ad8ac15f884d Mon Sep 17 00:00:00 2001 From: worktycho Date: Thu, 29 May 2014 19:10:35 +0100 Subject: [PATCH 193/214] Fixed Wrong types in nibble sizeofs --- src/ChunkData.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 13be65fd7..46bd0b946 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -375,7 +375,7 @@ void cChunkData::CopyMetas(NIBBLETYPE * a_Dest) const } else { - memset(&a_Dest[i * SegmentLength], 0, sizeof(BLOCKTYPE) * SegmentLength); + memset(&a_Dest[i * SegmentLength], 0, sizeof(NIBBLETYPE) * SegmentLength); } } } @@ -395,7 +395,7 @@ void cChunkData::CopyBlockLight(NIBBLETYPE * a_Dest) const } else { - memset(&a_Dest[i * SegmentLength], 0, sizeof(BLOCKTYPE) * SegmentLength); + memset(&a_Dest[i * SegmentLength], 0, sizeof(NIBBLETYPE) * SegmentLength); } } } @@ -415,7 +415,7 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_Dest) const } else { - memset(&a_Dest[i * SegmentLength], 0xff, sizeof(BLOCKTYPE) * SegmentLength); + memset(&a_Dest[i * SegmentLength], 0xff, sizeof(NIBBLETYPE) * SegmentLength); } } } From 59068b77b7215461b4aaf11c2db91c1657b7f91d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 29 May 2014 20:18:37 +0200 Subject: [PATCH 194/214] Fixed wrong block sizes for copying / setting. --- src/ChunkData.cpp | 75 ++++++++++++++++++-------------------- src/ChunkData.h | 3 +- tests/ChunkData/Copies.cpp | 32 ++++++++-------- 3 files changed, 52 insertions(+), 58 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 46bd0b946..2628b3410 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -208,7 +208,7 @@ NIBBLETYPE cChunkData::GetMeta(int a_RelX, int a_RelY, int a_RelZ) const if (m_Sections[Section] != NULL) { int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); - return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f; + return (m_Sections[Section]->m_BlockMetas[Index / 2] >> ((Index & 1) * 4)) & 0x0f; } else { @@ -251,9 +251,9 @@ bool cChunkData::SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble ZeroSection(m_Sections[Section]); } int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); - NIBBLETYPE oldval = m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4) & 0xf; - m_Sections[Section]->m_BlockMeta[Index / 2] = static_cast( - (m_Sections[Section]->m_BlockMeta[Index / 2] & (0xf0 >> ((Index & 1) * 4))) | // The untouched nibble + NIBBLETYPE oldval = m_Sections[Section]->m_BlockMetas[Index / 2] >> ((Index & 1) * 4) & 0xf; + m_Sections[Section]->m_BlockMetas[Index / 2] = static_cast( + (m_Sections[Section]->m_BlockMetas[Index / 2] & (0xf0 >> ((Index & 1) * 4))) | // The untouched nibble ((a_Nibble & 0x0f) << ((Index & 1) * 4)) // The nibble being set ); return oldval == a_Nibble; @@ -333,28 +333,27 @@ cChunkData cChunkData::Copy(void) const void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) const { - size_t toskip = a_Idx; + size_t ToSkip = a_Idx; for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = SectionHeight * 16 * 16; - size_t startpos = 0; - if (toskip > 0) + size_t StartPos = 0; + if (ToSkip > 0) { - toskip = std::max(toskip - SegmentLength, (size_t) 0); - startpos = SegmentLength - toskip; + ToSkip = std::max(ToSkip - SectionBlockCount, (size_t) 0); // TODO: Still can underflow + StartPos = SectionBlockCount - ToSkip; } - if (toskip == 0) + if (ToSkip == 0) { - size_t ToCopy = std::min(SegmentLength, a_Length); + size_t ToCopy = std::min(SectionBlockCount, a_Length); a_Length -= ToCopy; if (m_Sections[i] != NULL) { - memcpy(&a_Dest[(i * SegmentLength) - a_Idx], (&m_Sections[i]->m_BlockTypes) + startpos, sizeof(BLOCKTYPE) * (ToCopy - startpos)); + memcpy(&a_Dest[(i * SectionBlockCount) - a_Idx], (&m_Sections[i]->m_BlockTypes) + StartPos, sizeof(BLOCKTYPE) * (ToCopy - StartPos)); } else { - memset(&a_Dest[(i * SegmentLength) - a_Idx], 0, sizeof(BLOCKTYPE) * (ToCopy - startpos)); + memset(&a_Dest[(i * SectionBlockCount) - a_Idx], 0, sizeof(BLOCKTYPE) * (ToCopy - StartPos)); } } } @@ -368,14 +367,13 @@ void cChunkData::CopyMetas(NIBBLETYPE * a_Dest) const { for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = SectionHeight * 16 * 16 / 2; if (m_Sections[i] != NULL) { - memcpy(&a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockMeta, sizeof(NIBBLETYPE) * SegmentLength); + memcpy(&a_Dest[i * SectionBlockCount / 2], &m_Sections[i]->m_BlockMetas, sizeof(m_Sections[i]->m_BlockMetas)); } else { - memset(&a_Dest[i * SegmentLength], 0, sizeof(NIBBLETYPE) * SegmentLength); + memset(&a_Dest[i * SectionBlockCount / 2], 0, sizeof(m_Sections[i]->m_BlockMetas)); } } } @@ -388,14 +386,13 @@ void cChunkData::CopyBlockLight(NIBBLETYPE * a_Dest) const { for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = SectionHeight * 16 * 16 / 2; if (m_Sections[i] != NULL) { - memcpy(&a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockLight, sizeof(NIBBLETYPE) * SegmentLength); + memcpy(&a_Dest[i * SectionBlockCount / 2], &m_Sections[i]->m_BlockLight, sizeof(m_Sections[i]->m_BlockLight)); } else { - memset(&a_Dest[i * SegmentLength], 0, sizeof(NIBBLETYPE) * SegmentLength); + memset(&a_Dest[i * SectionBlockCount / 2], 0, sizeof(m_Sections[i]->m_BlockLight)); } } } @@ -408,14 +405,13 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_Dest) const { for (size_t i = 0; i < NumSections; i++) { - const size_t SegmentLength = SectionHeight * 16 * 16 / 2; if (m_Sections[i] != NULL) { - memcpy(&a_Dest[i * SegmentLength], &m_Sections[i]->m_BlockSkyLight, sizeof(NIBBLETYPE) * SegmentLength); + memcpy(&a_Dest[i * SectionBlockCount / 2], &m_Sections[i]->m_BlockSkyLight, sizeof(m_Sections[i]->m_BlockSkyLight)); } else { - memset(&a_Dest[i * SegmentLength], 0xff, sizeof(NIBBLETYPE) * SegmentLength); + memset(&a_Dest[i * SectionBlockCount / 2], 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); } } } @@ -428,18 +424,17 @@ void cChunkData::SetBlockTypes(const BLOCKTYPE * a_Src) { ASSERT(a_Src != NULL); - static const size_t SegmentLength = SectionHeight * 16 * 16; for (size_t i = 0; i < NumSections; i++) { // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(&m_Sections[i]->m_BlockTypes, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + memcpy(&m_Sections[i]->m_BlockTypes, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockTypes)); continue; } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SegmentLength, SegmentLength, (const BLOCKTYPE)0)) + if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, (const BLOCKTYPE)0)) { // No need for the section, the data is all-air continue; @@ -447,8 +442,8 @@ void cChunkData::SetBlockTypes(const BLOCKTYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(&m_Sections[i]->m_BlockTypes, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); - memset(m_Sections[i]->m_BlockMeta, 0x00, sizeof(m_Sections[i]->m_BlockMeta)); + memcpy(&m_Sections[i]->m_BlockTypes, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockTypes)); + memset(m_Sections[i]->m_BlockMetas, 0x00, sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); } // for i - m_Sections[] @@ -466,12 +461,12 @@ void cChunkData::SetMetas(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(&m_Sections[i]->m_BlockMeta, &a_Src[i * SegmentLength], sizeof(NIBBLETYPE) * SegmentLength); + memcpy(&m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockMetas)); continue; } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SegmentLength, SegmentLength, (NIBBLETYPE)0)) + if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, (NIBBLETYPE)0)) { // No need for the section, the data is all zeroes continue; @@ -479,7 +474,7 @@ void cChunkData::SetMetas(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(&m_Sections[i]->m_BlockMeta, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + memcpy(&m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); @@ -502,12 +497,12 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(&m_Sections[i]->m_BlockLight, &a_Src[i * SegmentLength], sizeof(NIBBLETYPE) * SegmentLength); + memcpy(&m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount], sizeof(NIBBLETYPE) * SectionBlockCount); continue; } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SegmentLength, SegmentLength, (NIBBLETYPE)0)) + if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, (NIBBLETYPE)0)) { // No need for the section, the data is all zeroes continue; @@ -515,9 +510,9 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(&m_Sections[i]->m_BlockLight, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + memcpy(&m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount], sizeof(BLOCKTYPE) * SectionBlockCount); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); - memset(m_Sections[i]->m_BlockMeta, 0x00, sizeof(m_Sections[i]->m_BlockMeta)); + memset(m_Sections[i]->m_BlockMetas, 0x00, sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); } // for i - m_Sections[] } @@ -537,12 +532,12 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(&m_Sections[i]->m_BlockSkyLight, &a_Src[i * SegmentLength], sizeof(NIBBLETYPE) * SegmentLength); + memcpy(&m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount], sizeof(NIBBLETYPE) * SectionBlockCount); continue; } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SegmentLength, SegmentLength, (NIBBLETYPE)0xff)) + if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, (NIBBLETYPE)0xff)) { // No need for the section, the data is all zeroes continue; @@ -550,9 +545,9 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(&m_Sections[i]->m_BlockSkyLight, &a_Src[i * SegmentLength], sizeof(BLOCKTYPE) * SegmentLength); + memcpy(&m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount], sizeof(BLOCKTYPE) * SectionBlockCount); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); - memset(m_Sections[i]->m_BlockMeta, 0x00, sizeof(m_Sections[i]->m_BlockMeta)); + memset(m_Sections[i]->m_BlockMetas, 0x00, sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); } // for i - m_Sections[] } @@ -584,7 +579,7 @@ void cChunkData::Free(cChunkData::sChunkSection * a_Section) void cChunkData::ZeroSection(cChunkData::sChunkSection * a_Section) const { memset(a_Section->m_BlockTypes, 0x00, sizeof(a_Section->m_BlockTypes)); - memset(a_Section->m_BlockMeta, 0x00, sizeof(a_Section->m_BlockMeta)); + memset(a_Section->m_BlockMetas, 0x00, sizeof(a_Section->m_BlockMetas)); memset(a_Section->m_BlockLight, 0x00, sizeof(a_Section->m_BlockLight)); memset(a_Section->m_BlockSkyLight, 0xff, sizeof(a_Section->m_BlockSkyLight)); } diff --git a/src/ChunkData.h b/src/ChunkData.h index 341c15301..fef31b5ad 100644 --- a/src/ChunkData.h +++ b/src/ChunkData.h @@ -91,7 +91,6 @@ private: static const size_t SectionHeight = 16; static const size_t NumSections = (cChunkDef::Height / SectionHeight); - static const size_t SegmentLength = cChunkDef::Width * cChunkDef::Height * SectionHeight; static const size_t SectionBlockCount = SectionHeight * cChunkDef::Width * cChunkDef::Width; #if __cplusplus < 201103L @@ -101,7 +100,7 @@ private: struct sChunkSection { BLOCKTYPE m_BlockTypes [SectionBlockCount]; - NIBBLETYPE m_BlockMeta [SectionBlockCount / 2]; + NIBBLETYPE m_BlockMetas [SectionBlockCount / 2]; NIBBLETYPE m_BlockLight [SectionBlockCount / 2]; NIBBLETYPE m_BlockSkyLight[SectionBlockCount / 2]; }; diff --git a/tests/ChunkData/Copies.cpp b/tests/ChunkData/Copies.cpp index ef0329451..788d2c558 100644 --- a/tests/ChunkData/Copies.cpp +++ b/tests/ChunkData/Copies.cpp @@ -19,10 +19,10 @@ int main(int argc, char** argv) BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; for (int i = 0; i < 16 * 16 * 256; i += 4) { - SrcBlockBuffer[i+0] = 0xDE; - SrcBlockBuffer[i+1] = 0xAD; - SrcBlockBuffer[i+2] = 0xBE; - SrcBlockBuffer[i+3] = 0xEF; + SrcBlockBuffer[i + 0] = 0xde; + SrcBlockBuffer[i + 1] = 0xad; + SrcBlockBuffer[i + 2] = 0xbe; + SrcBlockBuffer[i + 3] = 0xef; } buffer.SetBlockTypes(SrcBlockBuffer); @@ -42,10 +42,10 @@ int main(int argc, char** argv) NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) { - SrcNibbleBuffer[i+0] = 0xEF; - SrcNibbleBuffer[i+1] = 0xDE; - SrcNibbleBuffer[i+2] = 0xAD; - SrcNibbleBuffer[i+3] = 0xBE; + SrcNibbleBuffer[i + 0] = 0xde; + SrcNibbleBuffer[i + 1] = 0xad; + SrcNibbleBuffer[i + 2] = 0xbe; + SrcNibbleBuffer[i + 3] = 0xef; } buffer.SetMetas(SrcNibbleBuffer); @@ -66,10 +66,10 @@ int main(int argc, char** argv) NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) { - SrcNibbleBuffer[i+0] = 0xDE; - SrcNibbleBuffer[i+1] = 0xAD; - SrcNibbleBuffer[i+2] = 0xBE; - SrcNibbleBuffer[i+3] = 0xEF; + SrcNibbleBuffer[i + 0] = 0xde; + SrcNibbleBuffer[i + 1] = 0xad; + SrcNibbleBuffer[i + 2] = 0xbe; + SrcNibbleBuffer[i + 3] = 0xef; } buffer.SetBlockLight(SrcNibbleBuffer); @@ -90,10 +90,10 @@ int main(int argc, char** argv) NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; for (int i = 0; i < 16 * 16 * 256 / 2; i += 4) { - SrcNibbleBuffer[i+0] = 0xAD; - SrcNibbleBuffer[i+1] = 0xBE; - SrcNibbleBuffer[i+2] = 0xEF; - SrcNibbleBuffer[i+3] = 0xDE; + SrcNibbleBuffer[i + 0] = 0xde; + SrcNibbleBuffer[i + 1] = 0xad; + SrcNibbleBuffer[i + 2] = 0xbe; + SrcNibbleBuffer[i + 3] = 0xef; } buffer.SetSkyLight(SrcNibbleBuffer); From b50181e3614286b9624cf3b8f296d7b25509a55d Mon Sep 17 00:00:00 2001 From: worktycho Date: Thu, 29 May 2014 19:29:06 +0100 Subject: [PATCH 195/214] fix underflow Wish c++ could specify saturating unsigned underflow. --- src/ChunkData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 2628b3410..72187f393 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -340,7 +340,7 @@ void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Lengt size_t StartPos = 0; if (ToSkip > 0) { - ToSkip = std::max(ToSkip - SectionBlockCount, (size_t) 0); // TODO: Still can underflow + ToSkip = std::max((ssize_t)ToSkip - (ssize_t)SectionBlockCount, (size_t) 0); StartPos = SectionBlockCount - ToSkip; } if (ToSkip == 0) From 901e3ec4940f2a11f7866194f02732c813ce71b9 Mon Sep 17 00:00:00 2001 From: worktycho Date: Thu, 29 May 2014 19:35:47 +0100 Subject: [PATCH 196/214] Derp --- src/ChunkData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 72187f393..382e7a5a8 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -340,7 +340,7 @@ void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Lengt size_t StartPos = 0; if (ToSkip > 0) { - ToSkip = std::max((ssize_t)ToSkip - (ssize_t)SectionBlockCount, (size_t) 0); + ToSkip = std::max((ssize_t)ToSkip - (ssize_t)SectionBlockCount, (ssize_t) 0); StartPos = SectionBlockCount - ToSkip; } if (ToSkip == 0) From be10f07db02565fad77937bc6e9ccc6580f19158 Mon Sep 17 00:00:00 2001 From: worktycho Date: Thu, 29 May 2014 19:44:36 +0100 Subject: [PATCH 197/214] Fix bug when a_Idx is not a multiple of SectionBLockCount --- src/ChunkData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 382e7a5a8..be96be051 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -343,7 +343,7 @@ void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Lengt ToSkip = std::max((ssize_t)ToSkip - (ssize_t)SectionBlockCount, (ssize_t) 0); StartPos = SectionBlockCount - ToSkip; } - if (ToSkip == 0) + if (ToSkip < SectionBlockCount) { size_t ToCopy = std::min(SectionBlockCount, a_Length); a_Length -= ToCopy; From 8c4dd5dcfd91f8223e78ff7fd24f8e4e73d1f509 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 29 May 2014 21:41:44 +0200 Subject: [PATCH 198/214] Attempt at fixing an unresolved symbol in gcc / clang. --- src/ChunkData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index be96be051..74f5d78ba 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -345,7 +345,7 @@ void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Lengt } if (ToSkip < SectionBlockCount) { - size_t ToCopy = std::min(SectionBlockCount, a_Length); + size_t ToCopy = std::min(+SectionBlockCount, a_Length); a_Length -= ToCopy; if (m_Sections[i] != NULL) { From 0e2138736cd969a0dc931bbef31262da906cb832 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 30 May 2014 09:17:17 +0200 Subject: [PATCH 199/214] Fixed wrong copy sizes in cChunkData. --- src/ChunkData.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 74f5d78ba..5c11212ea 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -333,14 +333,14 @@ cChunkData cChunkData::Copy(void) const void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) const { - size_t ToSkip = a_Idx; + int ToSkip = a_Idx; for (size_t i = 0; i < NumSections; i++) { size_t StartPos = 0; if (ToSkip > 0) { - ToSkip = std::max((ssize_t)ToSkip - (ssize_t)SectionBlockCount, (ssize_t) 0); + ToSkip = std::max(ToSkip - (int)SectionBlockCount, 0); StartPos = SectionBlockCount - ToSkip; } if (ToSkip < SectionBlockCount) @@ -429,7 +429,7 @@ void cChunkData::SetBlockTypes(const BLOCKTYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(&m_Sections[i]->m_BlockTypes, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockTypes)); + memcpy(m_Sections[i]->m_BlockTypes, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockTypes)); continue; } @@ -442,7 +442,7 @@ void cChunkData::SetBlockTypes(const BLOCKTYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(&m_Sections[i]->m_BlockTypes, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockTypes)); + memcpy(m_Sections[i]->m_BlockTypes, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockTypes)); memset(m_Sections[i]->m_BlockMetas, 0x00, sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); @@ -461,7 +461,7 @@ void cChunkData::SetMetas(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(&m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockMetas)); + memcpy(m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockMetas)); continue; } @@ -474,7 +474,7 @@ void cChunkData::SetMetas(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(&m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockMetas)); + memcpy(m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); @@ -497,7 +497,7 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(&m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount], sizeof(NIBBLETYPE) * SectionBlockCount); + memcpy(m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockLight)); continue; } @@ -510,7 +510,7 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(&m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount], sizeof(BLOCKTYPE) * SectionBlockCount); + memcpy(m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockLight)); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); memset(m_Sections[i]->m_BlockMetas, 0x00, sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); @@ -532,7 +532,7 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(&m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount], sizeof(NIBBLETYPE) * SectionBlockCount); + memcpy(m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockSkyLight)); continue; } @@ -545,7 +545,7 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(&m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount], sizeof(BLOCKTYPE) * SectionBlockCount); + memcpy(m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockSkyLight)); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); memset(m_Sections[i]->m_BlockMetas, 0x00, sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); From 0b49529e4273a96e7f582ef4c321eaf8d65c629f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 30 May 2014 09:17:50 +0200 Subject: [PATCH 200/214] Fixed test return values. --- tests/ChunkData/ArraytoCoord.cpp | 65 +++++++++++++++++--------------- tests/ChunkData/Copies.cpp | 14 +++---- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/tests/ChunkData/ArraytoCoord.cpp b/tests/ChunkData/ArraytoCoord.cpp index 4942ababb..0daf38f7b 100644 --- a/tests/ChunkData/ArraytoCoord.cpp +++ b/tests/ChunkData/ArraytoCoord.cpp @@ -11,26 +11,26 @@ int main(int argc, char** argv) cChunkData buffer; BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; - memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - SrcBlockBuffer[7 + (4 * 16) + (5 * 16 * 16)] = 0xCD; + memset(SrcBlockBuffer, 0x00, sizeof(SrcBlockBuffer)); + SrcBlockBuffer[7 + (4 * 16) + (5 * 16 * 16)] = 0xcd; buffer.SetBlockTypes(SrcBlockBuffer); - testassert(buffer.GetBlock(7,5,4) == 0xCD); + testassert(buffer.GetBlock(7, 5, 4) == 0xcd); NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); - SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xE; + memset(SrcNibbleBuffer, 0x00, sizeof(SrcNibbleBuffer)); + SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xe; buffer.SetMetas(SrcNibbleBuffer); - testassert(buffer.GetMeta(6, 2, 1) == 0xE); + testassert(buffer.GetMeta(6, 2, 1) == 0xe); - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); - SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xE; + memset(SrcNibbleBuffer, 0x00, sizeof(SrcNibbleBuffer)); + SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xe; buffer.SetBlockLight(SrcNibbleBuffer); - testassert(buffer.GetBlockLight(6, 2, 1) == 0xE); + testassert(buffer.GetBlockLight(6, 2, 1) == 0xe); - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); - SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xE; + memset(SrcNibbleBuffer, 0x00, sizeof(SrcNibbleBuffer)); + SrcNibbleBuffer[(6 + (1 * 16) + (2 * 16 * 16)) / 2] = 0xe; buffer.SetSkyLight(SrcNibbleBuffer); - testassert(buffer.GetSkyLight(6, 2, 1) == 0xE); + testassert(buffer.GetSkyLight(6, 2, 1) == 0xe); } { @@ -38,26 +38,26 @@ int main(int argc, char** argv) cChunkData buffer; BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; - memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); - SrcBlockBuffer[7 + (4 * 16) + (24 * 16 * 16)] = 0xCD; + memset(SrcBlockBuffer, 0x00, sizeof(SrcBlockBuffer)); + SrcBlockBuffer[7 + (4 * 16) + (24 * 16 * 16)] = 0xcd; buffer.SetBlockTypes(SrcBlockBuffer); - testassert(buffer.GetBlock(7, 24, 4) == 0xCD); + testassert(buffer.GetBlock(7, 24, 4) == 0xcd); NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 / 2); - SrcNibbleBuffer[(6 + (1 * 16) + (24 * 16 * 16)) / 2] = 0xE; + memset(SrcNibbleBuffer, 0x00, sizeof(SrcNibbleBuffer)); + SrcNibbleBuffer[(6 + (1 * 16) + (24 * 16 * 16)) / 2] = 0xe; buffer.SetMetas(SrcNibbleBuffer); - testassert(buffer.GetMeta(6, 24, 1) == 0xE); + testassert(buffer.GetMeta(6, 24, 1) == 0xe); - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); - SrcNibbleBuffer[(6+1*16+24*16*16)/2] = 0xE; + memset(SrcNibbleBuffer, 0x00, sizeof(SrcNibbleBuffer)); + SrcNibbleBuffer[(6 + 1 * 16 + 24 * 16 * 16) / 2] = 0xe; buffer.SetBlockLight(SrcNibbleBuffer); - testassert(buffer.GetBlockLight(6,24,1) == 0xE); + testassert(buffer.GetBlockLight(6, 24, 1) == 0xe); - memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 / 2); - SrcNibbleBuffer[(6 + (1 * 16) + (24 * 16 * 16))/2] = 0xE; + memset(SrcNibbleBuffer, 0xff, sizeof(SrcNibbleBuffer)); + SrcNibbleBuffer[(6 + (1 * 16) + (24 * 16 * 16)) / 2] = 0xe; buffer.SetSkyLight(SrcNibbleBuffer); - testassert(buffer.GetSkyLight(6, 24, 1) == 0xE); + testassert(buffer.GetSkyLight(6, 24, 1) == 0xe); } { @@ -65,22 +65,25 @@ int main(int argc, char** argv) cChunkData buffer; BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; - memset(SrcBlockBuffer, 0x00, 16 * 16 * 256); + memset(SrcBlockBuffer, 0x00, sizeof(SrcBlockBuffer)); buffer.SetBlockTypes(SrcBlockBuffer); testassert(buffer.GetBlock(7, 24, 4) == 0x00); - NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256/2]; - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + NIBBLETYPE SrcNibbleBuffer[16 * 16 * 256 / 2]; + memset(SrcNibbleBuffer, 0x00, sizeof(SrcNibbleBuffer)); buffer.SetMetas(SrcNibbleBuffer); testassert(buffer.GetMeta(6, 24, 1) == 0x0); - memset(SrcNibbleBuffer, 0x00, 16 * 16 * 256 /2); + memset(SrcNibbleBuffer, 0x00, sizeof(SrcNibbleBuffer)); buffer.SetBlockLight(SrcNibbleBuffer); - testassert(buffer.GetBlockLight(6,24,1) == 0x0); + testassert(buffer.GetBlockLight(6, 24, 1) == 0x0); - memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 /2); + memset(SrcNibbleBuffer, 0xff, sizeof(SrcNibbleBuffer)); buffer.SetSkyLight(SrcNibbleBuffer); - testassert(buffer.GetSkyLight(6, 24, 1) == 0xF); + testassert(buffer.GetSkyLight(6, 24, 1) == 0xf); } + + // All tests passed: + return 0; } diff --git a/tests/ChunkData/Copies.cpp b/tests/ChunkData/Copies.cpp index 788d2c558..312441eee 100644 --- a/tests/ChunkData/Copies.cpp +++ b/tests/ChunkData/Copies.cpp @@ -34,8 +34,8 @@ int main(int argc, char** argv) buffer.SetBlockTypes(SrcBlockBuffer); buffer.CopyBlockTypes(DstBlockBuffer); testassert(memcmp(SrcBlockBuffer, DstBlockBuffer, (16 * 16 * 256) - 1) == 0); - } + { cChunkData buffer; @@ -57,9 +57,8 @@ int main(int argc, char** argv) buffer.SetMetas(SrcNibbleBuffer); buffer.CopyMetas(DstNibbleBuffer); testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); - - } + { cChunkData buffer; @@ -81,9 +80,8 @@ int main(int argc, char** argv) buffer.SetBlockLight(SrcNibbleBuffer); buffer.CopyBlockLight(DstNibbleBuffer); testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) - 1) == 0); - - } + { cChunkData buffer; @@ -101,13 +99,12 @@ int main(int argc, char** argv) buffer.CopySkyLight(DstNibbleBuffer); testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); - memset(SrcNibbleBuffer, 0xFF, 16 * 16 * 256 / 2); buffer.SetSkyLight(SrcNibbleBuffer); buffer.CopySkyLight(DstNibbleBuffer); testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); - } + { cChunkData buffer; @@ -131,4 +128,7 @@ int main(int argc, char** argv) buffer.CopySkyLight(DstNibbleBuffer); testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 / 2) - 1) == 0); } + + // All tests successful: + return 0; } From 5368c5dd79bce465d32517eec62701abc9b380d9 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 30 May 2014 09:49:57 +0200 Subject: [PATCH 201/214] Fixed sign comparison. --- src/ChunkData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 5c11212ea..6ccb28fe4 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -343,7 +343,7 @@ void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Lengt ToSkip = std::max(ToSkip - (int)SectionBlockCount, 0); StartPos = SectionBlockCount - ToSkip; } - if (ToSkip < SectionBlockCount) + if (ToSkip < (int)SectionBlockCount) { size_t ToCopy = std::min(+SectionBlockCount, a_Length); a_Length -= ToCopy; From 0b60caac4ae8e7762cc530a0a7b6a7abe8c33262 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 30 May 2014 10:56:12 +0200 Subject: [PATCH 202/214] Test failures are reported verbosely and into the debug console on Win. --- src/Globals.h | 20 ++++++++++++++++++-- tests/ChunkData/CMakeLists.txt | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/Globals.h b/src/Globals.h index 85cfd2f18..7b7a34541 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -271,9 +271,25 @@ void inline LOGERROR(const char* a_Format, ...) { }; + #ifdef _WIN32 + #define REPORT_ERROR(FMT, ...) \ + { \ + AString msg = Printf(FMT, __VA_ARGS__); \ + puts(msg.c_str()); \ + fflush(stdout); \ + OutputDebugStringA(msg.c_str()); \ + } + #else + #define REPORT_ERROR(FMT, ...) \ + { \ + AString msg = Printf(FMT, __VA_ARGS__); \ + puts(msg.c_str()); \ + fflush(stdout); \ + } + #endif #define ASSERT(x) do { if (!(x)) { throw cAssertFailure();} } while (0) - #define testassert(x) do { if(!(x)) { exit(1); } } while (0) - #define CheckAsserts(x) do { try {x} catch (cAssertFailure) { break; } exit(1); } while (0) + #define testassert(x) do { if(!(x)) { REPORT_ERROR("Test failure: %s, file %s, line %d\n", #x, __FILE__, __LINE__); exit(1); } } while (0) + #define CheckAsserts(x) do { try {x} catch (cAssertFailure) { break; } REPORT_ERROR("Test failure: assert didn't fire for %s, file %s, line %d\n", #x, __FILE__, __LINE__); exit(1); } while (0) #else #ifdef _DEBUG diff --git a/tests/ChunkData/CMakeLists.txt b/tests/ChunkData/CMakeLists.txt index a2bd9fd22..fd508cc6e 100644 --- a/tests/ChunkData/CMakeLists.txt +++ b/tests/ChunkData/CMakeLists.txt @@ -5,7 +5,7 @@ enable_testing() include_directories(${CMAKE_SOURCE_DIR}/src/) add_definitions(-DTEST_GLOBALS=1) -add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkData.cpp) +add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkData.cpp ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp) add_executable(creatable-exe creatable.cpp) From 730e36844e152794cf85c4d1e9b7a84fd8be86ee Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 30 May 2014 11:01:13 +0200 Subject: [PATCH 203/214] Test failures break into MSVC debugger. --- src/Globals.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Globals.h b/src/Globals.h index 7b7a34541..c5768facf 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -272,12 +272,18 @@ void inline LOGERROR(const char* a_Format, ...) }; #ifdef _WIN32 + #if (defined(_MSC_VER) && defined(_DEBUG)) + #define DBG_BREAK _CrtDbgBreak() + #else + #define DBG_BREAK + #endif #define REPORT_ERROR(FMT, ...) \ { \ AString msg = Printf(FMT, __VA_ARGS__); \ puts(msg.c_str()); \ fflush(stdout); \ OutputDebugStringA(msg.c_str()); \ + DBG_BREAK; \ } #else #define REPORT_ERROR(FMT, ...) \ From e136f6e0f5b41ee7c9d784009ef40c9ac2e2e6fe Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 30 May 2014 11:35:29 +0200 Subject: [PATCH 204/214] Fixed cChunkData nibble copying. --- src/ChunkData.cpp | 18 +++++++++--------- tests/ChunkData/Coordinates.cpp | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 6ccb28fe4..6178dbc0d 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -461,12 +461,12 @@ void cChunkData::SetMetas(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockMetas)); + memcpy(m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount / 2], sizeof(m_Sections[i]->m_BlockMetas)); continue; } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, (NIBBLETYPE)0)) + if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, (NIBBLETYPE)0)) { // No need for the section, the data is all zeroes continue; @@ -474,7 +474,7 @@ void cChunkData::SetMetas(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockMetas)); + memcpy(m_Sections[i]->m_BlockMetas, &a_Src[i * SectionBlockCount / 2], sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); @@ -497,12 +497,12 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockLight)); + memcpy(m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount / 2], sizeof(m_Sections[i]->m_BlockLight)); continue; } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, (NIBBLETYPE)0)) + if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, (NIBBLETYPE)0)) { // No need for the section, the data is all zeroes continue; @@ -510,7 +510,7 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockLight)); + memcpy(m_Sections[i]->m_BlockLight, &a_Src[i * SectionBlockCount / 2], sizeof(m_Sections[i]->m_BlockLight)); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); memset(m_Sections[i]->m_BlockMetas, 0x00, sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockSkyLight, 0xff, sizeof(m_Sections[i]->m_BlockSkyLight)); @@ -532,12 +532,12 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) // If the section is already allocated, copy the data into it: if (m_Sections[i] != NULL) { - memcpy(m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockSkyLight)); + memcpy(m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount / 2], sizeof(m_Sections[i]->m_BlockSkyLight)); continue; } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, (NIBBLETYPE)0xff)) + if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, (NIBBLETYPE)0xff)) { // No need for the section, the data is all zeroes continue; @@ -545,7 +545,7 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) // Allocate the section and copy the data into it: m_Sections[i] = Allocate(); - memcpy(m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount], sizeof(m_Sections[i]->m_BlockSkyLight)); + memcpy(m_Sections[i]->m_BlockSkyLight, &a_Src[i * SectionBlockCount / 2], sizeof(m_Sections[i]->m_BlockSkyLight)); memset(m_Sections[i]->m_BlockTypes, 0x00, sizeof(m_Sections[i]->m_BlockTypes)); memset(m_Sections[i]->m_BlockMetas, 0x00, sizeof(m_Sections[i]->m_BlockMetas)); memset(m_Sections[i]->m_BlockLight, 0x00, sizeof(m_Sections[i]->m_BlockLight)); diff --git a/tests/ChunkData/Coordinates.cpp b/tests/ChunkData/Coordinates.cpp index 938c66dcc..48d731c7e 100644 --- a/tests/ChunkData/Coordinates.cpp +++ b/tests/ChunkData/Coordinates.cpp @@ -109,14 +109,14 @@ int main(int argc, char** argv) // Zero's buffer.SetBlock(0, 0, 0, 0x0); - buffer.SetBlock(0, 0, 1, 0xAB); + buffer.SetBlock(0, 0, 1, 0xab); testassert(buffer.GetBlock(0, 0, 0) == 0x0); - testassert(buffer.GetBlock(0, 0, 1) == 0xAB); + testassert(buffer.GetBlock(0, 0, 1) == 0xab); buffer.SetMeta(0, 16, 0, 0x0); - buffer.SetMeta(0, 16, 1, 0xC); + buffer.SetMeta(0, 16, 1, 0xc); testassert(buffer.GetMeta(0, 16, 0) == 0x0); - testassert(buffer.GetMeta(0, 16, 1) == 0xC); + testassert(buffer.GetMeta(0, 16, 1) == 0xc); } From d854d3af1c724304997488d2b61518c85acb076a Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 30 May 2014 14:43:33 +0100 Subject: [PATCH 205/214] removed unneded addressof --- src/ChunkData.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 6178dbc0d..258853ea0 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -55,6 +55,7 @@ cChunkData::~cChunkData() for (size_t i = 0; i < NumSections; i++) { Free(m_Sections[i]); + m_Sections[i] = NULL; } } @@ -93,6 +94,7 @@ cChunkData::~cChunkData() for (size_t i = 0; i < NumSections; i++) { Free(m_Sections[i]); + m_Sections[i] = NULL; } } @@ -101,6 +103,7 @@ cChunkData::~cChunkData() for (size_t i = 0; i < NumSections; i++) { m_Sections[i] = a_Other.m_Sections[i]; + a_Other.m_Sections[i] = NULL; } a_Other.m_IsOwner = false; return *this; @@ -333,27 +336,28 @@ cChunkData cChunkData::Copy(void) const void cChunkData::CopyBlockTypes(BLOCKTYPE * a_Dest, size_t a_Idx, size_t a_Length) const { - int ToSkip = a_Idx; + size_t ToSkip = a_Idx; for (size_t i = 0; i < NumSections; i++) { size_t StartPos = 0; if (ToSkip > 0) { - ToSkip = std::max(ToSkip - (int)SectionBlockCount, 0); - StartPos = SectionBlockCount - ToSkip; + StartPos = std::min(ToSkip, +SectionBlockCount); + ToSkip -= StartPos; } - if (ToSkip < (int)SectionBlockCount) + if (StartPos < SectionBlockCount) { - size_t ToCopy = std::min(+SectionBlockCount, a_Length); + size_t ToCopy = std::min(+SectionBlockCount - StartPos, a_Length); a_Length -= ToCopy; if (m_Sections[i] != NULL) { - memcpy(&a_Dest[(i * SectionBlockCount) - a_Idx], (&m_Sections[i]->m_BlockTypes) + StartPos, sizeof(BLOCKTYPE) * (ToCopy - StartPos)); + BLOCKTYPE * blockbuffer = m_Sections[i]->m_BlockTypes; + memcpy(&a_Dest[(i * SectionBlockCount) + StartPos - a_Idx], blockbuffer + StartPos, sizeof(BLOCKTYPE) * ToCopy); } else { - memset(&a_Dest[(i * SectionBlockCount) - a_Idx], 0, sizeof(BLOCKTYPE) * (ToCopy - StartPos)); + memset(&a_Dest[(i * SectionBlockCount) - a_Idx], 0, sizeof(BLOCKTYPE) * ToCopy); } } } From f26ddac61944ccae3223be5c4403171e04e306b9 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 30 May 2014 14:50:30 +0100 Subject: [PATCH 206/214] removed NULL assignment to const value --- src/ChunkData.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 258853ea0..142c141c4 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -103,7 +103,6 @@ cChunkData::~cChunkData() for (size_t i = 0; i < NumSections; i++) { m_Sections[i] = a_Other.m_Sections[i]; - a_Other.m_Sections[i] = NULL; } a_Other.m_IsOwner = false; return *this; From 76c07b1ec72033d05a4dd54360451f6492c2a31e Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 30 May 2014 17:44:24 +0200 Subject: [PATCH 207/214] Added a cChunkData::CopyBlockTypes() unit test. --- tests/ChunkData/CMakeLists.txt | 3 ++ tests/ChunkData/CopyBlocks.cpp | 65 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tests/ChunkData/CopyBlocks.cpp diff --git a/tests/ChunkData/CMakeLists.txt b/tests/ChunkData/CMakeLists.txt index fd508cc6e..381e11cc2 100644 --- a/tests/ChunkData/CMakeLists.txt +++ b/tests/ChunkData/CMakeLists.txt @@ -24,3 +24,6 @@ add_executable(arraystocoords-exe ArraytoCoord.cpp) target_link_libraries(arraystocoords-exe ChunkBuffer) add_test(NAME arraystocoords-test COMMAND arraystocoords-exe) +add_executable(copyblocks-exe CopyBlocks.cpp) +target_link_libraries(copyblocks-exe ChunkBuffer) +add_test(NAME copyblocks-test COMMAND copyblocks-exe) diff --git a/tests/ChunkData/CopyBlocks.cpp b/tests/ChunkData/CopyBlocks.cpp new file mode 100644 index 000000000..d132411db --- /dev/null +++ b/tests/ChunkData/CopyBlocks.cpp @@ -0,0 +1,65 @@ + +// CopyBlocks.cpp + +// Implements the test for cChunkData::CopyBlockTypes() range copying + + + + + +#include "Globals.h" +#include "ChunkData.h" + + + + + +int main(int argc, char ** argv) +{ + // Set up a cChunkData with known contents - all blocks 0x01, all metas 0x02: + cChunkData Data; + cChunkDef::BlockTypes BlockTypes; + cChunkDef::BlockNibbles BlockMetas; + memset(BlockTypes, 0x01, sizeof(BlockTypes)); + memset(BlockMetas, 0x02, sizeof(BlockMetas)); + Data.SetBlockTypes(BlockTypes); + Data.SetMetas(BlockMetas); + + // Try to read varying amounts of blocktypes from the cChunkData. + // Verify that the exact amount of memory is copied, by copying to a larger buffer and checking its boundaries + BLOCKTYPE TestBuffer[5 * cChunkDef::NumBlocks]; + size_t WritePosIdx = 2 * cChunkDef::NumBlocks; + BLOCKTYPE * WritePosition = &TestBuffer[WritePosIdx]; + memset(TestBuffer, 0x03, sizeof(TestBuffer)); + for (size_t idx = 0; idx < 5000; idx++) + { + for (size_t len = 1; len < 1000; len += 15) + { + printf("Testing copying %u blocks from index %u\n", (unsigned)len, (unsigned)idx); + + Data.CopyBlockTypes(WritePosition, idx, len); + + // Verify the data copied: + for (size_t i = 0; i < len; i++) + { + assert_test(WritePosition[i] == 0x01); + } + // Verify the space before the copied data hasn't been changed: + for (size_t i = 0; i < WritePosIdx + idx; i++) + { + assert_test(TestBuffer[i] == 0x03); + } + // Verify the space after the copied data hasn't been changed: + for (size_t i = WritePosIdx + idx + len; i < ARRAYCOUNT(TestBuffer); i++) + { + assert_test(TestBuffer[i] == 0x03); + } + } + } // for idx + return 0; +} + + + + + From cbb9e152577e3db07832b96583f0ab0618d0d983 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 30 May 2014 17:13:36 +0100 Subject: [PATCH 208/214] Fix bugs in test --- tests/ChunkData/CopyBlocks.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/ChunkData/CopyBlocks.cpp b/tests/ChunkData/CopyBlocks.cpp index d132411db..b31ce3c63 100644 --- a/tests/ChunkData/CopyBlocks.cpp +++ b/tests/ChunkData/CopyBlocks.cpp @@ -30,12 +30,14 @@ int main(int argc, char ** argv) BLOCKTYPE TestBuffer[5 * cChunkDef::NumBlocks]; size_t WritePosIdx = 2 * cChunkDef::NumBlocks; BLOCKTYPE * WritePosition = &TestBuffer[WritePosIdx]; - memset(TestBuffer, 0x03, sizeof(TestBuffer)); for (size_t idx = 0; idx < 5000; idx++) { for (size_t len = 1; len < 1000; len += 15) { - printf("Testing copying %u blocks from index %u\n", (unsigned)len, (unsigned)idx); + //printf("Testing copying %u blocks from index %u\n", (unsigned)len, (unsigned)idx); + + //initalize buffer + memset(TestBuffer, 0x03, sizeof(TestBuffer)); Data.CopyBlockTypes(WritePosition, idx, len); @@ -45,7 +47,7 @@ int main(int argc, char ** argv) assert_test(WritePosition[i] == 0x01); } // Verify the space before the copied data hasn't been changed: - for (size_t i = 0; i < WritePosIdx + idx; i++) + for (size_t i = 0; i < WritePosIdx; i++) { assert_test(TestBuffer[i] == 0x03); } From f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 30 May 2014 18:32:15 +0200 Subject: [PATCH 209/214] Reduced the number of cChunkData::CopyBlockTypes() tests, added progress. --- tests/ChunkData/CopyBlocks.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/ChunkData/CopyBlocks.cpp b/tests/ChunkData/CopyBlocks.cpp index b31ce3c63..be8cab234 100644 --- a/tests/ChunkData/CopyBlocks.cpp +++ b/tests/ChunkData/CopyBlocks.cpp @@ -30,15 +30,18 @@ int main(int argc, char ** argv) BLOCKTYPE TestBuffer[5 * cChunkDef::NumBlocks]; size_t WritePosIdx = 2 * cChunkDef::NumBlocks; BLOCKTYPE * WritePosition = &TestBuffer[WritePosIdx]; - for (size_t idx = 0; idx < 5000; idx++) + memset(TestBuffer, 0x03, sizeof(TestBuffer)); + size_t LastReportedStep = 1; + for (size_t idx = 0; idx < 5000; idx += 7) { - for (size_t len = 1; len < 1000; len += 15) + if (idx / 500 != LastReportedStep) { - //printf("Testing copying %u blocks from index %u\n", (unsigned)len, (unsigned)idx); - - //initalize buffer - memset(TestBuffer, 0x03, sizeof(TestBuffer)); + printf("Testing index %u...\n", (unsigned)idx); + LastReportedStep = idx / 500; + } + for (size_t len = 3; len < 1000; len += 13) + { Data.CopyBlockTypes(WritePosition, idx, len); // Verify the data copied: @@ -56,7 +59,13 @@ int main(int argc, char ** argv) { assert_test(TestBuffer[i] == 0x03); } - } + + // Re-initialize the buffer for the next test: + for (size_t i = 0; i < len; i++) + { + WritePosition[i] = 0x03; + } + } // for len } // for idx return 0; } From 8bf7aed67cb59edd72662114244da5c1cf5f2140 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 30 May 2014 22:40:19 +0200 Subject: [PATCH 210/214] Updated PlainsVillage and AlchemistVillage. --- .../Prefabs/AlchemistVillagePrefabs.cpp | 603 ++++++++---- .../Prefabs/PlainsVillagePrefabs.cpp | 906 +++++++++++++++++- 2 files changed, 1270 insertions(+), 239 deletions(-) diff --git a/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp b/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp index 32ffe5b88..6e3f82212 100644 --- a/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp +++ b/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp @@ -20,24 +20,25 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = // The data has been exported from the gallery Desert, area index 82, ID 598, created by STR_Warrior { // Size: - 11, 12, 9, // SizeX = 11, SizeY = 12, SizeZ = 9 + 11, 12, 10, // SizeX = 11, SizeY = 12, SizeZ = 10 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 10, 11, 8, // MaxX, MaxY, MaxZ + 10, 11, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "A:101: 0\n" /* ironbars */ - "B: 64:12\n" /* wooddoorblock */ - "C:128: 2\n" /* sandstonestairs */ - "D: 24: 1\n" /* sandstone */ - "E: 44: 9\n" /* step */ - "F:126: 8\n" /* woodenslab */ - "G:128: 7\n" /* sandstonestairs */ - "H: 44: 1\n" /* step */ - "I: 64: 7\n" /* wooddoorblock */ - "J:128: 6\n" /* sandstonestairs */ + "A:171: 8\n" /* carpet */ + "B:101: 0\n" /* ironbars */ + "C: 64:12\n" /* wooddoorblock */ + "D:128: 2\n" /* sandstonestairs */ + "E: 24: 1\n" /* sandstone */ + "F: 44: 9\n" /* step */ + "G:126: 8\n" /* woodenslab */ + "H:128: 7\n" /* sandstonestairs */ + "I: 44: 1\n" /* step */ + "J: 64: 7\n" /* wooddoorblock */ + "K:128: 6\n" /* sandstonestairs */ "a: 1: 0\n" /* stone */ "b: 24: 0\n" /* sandstone */ "c: 12: 0\n" /* sand */ @@ -62,8 +63,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "v:134: 7\n" /* 134 */ "w:107: 5\n" /* fencegate */ "x: 64: 5\n" /* wooddoorblock */ - "y: 50: 3\n" /* torch */ - "z:171: 8\n" /* carpet */, + "y: 65: 3\n" /* ladder */ + "z: 50: 3\n" /* torch */, // Block data: // Level 0 @@ -78,6 +79,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 6 */ "aabbbbbbbaa" /* 7 */ "aabbbbbbbaa" /* 8 */ "aaaaaaaaaaa" + /* 9 */ "aaaaaaaaaaa" // Level 1 /* z\x* 1 */ @@ -91,6 +93,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 6 */ "cb.......bc" /* 7 */ "cbg......bc" /* 8 */ "cbbbbbbbbbc" + /* 9 */ "ccccccccccc" // Level 2 /* z\x* 1 */ @@ -104,6 +107,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 6 */ "cb.......bc" /* 7 */ "cbg......bc" /* 8 */ "cbbbbbbbbbc" + /* 9 */ "ccccccccccc" // Level 3 /* z\x* 1 */ @@ -117,6 +121,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 6 */ "cb.......bc" /* 7 */ "cbg..l...bc" /* 8 */ "cbbbbbbbbbc" + /* 9 */ "ccccccccccc" // Level 4 /* z\x* 1 */ @@ -130,6 +135,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 6 */ "cnnnnnnnnnc" /* 7 */ "cnonnnnnnnc" /* 8 */ "cnccccccccc" + /* 9 */ "ccccccccccc" // Level 5 /* z\x* 1 */ @@ -143,6 +149,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 6 */ "bfvvd.....b" /* 7 */ "b...w..kujb" /* 8 */ "pxbbbbbbbbp" + /* 9 */ "..y........" // Level 6 /* z\x* 1 */ @@ -150,38 +157,41 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "...p...p..." /* 1 */ "..........." /* 2 */ "pbbb...bbbp" - /* 3 */ "b..y...y..b" - /* 4 */ "b.z.....z.b" - /* 5 */ "A.........A" + /* 3 */ "b..z...z..b" + /* 4 */ "b.A.....A.b" + /* 5 */ "B.........B" /* 6 */ "b.........b" - /* 7 */ "b.......z.b" - /* 8 */ "pBbbAAAbbbp" + /* 7 */ "b.......A.b" + /* 8 */ "pCbbBBBbbbp" + /* 9 */ "..y........" // Level 7 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "...C...C..." - /* 1 */ "...D...b..." - /* 2 */ "pbbbqEsbbbp" - /* 3 */ "bFFFFFFFFFb" - /* 4 */ "bFFFFFFFFFb" - /* 5 */ "sFFFFFFFFFq" - /* 6 */ "bFFFFFFFFFb" - /* 7 */ "bFFFFFFFFFb" - /* 8 */ "pbbbGGGbbbp" + /* 0 */ "...D...D..." + /* 1 */ "...E...b..." + /* 2 */ "pbbbqFsbbbp" + /* 3 */ "bGGGGGGGGGb" + /* 4 */ "bGGGGGGGGGb" + /* 5 */ "sGGGGGGGGGq" + /* 6 */ "bGGGGGGGGGb" + /* 7 */ "bGGGGGGGGGb" + /* 8 */ "pbbbHHHbbbp" + /* 9 */ "..y........" // Level 8 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." /* 1 */ "..........." - /* 2 */ "bHHHHbHHHHb" - /* 3 */ "HpbbbbbbbpH" - /* 4 */ "Hb.......bH" + /* 2 */ "bIIIIbIIIIb" + /* 3 */ "IpbbbbbbbpI" + /* 4 */ "Ib.......bI" /* 5 */ "bb.......bb" - /* 6 */ "Hb.......bH" - /* 7 */ "HpIbbbbbbpH" - /* 8 */ "bH.HHbHHHHb" + /* 6 */ "Ib.......bI" + /* 7 */ "IpJbbbbbbpI" + /* 8 */ "bI.IIbIIIIb" + /* 9 */ "..........." // Level 9 /* z\x* 1 */ @@ -189,12 +199,13 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..........." /* 1 */ "..........." /* 2 */ "..........." - /* 3 */ ".pbbAAAbbp." + /* 3 */ ".pbbBBBbbp." /* 4 */ ".b.......b." - /* 5 */ ".A.......A." + /* 5 */ ".B.......B." /* 6 */ ".b.......b." - /* 7 */ ".pBbAAAbbp." + /* 7 */ ".pCbBBBbbp." /* 8 */ "..........." + /* 9 */ "..........." // Level 10 /* z\x* 1 */ @@ -202,12 +213,13 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..........." /* 1 */ "..........." /* 2 */ "..........." - /* 3 */ ".pbbJJJbbp." - /* 4 */ ".bFFFFFFFb." - /* 5 */ ".sFFFFFFFq." - /* 6 */ ".bFFFFFFFb." - /* 7 */ ".pbbGGGbbp." + /* 3 */ ".pbbKKKbbp." + /* 4 */ ".bGGGGGGGb." + /* 5 */ ".sGGGGGGGq." + /* 6 */ ".bGGGGGGGb." + /* 7 */ ".pbbHHHbbp." /* 8 */ "..........." + /* 9 */ "..........." // Level 11 /* z\x* 1 */ @@ -215,12 +227,13 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..........." /* 1 */ "..........." /* 2 */ "..........." - /* 3 */ ".bHHHbHHHb." - /* 4 */ ".H.......H." + /* 3 */ ".bIIIbIIIb." + /* 4 */ ".I.......I." /* 5 */ ".b.......b." - /* 6 */ ".H.......H." - /* 7 */ ".bHHHbHHHb." - /* 8 */ "...........", + /* 6 */ ".I.......I." + /* 7 */ ".bIIIbIIIb." + /* 8 */ "..........." + /* 9 */ "...........", // Connectors: "-1: 5, 5, 0: 2\n" /* Type -1, direction Z- */, @@ -235,7 +248,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = true, // DefaultWeight: - 100, + 70, // DepthWeight: "", @@ -254,18 +267,19 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = // The data has been exported from the gallery Desert, area index 81, ID 597, created by STR_Warrior { // Size: - 11, 8, 9, // SizeX = 11, SizeY = 8, SizeZ = 9 + 11, 8, 10, // SizeX = 11, SizeY = 8, SizeZ = 10 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 10, 7, 8, // MaxX, MaxY, MaxZ + 10, 7, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "A: 44: 1\n" /* step */ - "B: 64: 3\n" /* wooddoorblock */ - "C: 64: 8\n" /* wooddoorblock */ - "D:128: 6\n" /* sandstonestairs */ + "A:128: 7\n" /* sandstonestairs */ + "B: 44: 1\n" /* step */ + "C: 64: 3\n" /* wooddoorblock */ + "D: 64: 8\n" /* wooddoorblock */ + "E:128: 6\n" /* sandstonestairs */ "a: 12: 0\n" /* sand */ "b: 5: 0\n" /* wood */ "c: 24: 2\n" /* sandstone */ @@ -283,15 +297,15 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "o:134: 4\n" /* 134 */ "p:107: 5\n" /* fencegate */ "q: 64: 5\n" /* wooddoorblock */ - "r: 50: 3\n" /* torch */ - "s:171: 8\n" /* carpet */ - "t:101: 0\n" /* ironbars */ - "u: 64:12\n" /* wooddoorblock */ - "v:128: 2\n" /* sandstonestairs */ - "w: 24: 1\n" /* sandstone */ - "x: 44: 9\n" /* step */ - "y:126: 8\n" /* woodenslab */ - "z:128: 7\n" /* sandstonestairs */, + "r: 65: 3\n" /* ladder */ + "s: 50: 3\n" /* torch */ + "t:171: 8\n" /* carpet */ + "u:101: 0\n" /* ironbars */ + "v: 64:12\n" /* wooddoorblock */ + "w:128: 2\n" /* sandstonestairs */ + "x: 24: 1\n" /* sandstone */ + "y: 44: 9\n" /* step */ + "z:126: 8\n" /* woodenslab */, // Block data: // Level 0 @@ -306,6 +320,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 6 */ "abbbbbbbbba" /* 7 */ "abbbbbbbbba" /* 8 */ "abaaaaaaaaa" + /* 9 */ "aaaaaaaaaaa" // Level 1 /* z\x* 1 */ @@ -319,6 +334,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 6 */ "dlnno.....d" /* 7 */ "d...p..hjkd" /* 8 */ "cqddddddddc" + /* 9 */ "..r........" // Level 2 /* z\x* 1 */ @@ -326,38 +342,41 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "...c...c..." /* 1 */ "..........." /* 2 */ "cddd...dddc" - /* 3 */ "d..r...r..d" - /* 4 */ "d.s.....s.d" - /* 5 */ "t.........t" + /* 3 */ "d..s...s..d" + /* 4 */ "d.t.....t.d" + /* 5 */ "u.........u" /* 6 */ "d.........d" - /* 7 */ "d.......s.d" - /* 8 */ "cuddtttdddc" + /* 7 */ "d.......t.d" + /* 8 */ "cvdduuudddc" + /* 9 */ "..r........" // Level 3 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "...v...v..." - /* 1 */ "...w...d..." - /* 2 */ "cdddexgdddc" - /* 3 */ "dyyyyyyyyyd" - /* 4 */ "dyyyyyyyyyd" - /* 5 */ "gyyyyyyyyye" - /* 6 */ "dyyyyyyyyyd" - /* 7 */ "dyyyyyyyyyd" - /* 8 */ "cdddzzzdddc" + /* 0 */ "...w...w..." + /* 1 */ "...x...d..." + /* 2 */ "cdddeygdddc" + /* 3 */ "dzzzzzzzzzd" + /* 4 */ "dzzzzzzzzzd" + /* 5 */ "gzzzzzzzzze" + /* 6 */ "dzzzzzzzzzd" + /* 7 */ "dzzzzzzzzzd" + /* 8 */ "cdddAAAdddc" + /* 9 */ "..r........" // Level 4 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "..........." /* 1 */ "..........." - /* 2 */ "dAAAAdAAAAd" - /* 3 */ "AcdddddddcA" - /* 4 */ "Ad.......dA" + /* 2 */ "dBBBBdBBBBd" + /* 3 */ "BcdddddddcB" + /* 4 */ "Bd.......dB" /* 5 */ "dd.......dd" - /* 6 */ "Ad.......dA" - /* 7 */ "AcBddddddcA" - /* 8 */ "dA.AAdAAAAd" + /* 6 */ "Bd.......dB" + /* 7 */ "BcCddddddcB" + /* 8 */ "dB.BBdBBBBd" + /* 9 */ "..........." // Level 5 /* z\x* 1 */ @@ -365,12 +384,13 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..........." /* 1 */ "..........." /* 2 */ "..........." - /* 3 */ ".cddtttddc." + /* 3 */ ".cdduuuddc." /* 4 */ ".d.......d." - /* 5 */ ".t.......t." + /* 5 */ ".u.......u." /* 6 */ ".d.......d." - /* 7 */ ".cCdtttddc." + /* 7 */ ".cDduuuddc." /* 8 */ "..........." + /* 9 */ "..........." // Level 6 /* z\x* 1 */ @@ -378,12 +398,13 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..........." /* 1 */ "..........." /* 2 */ "..........." - /* 3 */ ".cddDDDddc." - /* 4 */ ".dyyyyyyyd." - /* 5 */ ".gyyyyyyye." - /* 6 */ ".dyyyyyyyd." - /* 7 */ ".cddzzzddc." + /* 3 */ ".cddEEEddc." + /* 4 */ ".dzzzzzzzd." + /* 5 */ ".gzzzzzzze." + /* 6 */ ".dzzzzzzzd." + /* 7 */ ".cddAAAddc." /* 8 */ "..........." + /* 9 */ "..........." // Level 7 /* z\x* 1 */ @@ -391,12 +412,13 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..........." /* 1 */ "..........." /* 2 */ "..........." - /* 3 */ ".dAAAdAAAd." - /* 4 */ ".A.......A." + /* 3 */ ".dBBBdBBBd." + /* 4 */ ".B.......B." /* 5 */ ".d.......d." - /* 6 */ ".A.......A." - /* 7 */ ".dAAAdAAAd." - /* 8 */ "...........", + /* 6 */ ".B.......B." + /* 7 */ ".dBBBdBBBd." + /* 8 */ "..........." + /* 9 */ "...........", // Connectors: "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */, @@ -411,7 +433,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = true, // DefaultWeight: - 100, + 80, // DepthWeight: "", @@ -427,7 +449,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // BlackSmith: - // The data has been exported from the gallery Desert, area index 92, ID 633, created by STR_Warrior + // The data has been exported from the gallery Desert, area index 97, ID 642, created by STR_Warrior { // Size: 11, 5, 13, // SizeX = 11, SizeY = 5, SizeZ = 13 @@ -460,7 +482,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "t:128: 4\n" /* sandstonestairs */ "u:128: 5\n" /* sandstonestairs */ "v:128: 7\n" /* sandstonestairs */ - "w: 44: 1\n" /* step */, + "w: 44: 1\n" /* step */ + "x: 43: 1\n" /* doubleslab */, // Block data: // Level 0 @@ -469,7 +492,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "aaaaaaaaaaa" /* 1 */ "aaaaaaaaaaa" /* 2 */ "aaaaaaaabaa" - /* 3 */ "acaaacabbba" + /* 3 */ "acacacabbba" /* 4 */ "acaccaabbba" /* 5 */ "acccccabbba" /* 6 */ "acaadddbbba" @@ -487,9 +510,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 1 */ "..........." /* 2 */ "......dcecd" /* 3 */ ".d....c...c" - /* 4 */ "......c...c" - /* 5 */ "...f..c...c" - /* 6 */ ".....dc...c" + /* 4 */ "..f...c...c" + /* 5 */ "......c...c" + /* 6 */ "....ddc...c" /* 7 */ ".gh.dic...c" /* 8 */ "dcccccd...c" /* 9 */ "cj........c" @@ -506,8 +529,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 3 */ ".d....c..lc" /* 4 */ "......n...c" /* 5 */ "......c...c" - /* 6 */ "......c...n" - /* 7 */ "......c...n" + /* 6 */ "....nnc...n" + /* 7 */ "....n.c...n" /* 8 */ "dcccccd...n" /* 9 */ "co........c" /* 10 */ "n.........c" @@ -523,8 +546,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 3 */ ".drrrrcsssc" /* 4 */ ".rsssstsssc" /* 5 */ ".rsssscsssc" - /* 6 */ ".rsssscsssu" - /* 7 */ ".rsssscsssu" + /* 6 */ ".rssddcsssu" + /* 7 */ ".rssd.csssu" /* 8 */ "dcccccdsssu" /* 9 */ "csssssssssc" /* 10 */ "tsssssssssc" @@ -540,9 +563,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 3 */ ".w.w.ww...w" /* 4 */ "......w...w" /* 5 */ ".w....w...w" - /* 6 */ "......w...w" - /* 7 */ ".w....w...c" - /* 8 */ "cwwwwwc...w" + /* 6 */ "....xwx...w" + /* 7 */ ".w..w.w...c" + /* 8 */ "cwwwxwc...w" /* 9 */ "w.........w" /* 10 */ "w.........w" /* 11 */ "w.........w" @@ -561,7 +584,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = true, // DefaultWeight: - 100, + 50, // DepthWeight: "", @@ -588,12 +611,14 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = // Block definitions: ".: 0: 0\n" /* air */ - "A:128: 2\n" /* sandstonestairs */ - "B:128: 0\n" /* sandstonestairs */ - "C: 87: 0\n" /* netherstone */ - "D:128: 3\n" /* sandstonestairs */ - "E: 51: 0\n" /* fire */ - "F: 44: 9\n" /* step */ + "A:128: 7\n" /* sandstonestairs */ + "B: 44: 1\n" /* step */ + "C:128: 2\n" /* sandstonestairs */ + "D:128: 0\n" /* sandstonestairs */ + "E: 87: 0\n" /* netherstone */ + "F:128: 3\n" /* sandstonestairs */ + "G: 51: 0\n" /* fire */ + "H: 44: 9\n" /* step */ "a: 12: 0\n" /* sand */ "b: 5: 0\n" /* wood */ "c: 24: 2\n" /* sandstone */ @@ -610,16 +635,16 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "n:101: 0\n" /* ironbars */ "o:140: 0\n" /* flowerpotblock */ "p: 64: 8\n" /* wooddoorblock */ - "q: 69:12\n" /* lever */ - "r: 44:10\n" /* step */ - "s:128: 1\n" /* sandstonestairs */ - "t: 47: 0\n" /* bookshelf */ - "u: 96:12\n" /* trapdoor */ - "v:128: 4\n" /* sandstonestairs */ - "w:128: 5\n" /* sandstonestairs */ - "x:128: 7\n" /* sandstonestairs */ - "y: 44: 1\n" /* step */ - "z:128: 6\n" /* sandstonestairs */, + "q: 50: 3\n" /* torch */ + "r: 69:12\n" /* lever */ + "s: 50: 4\n" /* torch */ + "t:128: 6\n" /* sandstonestairs */ + "u: 44:10\n" /* step */ + "v:128: 1\n" /* sandstonestairs */ + "w: 47: 0\n" /* bookshelf */ + "x: 96:12\n" /* trapdoor */ + "y:128: 4\n" /* sandstonestairs */ + "z:128: 5\n" /* sandstonestairs */, // Block data: // Level 0 @@ -657,9 +682,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* * 012345678901234 */ /* 0 */ "....cddnnnddc.." /* 1 */ "....d......od.c" - /* 2 */ "....p.......d.." + /* 2 */ "....p.......d.q" /* 3 */ "....d.......p.." - /* 4 */ "....d.q...l.d.." + /* 4 */ "....d.r...l.d.s" /* 5 */ "....dddd.dddd.c" /* 6 */ "....n.......n.." /* 7 */ "mmmmn.......n.." @@ -670,32 +695,32 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = // Level 3 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "....cdddddddc.." - /* 1 */ "....drrrrrrrdds" - /* 2 */ "....drrrrrrrd.." - /* 3 */ "....drrrrrrrd.." - /* 4 */ "....dtttrrurd.." - /* 5 */ "....dddddddddds" - /* 6 */ "....vrrrrrrrw.." - /* 7 */ "mmmmvrrrrrrrw.." - /* 8 */ "mmmmvrrrrrrrw.." - /* 9 */ "mmmmdrrrrrrrd.." - /* 10 */ "mmmmcddxxxddc.." + /* 0 */ "....cddtttddc.." + /* 1 */ "....duuuuuuuddv" + /* 2 */ "....duuuuuuud.." + /* 3 */ "....duuuuuuud.." + /* 4 */ "....dwwwuuxud.." + /* 5 */ "....ddddddddddv" + /* 6 */ "....yuuuuuuuz.." + /* 7 */ "mmmmyuuuuuuuz.." + /* 8 */ "mmmmyuuuuuuuz.." + /* 9 */ "mmmmduuuuuuud.." + /* 10 */ "mmmmcddAAAddc.." // Level 4 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "....dyyydyyyd.." - /* 1 */ "....ycdddddcy.." - /* 2 */ "....yd.....dy.." - /* 3 */ "....yd.....dy.." - /* 4 */ "....yd.....dy.." + /* 0 */ "....dBBBdBBBd.." + /* 1 */ "....BcdddddcB.." + /* 2 */ "....Bd.....dB.." + /* 3 */ "....Bd.....dB.." + /* 4 */ "....Bd.....dB.." /* 5 */ "....dcdd.ddcd.." - /* 6 */ "....y.......y.." - /* 7 */ "mmmmy.......y.." - /* 8 */ "mmmmy.......y.." - /* 9 */ "mmmmy.......y.." - /* 10 */ "mmmmdyyydyyyd.." + /* 6 */ "....B.......B.." + /* 7 */ "mmmmB.......B.." + /* 8 */ "mmmmB.......B.." + /* 9 */ "mmmmB.......B.." + /* 10 */ "mmmmdBBBdBBBd.." // Level 5 /* z\x* 11111 */ @@ -716,10 +741,10 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".....cddzddc..." - /* 2 */ ".....vrrrrrw..." - /* 3 */ ".....vrrrrrw..." - /* 4 */ ".....vrrrrrw..." + /* 1 */ ".....cddtddc..." + /* 2 */ ".....yuuuuuz..." + /* 3 */ ".....yuuuuuz..." + /* 4 */ ".....yuuuuuz..." /* 5 */ ".....cdddddc..." /* 6 */ "..............." /* 7 */ "..............." @@ -731,11 +756,11 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".....dyydyyd..." - /* 2 */ ".....y.ddd.y..." + /* 1 */ ".....dBBdBBd..." + /* 2 */ ".....B.ddd.B..." /* 3 */ ".....d.ddd.d..." - /* 4 */ ".....y.ddd.y..." - /* 5 */ ".....dyydyyd..." + /* 4 */ ".....B.ddd.B..." + /* 5 */ ".....dBBdBBd..." /* 6 */ "..............." /* 7 */ "..............." /* 8 */ "..............." @@ -747,9 +772,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* * 012345678901234 */ /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ ".......cAc....." - /* 3 */ ".......BCs....." - /* 4 */ ".......cDc....." + /* 2 */ ".......cCc....." + /* 3 */ ".......DEv....." + /* 4 */ ".......cFc....." /* 5 */ "..............." /* 6 */ "..............." /* 7 */ "..............." @@ -763,7 +788,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..............." /* 1 */ "..............." /* 2 */ ".......c.c....." - /* 3 */ "........E......" + /* 3 */ "........G......" /* 4 */ ".......c.c....." /* 5 */ "..............." /* 6 */ "..............." @@ -777,9 +802,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* * 012345678901234 */ /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ ".......c.c....." - /* 3 */ "..............." - /* 4 */ ".......c.c....." + /* 2 */ ".......ctc....." + /* 3 */ ".......y.z....." + /* 4 */ ".......cAc....." /* 5 */ "..............." /* 6 */ "..............." /* 7 */ "..............." @@ -793,7 +818,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..............." /* 1 */ "..............." /* 2 */ ".......ddd....." - /* 3 */ ".......dFd....." + /* 3 */ ".......dHd....." /* 4 */ ".......ddd....." /* 5 */ "..............." /* 6 */ "..............." @@ -807,9 +832,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* * 012345678901234 */ /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ ".......y.y....." + /* 2 */ ".......B.B....." /* 3 */ "..............." - /* 4 */ ".......y.y....." + /* 4 */ ".......B.B....." /* 5 */ "..............." /* 6 */ "..............." /* 7 */ "..............." @@ -830,7 +855,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = true, // DefaultWeight: - 100, + 60, // DepthWeight: "", @@ -1169,7 +1194,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 3 */ "abbbbba" /* 4 */ "abbbbba" /* 5 */ "abbbbba" - /* 6 */ "aaaaaaa" + /* 6 */ "aabaaaa" /* 7 */ "aaaaaaa" /* 8 */ "aaaaaaa" /* 9 */ "aaaaaaa" @@ -1384,7 +1409,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "b: 5: 0\n" /* wood */ "c: 24: 2\n" /* sandstone */ "d: 24: 0\n" /* sandstone */ - "e: 64: 3\n" /* wooddoorblock */ + "e: 64: 7\n" /* wooddoorblock */ "f: 65: 5\n" /* ladder */ "g:134: 3\n" /* 134 */ "h: 85: 0\n" /* fence */ @@ -1393,16 +1418,17 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "k:134: 6\n" /* 134 */ "l:134: 4\n" /* 134 */ "m: 19: 0\n" /* sponge */ - "n: 64: 8\n" /* wooddoorblock */ + "n: 64:12\n" /* wooddoorblock */ "o: 50: 2\n" /* torch */ "p:101: 0\n" /* ironbars */ "q:171: 8\n" /* carpet */ "r:128: 2\n" /* sandstonestairs */ "s:126: 8\n" /* woodenslab */ - "t:128: 5\n" /* sandstonestairs */ - "u:128: 7\n" /* sandstonestairs */ - "v: 44: 1\n" /* step */ - "w: 96: 7\n" /* trapdoor */, + "t:128: 4\n" /* sandstonestairs */ + "u:128: 5\n" /* sandstonestairs */ + "v:128: 7\n" /* sandstonestairs */ + "w: 44: 1\n" /* step */ + "x: 96: 7\n" /* trapdoor */, // Block data: // Level 0 @@ -1454,26 +1480,26 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 2 */ "cdddc" /* 3 */ "dfssd" /* 4 */ "dsssd" - /* 5 */ "tssst" - /* 6 */ "tssst" - /* 7 */ "tssst" + /* 5 */ "tsssu" + /* 6 */ "tsssu" + /* 7 */ "tsssu" /* 8 */ "dsssd" /* 9 */ "dsssd" - /* 10 */ "cdudc" + /* 10 */ "cdvdc" // Level 4 /* z\x* 01234 */ /* 0 */ "....." /* 1 */ "....." - /* 2 */ "dvdvd" - /* 3 */ "vw..v" - /* 4 */ "v...v" - /* 5 */ "v...v" + /* 2 */ "dwdwd" + /* 3 */ "wx..w" + /* 4 */ "w...w" + /* 5 */ "w...w" /* 6 */ "d...d" - /* 7 */ "v...v" - /* 8 */ "v...v" - /* 9 */ "v...v" - /* 10 */ "dvdvd", + /* 7 */ "w...w" + /* 8 */ "w...w" + /* 9 */ "w...w" + /* 10 */ "dwdwd", // Connectors: "-1: 2, 1, 0: 2\n" /* Type -1, direction Z- */, @@ -2050,7 +2076,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "o:128: 4\n" /* sandstonestairs */ "p:128: 7\n" /* sandstonestairs */ "q: 44: 1\n" /* step */ - "r: 50: 3\n" /* torch */, + "r: 50: 3\n" /* torch */ + "s:128: 6\n" /* sandstonestairs */, // Block data: // Level 0 @@ -2137,11 +2164,11 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..............." /* 1 */ "..............." /* 2 */ "..............." - /* 3 */ "...cdddc......." + /* 3 */ "...cdsdc......." /* 4 */ "...dnnnd......." /* 5 */ "...dnnnd......." /* 6 */ "...dnnnd......." - /* 7 */ "...cdddc......." + /* 7 */ "...cdpdc......." /* 8 */ "..............." // Level 7 @@ -2170,7 +2197,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = true, // DefaultWeight: - 100, + 80, // DepthWeight: "", @@ -2364,7 +2391,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = true, // DefaultWeight: - 100, + 80, // DepthWeight: "", @@ -2582,7 +2609,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = true, // DefaultWeight: - 100, + 80, // DepthWeight: "", @@ -2690,7 +2717,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* z\x* 012345678 */ /* 0 */ "mmmm....." /* 1 */ "mmmm....." - /* 2 */ "mmmmcrdrd" + /* 2 */ "mmmmdrdrd" /* 3 */ "mmmmr...r" /* 4 */ "mmmmr...r" /* 5 */ "mmmmr...r" @@ -2724,6 +2751,192 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = // MoveToGround: true, }, // SmallHouse9 + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Temple: + // The data has been exported from the gallery Desert, area index 83, ID 599, created by STR_Warrior + { + // Size: + 13, 9, 9, // SizeX = 13, SizeY = 9, SizeZ = 9 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 8, 8, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "A: 44: 9\n" /* step */ + "a: 12: 0\n" /* sand */ + "b: 5: 0\n" /* wood */ + "c: 24: 2\n" /* sandstone */ + "d: 24: 0\n" /* sandstone */ + "e: 64: 7\n" /* wooddoorblock */ + "f: 17: 0\n" /* tree */ + "g:128: 5\n" /* sandstonestairs */ + "h:128: 4\n" /* sandstonestairs */ + "i:128: 7\n" /* sandstonestairs */ + "j:128: 6\n" /* sandstonestairs */ + "k:118: 3\n" /* cauldronblock */ + "l:155: 1\n" /* quartzblock */ + "m: 19: 0\n" /* sponge */ + "n: 64:12\n" /* wooddoorblock */ + "o: 50: 3\n" /* torch */ + "p:101: 0\n" /* ironbars */ + "q:140: 0\n" /* flowerpotblock */ + "r: 24: 1\n" /* sandstone */ + "s:128: 2\n" /* sandstonestairs */ + "t:126: 8\n" /* woodenslab */ + "u: 44: 1\n" /* step */ + "v:128: 0\n" /* sandstonestairs */ + "w: 87: 0\n" /* netherstone */ + "x:128: 1\n" /* sandstonestairs */ + "y:128: 3\n" /* sandstonestairs */ + "z: 51: 0\n" /* fire */, + + // Block data: + // Level 0 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "aaaaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaaaa" + /* 2 */ "aaabbababbaaa" + /* 3 */ "abbbbbbbbbbba" + /* 4 */ "abbbbbbbbbbba" + /* 5 */ "abbbbbbbbbbba" + /* 6 */ "abbbbbbbbbbba" + /* 7 */ "abbbbbbbbbbba" + /* 8 */ "aaaaaaaaaaaaa" + + // Level 1 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "....c...c...." + /* 1 */ "............." + /* 2 */ "cdddddedddddc" + /* 3 */ "dfg.......hfd" + /* 4 */ "di.........id" + /* 5 */ "d...........d" + /* 6 */ "dj.........jd" + /* 7 */ "dfg.khlgk.hfd" + /* 8 */ "cdddddddddddc" + + // Level 2 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "....c...c...." + /* 1 */ "............." + /* 2 */ "cdddddndddddc" + /* 3 */ "df...o.o...fd" + /* 4 */ "d...........d" + /* 5 */ "p...........p" + /* 6 */ "d...........d" + /* 7 */ "df...qrq...fd" + /* 8 */ "cdpppdddpppdc" + + // Level 3 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "....s...s...." + /* 1 */ "....r...d...." + /* 2 */ "cdddddddddddc" + /* 3 */ "dftttttttttfd" + /* 4 */ "dtttttttttttd" + /* 5 */ "htttttttttttg" + /* 6 */ "dtttttttttttd" + /* 7 */ "dftttttttttfd" + /* 8 */ "cdiiidddiiidc" + + // Level 4 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "duuuuuduuuuud" + /* 3 */ "u...........u" + /* 4 */ "u.ddd...ddd.u" + /* 5 */ "d.ddd...ddd.d" + /* 6 */ "u.ddd...ddd.u" + /* 7 */ "u...........u" + /* 8 */ "duuuuuduuuuud" + + // Level 5 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ "..csc...csc.." + /* 5 */ "..vwx...vwx.." + /* 6 */ "..cyc...cyc.." + /* 7 */ "............." + /* 8 */ "............." + + // Level 6 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ "..c.c...c.c.." + /* 5 */ "...z.....z..." + /* 6 */ "..c.c...c.c.." + /* 7 */ "............." + /* 8 */ "............." + + // Level 7 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ "..ddd...ddd.." + /* 5 */ "..dAd...dAd.." + /* 6 */ "..ddd...ddd.." + /* 7 */ "............." + /* 8 */ "............." + + // Level 8 + /* z\x* 111 */ + /* * 0123456789012 */ + /* 0 */ "............." + /* 1 */ "............." + /* 2 */ "............." + /* 3 */ "............." + /* 4 */ "..u.u...u.u.." + /* 5 */ "............." + /* 6 */ "..u.u...u.u.." + /* 7 */ "............." + /* 8 */ ".............", + + // Connectors: + "-1: 6, 1, 0: 2\n" /* Type -1, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + true, + + // DefaultWeight: + 50, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + true, + }, // Temple }; // g_AlchemistVillagePrefabs diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index f8cf867e5..f5e531955 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -797,8 +797,9 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = ".: 0: 0\n" /* air */ "a: 5: 0\n" /* wood */ "b: 85: 0\n" /* fence */ - "c: 50: 2\n" /* torch */ - "d: 50: 1\n" /* torch */ + "c: 66: 1\n" /* tracks */ + "d: 50: 2\n" /* torch */ + "e: 50: 1\n" /* torch */ "m: 19: 0\n" /* sponge */, // Block data: @@ -813,7 +814,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* z\x* */ /* * 0123456789 */ /* 0 */ "..b....b.." - /* 1 */ ".........." + /* 1 */ "cccccccccc" /* 2 */ "..b....b.." // Level 2 @@ -827,14 +828,12 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* z\x* */ /* * 0123456789 */ /* 0 */ "..a....a.." - /* 1 */ ".cad..cad." + /* 1 */ ".dae..dae." /* 2 */ "..a....a..", // Connectors: "-3: 0, 1, 1: 4\n" /* Type -3, direction X- */ - "3: 0, 1, 1: 4\n" /* Type 3, direction X- */ - "3: 9, 1, 1: 5\n" /* Type 3, direction X+ */ - "-3: 9, 1, 1: 5\n" /* Type -3, direction X+ */, + "3: 9, 1, 1: 5\n" /* Type 3, direction X+ */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -874,6 +873,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Block definitions: ".: 0: 0\n" /* air */ "a: 5: 0\n" /* wood */ + "b: 66: 0\n" /* tracks */ + "c: 66: 1\n" /* tracks */ "m: 19: 0\n" /* sponge */, // Block data: @@ -887,11 +888,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 1 /* z\x* 01234 */ - /* 0 */ "m...m" - /* 1 */ ".a.a." - /* 2 */ "....." - /* 3 */ ".a.a." - /* 4 */ "m...m" + /* 0 */ "m.b.m" + /* 1 */ ".aba." + /* 2 */ "ccccc" + /* 3 */ ".aba." + /* 4 */ "m.b.m" // Level 2 /* z\x* 01234 */ @@ -929,7 +930,125 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = false, // DefaultWeight: - 5, + 1, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // MineshaftCrossing + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftCrossing: + // The data has been exported from the gallery Plains, area index 193, ID 657, created by Aloe_vera + { + // Size: + 11, 4, 11, // SizeX = 11, SizeY = 4, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 3, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "b: 66: 0\n" /* tracks */ + "c: 85: 0\n" /* fence */ + "d: 66: 1\n" /* tracks */ + "e: 50: 4\n" /* torch */ + "f: 50: 3\n" /* torch */ + "g: 50: 2\n" /* torch */ + "h: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmaaammmm" + /* 1 */ "mmmmaaammmm" + /* 2 */ "mmmmaaammmm" + /* 3 */ "mmmmaaammmm" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + /* 7 */ "mmmmaaammmm" + /* 8 */ "mmmmaaammmm" + /* 9 */ "mmmmaaammmm" + /* 10 */ "mmmmaaammmm" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm.b.mmmm" + /* 1 */ "mmmm.b.mmmm" + /* 2 */ "mmmmcbcmmmm" + /* 3 */ "mmmm.b.mmmm" + /* 4 */ "..c..b..c.." + /* 5 */ "ddddddddddd" + /* 6 */ "..c..b..c.." + /* 7 */ "mmmm.b.mmmm" + /* 8 */ "mmmmcbcmmmm" + /* 9 */ "mmmm.b.mmmm" + /* 10 */ "mmmm.b.mmmm" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm...mmmm" + /* 1 */ "mmmm...mmmm" + /* 2 */ "mmmmc.cmmmm" + /* 3 */ "mmmm...mmmm" + /* 4 */ "..c.....c.." + /* 5 */ "..........." + /* 6 */ "..c.....c.." + /* 7 */ "mmmm...mmmm" + /* 8 */ "mmmmc.cmmmm" + /* 9 */ "mmmm...mmmm" + /* 10 */ "mmmm...mmmm" + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm...mmmm" + /* 1 */ "mmmm.e.mmmm" + /* 2 */ "mmmmaaammmm" + /* 3 */ "mmmm.f.mmmm" + /* 4 */ "..a.....a.." + /* 5 */ ".gah...gah." + /* 6 */ "..a.....a.." + /* 7 */ "mmmm.e.mmmm" + /* 8 */ "mmmmaaammmm" + /* 9 */ "mmmm.f.mmmm" + /* 10 */ "mmmm...mmmm", + + // Connectors: + "3: 5, 1, 0: 2\n" /* Type 3, direction Z- */ + "-3: 5, 1, 0: 2\n" /* Type -3, direction Z- */ + "3: 0, 1, 5: 4\n" /* Type 3, direction X- */ + "-3: 0, 1, 5: 4\n" /* Type -3, direction X- */ + "3: 5, 1, 10: 3\n" /* Type 3, direction Z+ */ + "-3: 5, 1, 10: 3\n" /* Type -3, direction Z+ */ + "3: 10, 1, 5: 5\n" /* Type 3, direction X+ */ + "-3: 10, 1, 5: 5\n" /* Type -3, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 10, // DepthWeight: "", @@ -957,6 +1076,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Block definitions: ".: 0: 0\n" /* air */ "a: 5: 0\n" /* wood */ + "b: 66: 0\n" /* tracks */ + "c: 66: 1\n" /* tracks */ "m: 19: 0\n" /* sponge */, // Block data: @@ -970,11 +1091,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 1 /* z\x* 01234 */ - /* 0 */ "m...m" - /* 1 */ ".a.a." - /* 2 */ "....." - /* 3 */ ".a.a." - /* 4 */ "m...m" + /* 0 */ "m.b.m" + /* 1 */ ".aba." + /* 2 */ "ccccc" + /* 3 */ ".aba." + /* 4 */ "m.b.m" // Level 2 /* z\x* 01234 */ @@ -1052,7 +1173,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = false, // DefaultWeight: - 5, + 1, // DepthWeight: "", @@ -1066,6 +1187,703 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftSpiral: + // The data has been exported from the gallery Plains, area index 198, ID 662, created by Aloe_vera + { + // Size: + 7, 12, 7, // SizeX = 7, SizeY = 12, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 11, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "b: 85: 0\n" /* fence */ + "c: 66: 4\n" /* tracks */ + "d: 66: 0\n" /* tracks */ + "e: 66: 6\n" /* tracks */ + "f: 66: 2\n" /* tracks */ + "g: 50: 1\n" /* torch */ + "h: 50: 3\n" /* torch */ + "i: 66: 1\n" /* tracks */ + "j: 66: 7\n" /* tracks */ + "k: 66: 5\n" /* tracks */ + "l: 50: 2\n" /* torch */ + "m: 19: 0\n" /* sponge */ + "n: 66: 3\n" /* tracks */ + "o: 66: 8\n" /* tracks */ + "p: 50: 4\n" /* torch */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmmmmm" + /* 2 */ "mmmmmmm" + /* 3 */ "aaabmmm" + /* 4 */ "aaammmm" + /* 5 */ "aaammmm" + /* 6 */ "aaammmm" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmmmmm" + /* 2 */ "aaammmm" + /* 3 */ "aaabmmm" + /* 4 */ ".c.mmmm" + /* 5 */ ".d.mmmm" + /* 6 */ ".d.mmmm" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "aaaammm" + /* 1 */ "aaaammm" + /* 2 */ "aaaammm" + /* 3 */ ".c.bmmm" + /* 4 */ "...mmmm" + /* 5 */ "...mmmm" + /* 6 */ "...mmmm" + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "b..aamm" + /* 1 */ ".efaamm" + /* 2 */ ".d.aamm" + /* 3 */ "...bmmm" + /* 4 */ "...mmmm" + /* 5 */ "...mmmm" + /* 6 */ "...mmmm" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "b...aaa" + /* 1 */ "...faaa" + /* 2 */ "....aaa" + /* 3 */ "...baaa" + /* 4 */ "...mmmm" + /* 5 */ "mmmmmmm" + /* 6 */ "mmmmmmm" + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "ag....b" + /* 1 */ "h...ij." + /* 2 */ ".....k." + /* 3 */ "...baaa" + /* 4 */ "mmmmaaa" + /* 5 */ "mmmmmmm" + /* 6 */ "mmmmmmm" + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "mm....b" + /* 1 */ "mm....." + /* 2 */ "mm....." + /* 3 */ "mmmb.k." + /* 4 */ "mmmaaaa" + /* 5 */ "mmmaaaa" + /* 6 */ "mmmaaaa" + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "mmm..la" + /* 1 */ "mmm...h" + /* 2 */ "mmm...." + /* 3 */ "mmmb..." + /* 4 */ "mmaa.d." + /* 5 */ "mmaano." + /* 6 */ "mmaa..b" + + // Level 8 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmmmmm" + /* 2 */ "mmmm..." + /* 3 */ "mmmb..." + /* 4 */ "aaa...." + /* 5 */ "aaan..." + /* 6 */ "aaa...b" + + // Level 9 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmmmmm" + /* 2 */ "mmmmmmm" + /* 3 */ "mmmb..." + /* 4 */ "......." + /* 5 */ "iii...p" + /* 6 */ ".....la" + + // Level 10 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmmmmm" + /* 2 */ "mmmmmmm" + /* 3 */ "mmmbmmm" + /* 4 */ ".....mm" + /* 5 */ ".....mm" + /* 6 */ ".....mm" + + // Level 11 + /* z\x* 0123456 */ + /* 0 */ "mmmmmmm" + /* 1 */ "mmmmmmm" + /* 2 */ "mmmmmmm" + /* 3 */ "mmmbmmm" + /* 4 */ "....mmm" + /* 5 */ "....mmm" + /* 6 */ "....mmm", + + // Connectors: + "3: 1, 1, 6: 3\n" /* Type 3, direction Z+ */ + "-3: 1, 1, 6: 3\n" /* Type -3, direction Z+ */ + "3: 0, 9, 5: 4\n" /* Type 3, direction X- */ + "-3: 0, 9, 5: 4\n" /* Type -3, direction X- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // MineshaftSpiral + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftStairs: + // The data has been exported from the gallery Plains, area index 195, ID 659, created by Aloe_vera + { + // Size: + 7, 8, 3, // SizeX = 7, SizeY = 8, SizeZ = 3 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 7, 2, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "b: 66: 1\n" /* tracks */ + "c: 66: 2\n" /* tracks */ + "d: 85: 0\n" /* fence */ + "e: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 0123456 */ + /* 0 */ "aaammmm" + /* 1 */ "aaammmm" + /* 2 */ "aaammmm" + + // Level 1 + /* z\x* 0123456 */ + /* 0 */ "..aammm" + /* 1 */ "bcaammm" + /* 2 */ "..aammm" + + // Level 2 + /* z\x* 0123456 */ + /* 0 */ "...aamm" + /* 1 */ "..caamm" + /* 2 */ "...aamm" + + // Level 3 + /* z\x* 0123456 */ + /* 0 */ "...daam" + /* 1 */ "...caam" + /* 2 */ "...daam" + + // Level 4 + /* z\x* 0123456 */ + /* 0 */ "m..d.aa" + /* 1 */ "m...caa" + /* 2 */ "m..d.aa" + + // Level 5 + /* z\x* 0123456 */ + /* 0 */ "mm.d..." + /* 1 */ "mm...bb" + /* 2 */ "mm.d..." + + // Level 6 + /* z\x* 0123456 */ + /* 0 */ "mmmd..." + /* 1 */ "mmm...." + /* 2 */ "mmmd..." + + // Level 7 + /* z\x* 0123456 */ + /* 0 */ "mmma..." + /* 1 */ "mmmae.." + /* 2 */ "mmma...", + + // Connectors: + "3: 0, 1, 1: 4\n" /* Type 3, direction X- */ + "-3: 0, 1, 1: 4\n" /* Type -3, direction X- */ + "3: 6, 5, 1: 5\n" /* Type 3, direction X+ */ + "-3: 6, 5, 1: 5\n" /* Type -3, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // MineshaftStairs + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftStairsCrossing: + // The data has been exported from the gallery Plains, area index 199, ID 663, created by Aloe_vera + { + // Size: + 11, 12, 11, // SizeX = 11, SizeY = 12, SizeZ = 11 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 11, 10, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "b: 66: 5\n" /* tracks */ + "c: 85: 0\n" /* fence */ + "d: 66: 0\n" /* tracks */ + "e: 66: 1\n" /* tracks */ + "f: 50: 3\n" /* torch */ + "g: 50: 2\n" /* torch */ + "h: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmaaammmm" + /* 1 */ "mmmmaaammmm" + /* 2 */ "mmmmmmmmmmm" + /* 3 */ "mmmmmmmmmmm" + /* 4 */ "mmmmmmmmmmm" + /* 5 */ "mmmmmmmmmmm" + /* 6 */ "mmmmmmmmmmm" + /* 7 */ "mmmmmmmmmmm" + /* 8 */ "mmmmmmmmmmm" + /* 9 */ "mmmmmmmmmmm" + /* 10 */ "mmmmmmmmmmm" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm.b.mmmm" + /* 1 */ "mmmmaaammmm" + /* 2 */ "mmmmaaammmm" + /* 3 */ "mmmmmmmmmmm" + /* 4 */ "mmmmmmmmmmm" + /* 5 */ "mmmmmmmmmmm" + /* 6 */ "mmmmmmmmmmm" + /* 7 */ "mmmmmmmmmmm" + /* 8 */ "mmmmmmmmmmm" + /* 9 */ "mmmmmmmmmmm" + /* 10 */ "mmmmmmmmmmm" + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm...mmmm" + /* 1 */ "mmmm.b.mmmm" + /* 2 */ "mmmmaaammmm" + /* 3 */ "mmmmaaammmm" + /* 4 */ "mmmmmmmmmmm" + /* 5 */ "mmmmmmmmmmm" + /* 6 */ "mmmmmmmmmmm" + /* 7 */ "mmmmmmmmmmm" + /* 8 */ "mmmmmmmmmmm" + /* 9 */ "mmmmmmmmmmm" + /* 10 */ "mmmmmmmmmmm" + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm...mmmm" + /* 1 */ "mmmm...mmmm" + /* 2 */ "mmmmcbcmmmm" + /* 3 */ "mmmmaaammmm" + /* 4 */ "mmmmaaammmm" + /* 5 */ "mmmmmmmmmmm" + /* 6 */ "mmmmmmmmmmm" + /* 7 */ "mmmmmmmmmmm" + /* 8 */ "mmmmmmmmmmm" + /* 9 */ "mmmmmmmmmmm" + /* 10 */ "mmmmmmmmmmm" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm...mmmm" + /* 1 */ "mmmm...mmmm" + /* 2 */ "mmmmc.cmmmm" + /* 3 */ "mmmm.b.mmmm" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + /* 7 */ "mmmmaaammmm" + /* 8 */ "mmmmmmmmmmm" + /* 9 */ "mmmmmmmmmmm" + /* 10 */ "mmmmmmmmmmm" + + // Level 5 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmmm...mmmm" + /* 2 */ "mmmmc.cmmmm" + /* 3 */ "mmmm...mmmm" + /* 4 */ "..c..d..c.." + /* 5 */ "eeeeeeeeeee" + /* 6 */ "..c..b..c.." + /* 7 */ "mmmmaaammmm" + /* 8 */ "mmmmaaammmm" + /* 9 */ "mmmmmmmmmmm" + /* 10 */ "mmmmmmmmmmm" + + // Level 6 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmm" + /* 2 */ "mmmmc.cmmmm" + /* 3 */ "mmmm...mmmm" + /* 4 */ "..c.....c.." + /* 5 */ "..........." + /* 6 */ "..c.....c.." + /* 7 */ "mmmm.b.mmmm" + /* 8 */ "mmmmaaammmm" + /* 9 */ "mmmmaaammmm" + /* 10 */ "mmmmmmmmmmm" + + // Level 7 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmm" + /* 2 */ "mmmmaaammmm" + /* 3 */ "mmmm.f.mmmm" + /* 4 */ "..a.....a.." + /* 5 */ ".gah...gah." + /* 6 */ "..a.....a.." + /* 7 */ "mmmm...mmmm" + /* 8 */ "mmmmcbcmmmm" + /* 9 */ "mmmmaaammmm" + /* 10 */ "mmmmaaammmm" + + // Level 8 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmm" + /* 2 */ "mmmmmmmmmmm" + /* 3 */ "mmmmmmmmmmm" + /* 4 */ "mmmmmmmmmmm" + /* 5 */ "mmmmmmmmmmm" + /* 6 */ "mmmm...mmmm" + /* 7 */ "mmmm...mmmm" + /* 8 */ "mmmmc.cmmmm" + /* 9 */ "mmmm.b.mmmm" + /* 10 */ "mmmmaaammmm" + + // Level 9 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmm" + /* 2 */ "mmmmmmmmmmm" + /* 3 */ "mmmmmmmmmmm" + /* 4 */ "mmmmmmmmmmm" + /* 5 */ "mmmmmmmmmmm" + /* 6 */ "mmmmmmmmmmm" + /* 7 */ "mmmm...mmmm" + /* 8 */ "mmmmc.cmmmm" + /* 9 */ "mmmm...mmmm" + /* 10 */ "mmmm.d.mmmm" + + // Level 10 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmm" + /* 2 */ "mmmmmmmmmmm" + /* 3 */ "mmmmmmmmmmm" + /* 4 */ "mmmmmmmmmmm" + /* 5 */ "mmmmmmmmmmm" + /* 6 */ "mmmmmmmmmmm" + /* 7 */ "mmmmmmmmmmm" + /* 8 */ "mmmmc.cmmmm" + /* 9 */ "mmmm...mmmm" + /* 10 */ "mmmm...mmmm" + + // Level 11 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmmmmmmmmmm" + /* 2 */ "mmmmmmmmmmm" + /* 3 */ "mmmmmmmmmmm" + /* 4 */ "mmmmmmmmmmm" + /* 5 */ "mmmmmmmmmmm" + /* 6 */ "mmmmmmmmmmm" + /* 7 */ "mmmmmmmmmmm" + /* 8 */ "mmmmaaammmm" + /* 9 */ "mmmm.f.mmmm" + /* 10 */ "mmmm...mmmm", + + // Connectors: + "3: 0, 5, 5: 4\n" /* Type 3, direction X- */ + "-3: 0, 5, 5: 4\n" /* Type -3, direction X- */ + "3: 10, 5, 5: 5\n" /* Type 3, direction X+ */ + "-3: 10, 5, 5: 5\n" /* Type -3, direction X+ */ + "3: 5, 9, 10: 3\n" /* Type 3, direction Z+ */ + "-3: 5, 9, 10: 3\n" /* Type -3, direction Z+ */ + "3: 5, 1, 0: 2\n" /* Type 3, direction Z- */ + "-3: 5, 1, 0: 2\n" /* Type -3, direction Z- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 30, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // MineshaftStairsCrossing + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftTee: + // The data has been exported from the gallery Plains, area index 194, ID 658, created by Aloe_vera + { + // Size: + 11, 4, 7, // SizeX = 11, SizeY = 4, SizeZ = 7 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 3, 6, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "b: 66: 0\n" /* tracks */ + "c: 85: 0\n" /* fence */ + "d: 66: 1\n" /* tracks */ + "e: 50: 4\n" /* torch */ + "f: 50: 3\n" /* torch */ + "g: 50: 2\n" /* torch */ + "h: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmaaammmm" + /* 1 */ "mmmmaaammmm" + /* 2 */ "mmmmaaammmm" + /* 3 */ "mmmmaaammmm" + /* 4 */ "aaaaaaaaaaa" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm.b.mmmm" + /* 1 */ "mmmm.b.mmmm" + /* 2 */ "mmmmcbcmmmm" + /* 3 */ "mmmm.b.mmmm" + /* 4 */ "..c..b..c.." + /* 5 */ "ddddddddddd" + /* 6 */ "..c.....c.." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm...mmmm" + /* 1 */ "mmmm...mmmm" + /* 2 */ "mmmmc.cmmmm" + /* 3 */ "mmmm...mmmm" + /* 4 */ "..c.....c.." + /* 5 */ "..........." + /* 6 */ "..c.....c.." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmm...mmmm" + /* 1 */ "mmmm.e.mmmm" + /* 2 */ "mmmmaaammmm" + /* 3 */ "mmmm.f.mmmm" + /* 4 */ "..a.....a.." + /* 5 */ ".gah...gah." + /* 6 */ "..a.....a..", + + // Connectors: + "3: 0, 1, 5: 4\n" /* Type 3, direction X- */ + "-3: 0, 1, 5: 4\n" /* Type -3, direction X- */ + "3: 5, 1, 0: 2\n" /* Type 3, direction Z- */ + "-3: 5, 1, 0: 2\n" /* Type -3, direction Z- */ + "3: 10, 1, 5: 5\n" /* Type 3, direction X+ */ + "-3: 10, 1, 5: 5\n" /* Type -3, direction X+ */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 20, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // MineshaftTee + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // MineshaftsCorridor5: + // The data has been exported from the gallery Plains, area index 200, ID 664, created by Aloe_vera + { + // Size: + 11, 4, 3, // SizeX = 11, SizeY = 4, SizeZ = 3 + + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 3, 2, // MaxX, MaxY, MaxZ + + // Block definitions: + ".: 0: 0\n" /* air */ + "a: 5: 0\n" /* wood */ + "b: 85: 0\n" /* fence */ + "c: 66: 1\n" /* tracks */ + "d: 50: 2\n" /* torch */ + "e: 50: 1\n" /* torch */ + "m: 19: 0\n" /* sponge */, + + // Block data: + // Level 0 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "aaaaaaaaaaa" + /* 1 */ "aaaaaaaaaaa" + /* 2 */ "aaaaaaaaaaa" + + // Level 1 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..b.....b.." + /* 1 */ "ccccccccccc" + /* 2 */ "..b.....b.." + + // Level 2 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..b.....b.." + /* 1 */ "..........." + /* 2 */ "..b.....b.." + + // Level 3 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "..a.....a.." + /* 1 */ ".dae...dae." + /* 2 */ "..a.....a..", + + // Connectors: + "3: 10, 1, 1: 5\n" /* Type 3, direction X+ */ + "-3: 10, 1, 1: 5\n" /* Type -3, direction X+ */ + "-3: 0, 1, 1: 4\n" /* Type -3, direction X- */ + "3: 0, 1, 1: 4\n" /* Type 3, direction X- */, + + // AllowedRotations: + 7, /* 1, 2, 3 CCW rotation allowed */ + + // Merge strategy: + cBlockArea::msSpongePrint, + + // ShouldExtendFloor: + false, + + // DefaultWeight: + 100, + + // DepthWeight: + "", + + // AddWeightIfSame: + 0, + + // MoveToGround: + false, + }, // MineshaftsCorridor5 + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Scarecrow: // The data has been exported from the gallery Plains, area index 150, ID 494, created by STR_Warrior @@ -2770,8 +3588,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Block definitions: ".: 0: 0\n" /* air */ - "a: 3: 0\n" /* dirt */ - "b: 2: 0\n" /* grass */ + "a: 2: 0\n" /* grass */ + "b: 3: 0\n" /* dirt */ "c: 4: 0\n" /* cobblestone */ "d: 67: 0\n" /* stairs */ "e: 67: 2\n" /* stairs */ @@ -2796,19 +3614,19 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 0 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "abaaaaabbbb" - /* 1 */ "baaaaaaaaab" - /* 2 */ "baaaaaaaaab" - /* 3 */ "baaaaaaaaab" - /* 4 */ "baaaaaaaaab" - /* 5 */ "baaaaaaaaab" - /* 6 */ "baaaaaaaaab" - /* 7 */ "baaaaaaaaab" - /* 8 */ "bbaaaaaaabb" - /* 9 */ "bbaaaaaaabb" - /* 10 */ "bbaaaaaaabb" - /* 11 */ "bbaaaaaaabb" - /* 12 */ "bbaaaaaaabb" + /* 0 */ "aaabbbbaaaa" + /* 1 */ "abbbbbbbbba" + /* 2 */ "abbbbbbbbba" + /* 3 */ "abbbbbbbbba" + /* 4 */ "abbbbbbbbba" + /* 5 */ "abbbbbbbbba" + /* 6 */ "abbbbbbbbba" + /* 7 */ "abbbbbbbbba" + /* 8 */ "aabbbbbbbaa" + /* 9 */ "aabbbbbbbaa" + /* 10 */ "aabbbbbbbaa" + /* 11 */ "aabbbbbbbaa" + /* 12 */ "aabbbbbbbaa" // Level 1 /* z\x* 1 */ @@ -2821,11 +3639,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 5 */ "mcccccccccm" /* 6 */ "mcccccccccm" /* 7 */ "mcccccccccm" - /* 8 */ "mmaaaaaaamm" - /* 9 */ "mmaaaaaaamm" - /* 10 */ "mmaaaaaaamm" - /* 11 */ "mmaaaaaaamm" - /* 12 */ "mmaaaaaaamm" + /* 8 */ "mmbbbbbbbmm" + /* 9 */ "mmbbbbbbbmm" + /* 10 */ "mmbbbbbbbmm" + /* 11 */ "mmbbbbbbbmm" + /* 12 */ "mmbbbbbbbmm" // Level 2 /* z\x* 1 */ @@ -2838,11 +3656,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 5 */ ".cggggcccc." /* 6 */ ".cggggcccc." /* 7 */ ".ccccccccc." - /* 8 */ "..bbbbbbb.." - /* 9 */ "..bbbbbbb.." - /* 10 */ "..bbbbbbb.." - /* 11 */ "..bbbbbbb.." - /* 12 */ "..bbbbbbb.." + /* 8 */ "..aaaaaaa.." + /* 9 */ "..aaaaaaa.." + /* 10 */ "..aaaaaaa.." + /* 11 */ "..aaaaaaa.." + /* 12 */ "..aaaaaaa.." // Level 3 /* z\x* 1 */ From b9d306a801af7de6c620740d5f8c827c7df29dce Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 30 May 2014 22:41:47 +0200 Subject: [PATCH 211/214] Fixed bindings for cCompositeChat:SetMessageType(). --- src/Bindings/ManualBindings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 10e560ac0..14d9d16fc 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2864,8 +2864,8 @@ static int tolua_cCompositeChat_SetMessageType(lua_State * tolua_S) } // Set the type: - int MessageType; - L.GetStackValue(1, MessageType); + int MessageType = mtCustom; + L.GetStackValue(2, MessageType); self->SetMessageType((eMessageType)MessageType); // Cut away everything from the stack except for the cCompositeChat instance; return that: From f4e9c88dcdefee2b6e4ca7f97483d4cdfba939ae Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 31 May 2014 10:33:12 +0200 Subject: [PATCH 212/214] Fixed a memory leak in VillagGen. --- src/Generating/VillageGen.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index dfcdf6ef7..b9cb056ad 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -147,6 +147,11 @@ public: } } + ~cVillage() + { + cPieceGenerator::FreePieces(m_Pieces); + } + protected: /** Seed for the random functions */ int m_Seed; From 600c93bdc16e6826ebf9822ad941a1f87139bab5 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 31 May 2014 10:33:29 +0200 Subject: [PATCH 213/214] Updated PlainsVillage prefabs. --- .../Prefabs/PlainsVillagePrefabs.cpp | 182 ++++++++++-------- 1 file changed, 97 insertions(+), 85 deletions(-) diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp index f5e531955..f5c5b7a20 100644 --- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp +++ b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp @@ -1472,18 +1472,18 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // The data has been exported from the gallery Plains, area index 199, ID 663, created by Aloe_vera { // Size: - 11, 12, 11, // SizeX = 11, SizeY = 12, SizeZ = 11 + 11, 12, 12, // SizeX = 11, SizeY = 12, SizeZ = 12 // Hitbox (relative to bounding box): 0, 0, 0, // MinX, MinY, MinZ - 10, 11, 10, // MaxX, MaxY, MaxZ + 10, 11, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ "a: 5: 0\n" /* wood */ - "b: 66: 5\n" /* tracks */ - "c: 85: 0\n" /* fence */ - "d: 66: 0\n" /* tracks */ + "b: 66: 0\n" /* tracks */ + "c: 66: 5\n" /* tracks */ + "d: 85: 0\n" /* fence */ "e: 66: 1\n" /* tracks */ "f: 50: 3\n" /* torch */ "g: 50: 2\n" /* torch */ @@ -1496,21 +1496,6 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* * 01234567890 */ /* 0 */ "mmmmaaammmm" /* 1 */ "mmmmaaammmm" - /* 2 */ "mmmmmmmmmmm" - /* 3 */ "mmmmmmmmmmm" - /* 4 */ "mmmmmmmmmmm" - /* 5 */ "mmmmmmmmmmm" - /* 6 */ "mmmmmmmmmmm" - /* 7 */ "mmmmmmmmmmm" - /* 8 */ "mmmmmmmmmmm" - /* 9 */ "mmmmmmmmmmm" - /* 10 */ "mmmmmmmmmmm" - - // Level 1 - /* z\x* 1 */ - /* * 01234567890 */ - /* 0 */ "mmmm.b.mmmm" - /* 1 */ "mmmmaaammmm" /* 2 */ "mmmmaaammmm" /* 3 */ "mmmmmmmmmmm" /* 4 */ "mmmmmmmmmmm" @@ -1520,12 +1505,13 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "mmmmmmmmmmm" /* 9 */ "mmmmmmmmmmm" /* 10 */ "mmmmmmmmmmm" + /* 11 */ "mmmmmmmmmmm" - // Level 2 + // Level 1 /* z\x* 1 */ /* * 01234567890 */ - /* 0 */ "mmmm...mmmm" - /* 1 */ "mmmm.b.mmmm" + /* 0 */ "mmmm.b.mmmm" + /* 1 */ "mmmm.c.mmmm" /* 2 */ "mmmmaaammmm" /* 3 */ "mmmmaaammmm" /* 4 */ "mmmmmmmmmmm" @@ -1535,13 +1521,14 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "mmmmmmmmmmm" /* 9 */ "mmmmmmmmmmm" /* 10 */ "mmmmmmmmmmm" + /* 11 */ "mmmmmmmmmmm" - // Level 3 + // Level 2 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "mmmm...mmmm" /* 1 */ "mmmm...mmmm" - /* 2 */ "mmmmcbcmmmm" + /* 2 */ "mmmm.c.mmmm" /* 3 */ "mmmmaaammmm" /* 4 */ "mmmmaaammmm" /* 5 */ "mmmmmmmmmmm" @@ -1550,66 +1537,87 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 8 */ "mmmmmmmmmmm" /* 9 */ "mmmmmmmmmmm" /* 10 */ "mmmmmmmmmmm" + /* 11 */ "mmmmmmmmmmm" - // Level 4 + // Level 3 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "mmmm...mmmm" /* 1 */ "mmmm...mmmm" - /* 2 */ "mmmmc.cmmmm" - /* 3 */ "mmmm.b.mmmm" - /* 4 */ "aaaaaaaaaaa" - /* 5 */ "aaaaaaaaaaa" - /* 6 */ "aaaaaaaaaaa" - /* 7 */ "mmmmaaammmm" + /* 2 */ "mmmm...mmmm" + /* 3 */ "mmmmdcdmmmm" + /* 4 */ "mmmmaaammmm" + /* 5 */ "mmmmaaammmm" + /* 6 */ "mmmmmmmmmmm" + /* 7 */ "mmmmmmmmmmm" /* 8 */ "mmmmmmmmmmm" /* 9 */ "mmmmmmmmmmm" /* 10 */ "mmmmmmmmmmm" + /* 11 */ "mmmmmmmmmmm" + + // Level 4 + /* z\x* 1 */ + /* * 01234567890 */ + /* 0 */ "mmmmmmmmmmm" + /* 1 */ "mmmm...mmmm" + /* 2 */ "mmmm...mmmm" + /* 3 */ "mmmmd.dmmmm" + /* 4 */ "mmmm.c.mmmm" + /* 5 */ "aaaaaaaaaaa" + /* 6 */ "aaaaaaaaaaa" + /* 7 */ "aaaaaaaaaaa" + /* 8 */ "mmmmaaammmm" + /* 9 */ "mmmmmmmmmmm" + /* 10 */ "mmmmmmmmmmm" + /* 11 */ "mmmmmmmmmmm" // Level 5 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "mmmmmmmmmmm" - /* 1 */ "mmmm...mmmm" - /* 2 */ "mmmmc.cmmmm" - /* 3 */ "mmmm...mmmm" - /* 4 */ "..c..d..c.." - /* 5 */ "eeeeeeeeeee" - /* 6 */ "..c..b..c.." - /* 7 */ "mmmmaaammmm" + /* 1 */ "mmmmmmmmmmm" + /* 2 */ "mmmm...mmmm" + /* 3 */ "mmmmd.dmmmm" + /* 4 */ "mmmm...mmmm" + /* 5 */ "..d..b..d.." + /* 6 */ "eeeeeeeeeee" + /* 7 */ "..d..c..d.." /* 8 */ "mmmmaaammmm" - /* 9 */ "mmmmmmmmmmm" + /* 9 */ "mmmmaaammmm" /* 10 */ "mmmmmmmmmmm" + /* 11 */ "mmmmmmmmmmm" // Level 6 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "mmmmmmmmmmm" /* 1 */ "mmmmmmmmmmm" - /* 2 */ "mmmmc.cmmmm" - /* 3 */ "mmmm...mmmm" - /* 4 */ "..c.....c.." - /* 5 */ "..........." - /* 6 */ "..c.....c.." - /* 7 */ "mmmm.b.mmmm" - /* 8 */ "mmmmaaammmm" + /* 2 */ "mmmmmmmmmmm" + /* 3 */ "mmmmd.dmmmm" + /* 4 */ "mmmm...mmmm" + /* 5 */ "..d.....d.." + /* 6 */ "..........." + /* 7 */ "..d.....d.." + /* 8 */ "mmmm.c.mmmm" /* 9 */ "mmmmaaammmm" - /* 10 */ "mmmmmmmmmmm" + /* 10 */ "mmmmaaammmm" + /* 11 */ "mmmmmmmmmmm" // Level 7 /* z\x* 1 */ /* * 01234567890 */ /* 0 */ "mmmmmmmmmmm" /* 1 */ "mmmmmmmmmmm" - /* 2 */ "mmmmaaammmm" - /* 3 */ "mmmm.f.mmmm" - /* 4 */ "..a.....a.." - /* 5 */ ".gah...gah." - /* 6 */ "..a.....a.." - /* 7 */ "mmmm...mmmm" - /* 8 */ "mmmmcbcmmmm" - /* 9 */ "mmmmaaammmm" + /* 2 */ "mmmmmmmmmmm" + /* 3 */ "mmmmaaammmm" + /* 4 */ "mmmm.f.mmmm" + /* 5 */ "..a.....a.." + /* 6 */ ".gah...gah." + /* 7 */ "..a.....a.." + /* 8 */ "mmmm...mmmm" + /* 9 */ "mmmmdcdmmmm" /* 10 */ "mmmmaaammmm" + /* 11 */ "mmmmaaammmm" // Level 8 /* z\x* 1 */ @@ -1620,11 +1628,12 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 3 */ "mmmmmmmmmmm" /* 4 */ "mmmmmmmmmmm" /* 5 */ "mmmmmmmmmmm" - /* 6 */ "mmmm...mmmm" + /* 6 */ "mmmmmmmmmmm" /* 7 */ "mmmm...mmmm" - /* 8 */ "mmmmc.cmmmm" - /* 9 */ "mmmm.b.mmmm" - /* 10 */ "mmmmaaammmm" + /* 8 */ "mmmm...mmmm" + /* 9 */ "mmmmd.dmmmm" + /* 10 */ "mmmm.c.mmmm" + /* 11 */ "mmmmaaammmm" // Level 9 /* z\x* 1 */ @@ -1636,10 +1645,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 4 */ "mmmmmmmmmmm" /* 5 */ "mmmmmmmmmmm" /* 6 */ "mmmmmmmmmmm" - /* 7 */ "mmmm...mmmm" - /* 8 */ "mmmmc.cmmmm" - /* 9 */ "mmmm...mmmm" - /* 10 */ "mmmm.d.mmmm" + /* 7 */ "mmmmmmmmmmm" + /* 8 */ "mmmm...mmmm" + /* 9 */ "mmmmd.dmmmm" + /* 10 */ "mmmm...mmmm" + /* 11 */ "mmmm.b.mmmm" // Level 10 /* z\x* 1 */ @@ -1652,9 +1662,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 5 */ "mmmmmmmmmmm" /* 6 */ "mmmmmmmmmmm" /* 7 */ "mmmmmmmmmmm" - /* 8 */ "mmmmc.cmmmm" - /* 9 */ "mmmm...mmmm" + /* 8 */ "mmmmmmmmmmm" + /* 9 */ "mmmmd.dmmmm" /* 10 */ "mmmm...mmmm" + /* 11 */ "mmmm...mmmm" // Level 11 /* z\x* 1 */ @@ -1667,19 +1678,20 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = /* 5 */ "mmmmmmmmmmm" /* 6 */ "mmmmmmmmmmm" /* 7 */ "mmmmmmmmmmm" - /* 8 */ "mmmmaaammmm" - /* 9 */ "mmmm.f.mmmm" - /* 10 */ "mmmm...mmmm", + /* 8 */ "mmmmmmmmmmm" + /* 9 */ "mmmmaaammmm" + /* 10 */ "mmmm.f.mmmm" + /* 11 */ "mmmm...mmmm", // Connectors: - "3: 0, 5, 5: 4\n" /* Type 3, direction X- */ - "-3: 0, 5, 5: 4\n" /* Type -3, direction X- */ - "3: 10, 5, 5: 5\n" /* Type 3, direction X+ */ - "-3: 10, 5, 5: 5\n" /* Type -3, direction X+ */ - "3: 5, 9, 10: 3\n" /* Type 3, direction Z+ */ - "-3: 5, 9, 10: 3\n" /* Type -3, direction Z+ */ - "3: 5, 1, 0: 2\n" /* Type 3, direction Z- */ - "-3: 5, 1, 0: 2\n" /* Type -3, direction Z- */, + "3: 0, 5, 6: 4\n" /* Type 3, direction X- */ + "-3: 0, 5, 6: 4\n" /* Type -3, direction X- */ + "3: 10, 5, 6: 5\n" /* Type 3, direction X+ */ + "-3: 10, 5, 6: 5\n" /* Type -3, direction X+ */ + "3: 5, 9, 11: 3\n" /* Type 3, direction Z+ */ + "-3: 5, 9, 11: 3\n" /* Type -3, direction Z+ */ + "3: 5, 1, 1: 2\n" /* Type 3, direction Z- */ + "-3: 5, 1, 1: 2\n" /* Type -3, direction Z- */, // AllowedRotations: 7, /* 1, 2, 3 CCW rotation allowed */ @@ -3143,17 +3155,17 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] = // Level 0 /* z\x* */ /* * 0123456789 */ - /* 0 */ "mmmmmmmmmm" - /* 1 */ "maaaaammmm" - /* 2 */ "maaaaammmm" - /* 3 */ "maaaaabbbb" + /* 0 */ ".........." + /* 1 */ ".aaaaa...." + /* 2 */ ".aaaaa...." + /* 3 */ ".aaaaabbbb" /* 4 */ "aaaaaabbbb" /* 5 */ "aaaaaabbbb" /* 6 */ "aaaaaabbbb" - /* 7 */ "maaaaabbbb" - /* 8 */ "maaaaabbbb" - /* 9 */ "maaaaammmm" - /* 10 */ "mmmmmmmmmm" + /* 7 */ ".aaaaabbbb" + /* 8 */ ".aaaaabbbb" + /* 9 */ ".aaaaa...." + /* 10 */ ".........." // Level 1 /* z\x* */ From 75fe89b8aef77d8e684a30aae07c09297d1653cb Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 1 Jun 2014 09:27:27 +0200 Subject: [PATCH 214/214] Updated AlchemistVillage prefabs. --- .../Prefabs/AlchemistVillagePrefabs.cpp | 208 +++++++++--------- 1 file changed, 105 insertions(+), 103 deletions(-) diff --git a/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp b/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp index 6e3f82212..eb0d30fdf 100644 --- a/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp +++ b/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp @@ -23,8 +23,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 11, 12, 10, // SizeX = 11, SizeY = 12, SizeZ = 10 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 11, 9, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 11, 10, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -270,8 +270,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 11, 8, 10, // SizeX = 11, SizeY = 8, SizeZ = 10 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 7, 9, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 7, 10, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -455,8 +455,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 11, 5, 13, // SizeX = 11, SizeY = 5, SizeZ = 13 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 4, 12, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 4, 13, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -606,26 +606,28 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 15, 13, 11, // SizeX = 15, SizeY = 13, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 14, 12, 10, // MaxX, MaxY, MaxZ + -1, 0, -1, // MinX, MinY, MinZ + 14, 12, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ - "A:128: 7\n" /* sandstonestairs */ - "B: 44: 1\n" /* step */ - "C:128: 2\n" /* sandstonestairs */ - "D:128: 0\n" /* sandstonestairs */ - "E: 87: 0\n" /* netherstone */ - "F:128: 3\n" /* sandstonestairs */ - "G: 51: 0\n" /* fire */ - "H: 44: 9\n" /* step */ + "A:128: 4\n" /* sandstonestairs */ + "B:128: 5\n" /* sandstonestairs */ + "C:128: 7\n" /* sandstonestairs */ + "D: 44: 1\n" /* step */ + "E:128: 2\n" /* sandstonestairs */ + "F:128: 0\n" /* sandstonestairs */ + "G: 87: 0\n" /* netherstone */ + "H:128: 3\n" /* sandstonestairs */ + "I: 51: 0\n" /* fire */ + "J: 44: 9\n" /* step */ "a: 12: 0\n" /* sand */ "b: 5: 0\n" /* wood */ "c: 24: 2\n" /* sandstone */ "d: 24: 0\n" /* sandstone */ "e: 85: 0\n" /* fence */ "f: 5: 1\n" /* wood */ - "g: 64: 2\n" /* wooddoorblock */ + "g: 64: 6\n" /* wooddoorblock */ "h: 64: 0\n" /* wooddoorblock */ "i: 61: 2\n" /* furnace */ "j:118: 0\n" /* cauldronblock */ @@ -633,18 +635,18 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "l: 65: 2\n" /* ladder */ "m: 19: 0\n" /* sponge */ "n:101: 0\n" /* ironbars */ - "o:140: 0\n" /* flowerpotblock */ - "p: 64: 8\n" /* wooddoorblock */ - "q: 50: 3\n" /* torch */ - "r: 69:12\n" /* lever */ - "s: 50: 4\n" /* torch */ - "t:128: 6\n" /* sandstonestairs */ - "u: 44:10\n" /* step */ - "v:128: 1\n" /* sandstonestairs */ - "w: 47: 0\n" /* bookshelf */ - "x: 96:12\n" /* trapdoor */ - "y:128: 4\n" /* sandstonestairs */ - "z:128: 5\n" /* sandstonestairs */, + "o: 50: 1\n" /* torch */ + "p:140: 0\n" /* flowerpotblock */ + "q: 64:12\n" /* wooddoorblock */ + "r: 50: 3\n" /* torch */ + "s: 64: 8\n" /* wooddoorblock */ + "t: 69:12\n" /* lever */ + "u: 50: 4\n" /* torch */ + "v:128: 6\n" /* sandstonestairs */ + "w: 44:10\n" /* step */ + "x:128: 1\n" /* sandstonestairs */ + "y: 47: 0\n" /* bookshelf */ + "z: 96:10\n" /* trapdoor */, // Block data: // Level 0 @@ -681,12 +683,12 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "....cddnnnddc.." - /* 1 */ "....d......od.c" - /* 2 */ "....p.......d.q" - /* 3 */ "....d.......p.." - /* 4 */ "....d.r...l.d.s" + /* 1 */ "....do.....pd.c" + /* 2 */ "....q.......d.r" + /* 3 */ "....d.......s.." + /* 4 */ "....d.t...l.d.u" /* 5 */ "....dddd.dddd.c" - /* 6 */ "....n.......n.." + /* 6 */ "....n..r.r..n.." /* 7 */ "mmmmn.......n.." /* 8 */ "mmmmn.......n.." /* 9 */ "mmmmd.......d.." @@ -695,32 +697,32 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = // Level 3 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "....cddtttddc.." - /* 1 */ "....duuuuuuuddv" - /* 2 */ "....duuuuuuud.." - /* 3 */ "....duuuuuuud.." - /* 4 */ "....dwwwuuxud.." - /* 5 */ "....ddddddddddv" - /* 6 */ "....yuuuuuuuz.." - /* 7 */ "mmmmyuuuuuuuz.." - /* 8 */ "mmmmyuuuuuuuz.." - /* 9 */ "mmmmduuuuuuud.." - /* 10 */ "mmmmcddAAAddc.." + /* 0 */ "....cddvvvddc.." + /* 1 */ "....dwwwwwwwddx" + /* 2 */ "....dwwwwwwwd.." + /* 3 */ "....dwwwwwwwd.." + /* 4 */ "....dyyywwzwd.." + /* 5 */ "....ddddddddddx" + /* 6 */ "....AwwwwwwwB.." + /* 7 */ "mmmmAwwwwwwwB.." + /* 8 */ "mmmmAwwwwwwwB.." + /* 9 */ "mmmmdwwwwwwwd.." + /* 10 */ "mmmmcddCCCddc.." // Level 4 /* z\x* 11111 */ /* * 012345678901234 */ - /* 0 */ "....dBBBdBBBd.." - /* 1 */ "....BcdddddcB.." - /* 2 */ "....Bd.....dB.." - /* 3 */ "....Bd.....dB.." - /* 4 */ "....Bd.....dB.." + /* 0 */ "....dDDDdDDDd.." + /* 1 */ "....DcdddddcD.." + /* 2 */ "....Dd.....dD.." + /* 3 */ "....Dd.....dD.." + /* 4 */ "....Dd.....dD.." /* 5 */ "....dcdd.ddcd.." - /* 6 */ "....B.......B.." - /* 7 */ "mmmmB.......B.." - /* 8 */ "mmmmB.......B.." - /* 9 */ "mmmmB.......B.." - /* 10 */ "mmmmdBBBdBBBd.." + /* 6 */ "....D.......D.." + /* 7 */ "mmmmD.......D.." + /* 8 */ "mmmmD.......D.." + /* 9 */ "mmmmD.......D.." + /* 10 */ "mmmmdDDDdDDDd.." // Level 5 /* z\x* 11111 */ @@ -741,10 +743,10 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".....cddtddc..." - /* 2 */ ".....yuuuuuz..." - /* 3 */ ".....yuuuuuz..." - /* 4 */ ".....yuuuuuz..." + /* 1 */ ".....cddvddc..." + /* 2 */ ".....AwwwwwB..." + /* 3 */ ".....AwwwwwB..." + /* 4 */ ".....AwwwwwB..." /* 5 */ ".....cdddddc..." /* 6 */ "..............." /* 7 */ "..............." @@ -756,11 +758,11 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* z\x* 11111 */ /* * 012345678901234 */ /* 0 */ "..............." - /* 1 */ ".....dBBdBBd..." - /* 2 */ ".....B.ddd.B..." + /* 1 */ ".....dDDdDDd..." + /* 2 */ ".....D.ddd.D..." /* 3 */ ".....d.ddd.d..." - /* 4 */ ".....B.ddd.B..." - /* 5 */ ".....dBBdBBd..." + /* 4 */ ".....D.ddd.D..." + /* 5 */ ".....dDDdDDd..." /* 6 */ "..............." /* 7 */ "..............." /* 8 */ "..............." @@ -772,9 +774,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* * 012345678901234 */ /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ ".......cCc....." - /* 3 */ ".......DEv....." - /* 4 */ ".......cFc....." + /* 2 */ ".......cEc....." + /* 3 */ ".......FGx....." + /* 4 */ ".......cHc....." /* 5 */ "..............." /* 6 */ "..............." /* 7 */ "..............." @@ -788,7 +790,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..............." /* 1 */ "..............." /* 2 */ ".......c.c....." - /* 3 */ "........G......" + /* 3 */ "........I......" /* 4 */ ".......c.c....." /* 5 */ "..............." /* 6 */ "..............." @@ -802,9 +804,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* * 012345678901234 */ /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ ".......ctc....." - /* 3 */ ".......y.z....." - /* 4 */ ".......cAc....." + /* 2 */ ".......cvc....." + /* 3 */ ".......A.B....." + /* 4 */ ".......cCc....." /* 5 */ "..............." /* 6 */ "..............." /* 7 */ "..............." @@ -818,7 +820,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* 0 */ "..............." /* 1 */ "..............." /* 2 */ ".......ddd....." - /* 3 */ ".......dHd....." + /* 3 */ ".......dJd....." /* 4 */ ".......ddd....." /* 5 */ "..............." /* 6 */ "..............." @@ -832,9 +834,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = /* * 012345678901234 */ /* 0 */ "..............." /* 1 */ "..............." - /* 2 */ ".......B.B....." + /* 2 */ ".......D.D....." /* 3 */ "..............." - /* 4 */ ".......B.B....." + /* 4 */ ".......D.D....." /* 5 */ "..............." /* 6 */ "..............." /* 7 */ "..............." @@ -877,8 +879,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 7, 11, 7, // SizeX = 7, SizeY = 11, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 6, 10, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 7, 10, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1050,8 +1052,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 5, 5, 7, // SizeX = 5, SizeY = 5, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 4, 4, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 5, 4, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1160,8 +1162,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 7, 5, 11, // SizeX = 7, SizeY = 5, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 6, 4, 10, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 7, 4, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1291,8 +1293,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 9, 5, 7, // SizeX = 9, SizeY = 5, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 8, 4, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 9, 4, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1400,8 +1402,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 5, 5, 11, // SizeX = 5, SizeY = 5, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 4, 4, 10, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 5, 4, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1428,7 +1430,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "u:128: 5\n" /* sandstonestairs */ "v:128: 7\n" /* sandstonestairs */ "w: 44: 1\n" /* step */ - "x: 96: 7\n" /* trapdoor */, + "x: 96: 1\n" /* trapdoor */, // Block data: // Level 0 @@ -1536,8 +1538,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 9, 5, 9, // SizeX = 9, SizeY = 5, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 8, 4, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 9, 4, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1657,8 +1659,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 9, 5, 9, // SizeX = 9, SizeY = 5, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 8, 4, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 9, 4, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1783,8 +1785,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 9, 5, 11, // SizeX = 9, SizeY = 5, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 8, 4, 10, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 9, 4, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -1914,8 +1916,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 5, 8, 7, // SizeX = 5, SizeY = 8, SizeZ = 7 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 4, 7, 6, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 5, 7, 7, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -2054,8 +2056,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 15, 8, 9, // SizeX = 15, SizeY = 8, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 14, 7, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 15, 7, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -2219,8 +2221,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 11, 9, 9, // SizeX = 11, SizeY = 9, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 10, 8, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 11, 8, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -2413,8 +2415,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 12, 10, 11, // SizeX = 12, SizeY = 10, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 11, 9, 10, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 12, 9, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -2441,7 +2443,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = "u:128: 5\n" /* sandstonestairs */ "v:128: 7\n" /* sandstonestairs */ "w: 44: 1\n" /* step */ - "x: 96: 6\n" /* trapdoor */ + "x: 96: 4\n" /* trapdoor */ "y:126: 0\n" /* woodenslab */ "z:128: 4\n" /* sandstonestairs */, @@ -2631,8 +2633,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 9, 5, 11, // SizeX = 9, SizeY = 5, SizeZ = 11 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 8, 4, 10, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 9, 4, 11, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */ @@ -2762,8 +2764,8 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] = 13, 9, 9, // SizeX = 13, SizeY = 9, SizeZ = 9 // Hitbox (relative to bounding box): - 0, 0, 0, // MinX, MinY, MinZ - 12, 8, 8, // MaxX, MaxY, MaxZ + -1, 0, 0, // MinX, MinY, MinZ + 13, 8, 9, // MaxX, MaxY, MaxZ // Block definitions: ".: 0: 0\n" /* air */