diff options
author | worktycho <work.tycho@gmail.com> | 2015-06-23 18:10:49 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-06-23 18:10:49 +0200 |
commit | ccd290bc724b9306ccfc66dc552ff31fa99154c5 (patch) | |
tree | b5068b80007fdfddc43c56c7cb0a0543f7776c16 /src | |
parent | Merge pull request #2280 from SamJBarney/master (diff) | |
parent | Fixed melon metadata when growing from stem. (diff) | |
download | cuberite-ccd290bc724b9306ccfc66dc552ff31fa99154c5.tar cuberite-ccd290bc724b9306ccfc66dc552ff31fa99154c5.tar.gz cuberite-ccd290bc724b9306ccfc66dc552ff31fa99154c5.tar.bz2 cuberite-ccd290bc724b9306ccfc66dc552ff31fa99154c5.tar.lz cuberite-ccd290bc724b9306ccfc66dc552ff31fa99154c5.tar.xz cuberite-ccd290bc724b9306ccfc66dc552ff31fa99154c5.tar.zst cuberite-ccd290bc724b9306ccfc66dc552ff31fa99154c5.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Chunk.cpp | 15 | ||||
-rw-r--r-- | src/Items/ItemDye.h | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 2e83f2b72..3897ea3a8 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1018,20 +1018,23 @@ void cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Bl // Check if there's soil under the neighbor. We already know the neighbors are valid. Place produce if ok BLOCKTYPE Soil; - UnboundedRelGetBlock(a_RelX + x, a_RelY - 1, a_RelZ + z, Soil, BlockMeta); + VERIFY(UnboundedRelGetBlock(a_RelX + x, a_RelY - 1, a_RelZ + z, Soil, BlockMeta)); switch (Soil) { case E_BLOCK_DIRT: case E_BLOCK_GRASS: case E_BLOCK_FARMLAND: { - // DEBUG: This is here to catch FS #349 - melons growing over other crops. - LOG("Growing melon / pumpkin overwriting %s, growing on %s", + // Place a randomly-facing produce: + NIBBLETYPE Meta = (ProduceType == E_BLOCK_MELON) ? 0 : static_cast<NIBBLETYPE>(a_TickRandom.randInt(4) % 4); + LOGD("Growing melon / pumpkin at {%d, %d, %d} (<%d, %d> from stem), overwriting %s, growing on top of %s, meta %d", + a_RelX + x + m_PosX * cChunkDef::Width, a_RelY, a_RelZ + z + m_PosZ * cChunkDef::Width, + x, z, ItemTypeToString(BlockType[CheckType]).c_str(), - ItemTypeToString(Soil).c_str() + ItemTypeToString(Soil).c_str(), + Meta ); - // Place a randomly-facing produce: - UnboundedRelFastSetBlock(a_RelX + x, a_RelY, a_RelZ + z, ProduceType, (NIBBLETYPE)(a_TickRandom.randInt(4) % 4)); + VERIFY(UnboundedRelFastSetBlock(a_RelX + x, a_RelY, a_RelZ + z, ProduceType, Meta)); break; } } diff --git a/src/Items/ItemDye.h b/src/Items/ItemDye.h index 273af826a..c2635bcb6 100644 --- a/src/Items/ItemDye.h +++ b/src/Items/ItemDye.h @@ -27,7 +27,7 @@ public: ) override { // Handle growing the plants: - if (a_Item.m_ItemDamage == E_META_DYE_WHITE) + if ((a_Item.m_ItemDamage == E_META_DYE_WHITE) && (a_BlockFace != BLOCK_FACE_NONE)) { if (a_World->GrowRipePlant(a_BlockX, a_BlockY, a_BlockZ, true)) { |