From dfc0f6188d798a2466b07a6858de6bbbe3e1424c Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Wed, 2 Jan 2019 21:54:09 -0500 Subject: [PATCH] Flowers and mushrooms cannot exist if there is nothing below them --- src/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index e419216..d734afd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -773,6 +773,15 @@ int main(int argc, char** argv) the_accessor->set_id_safe(px, py, pz, id_water); } + // Flowers and mushrooms cannot exist if there is + // nothing below them. + + block_id plant_above = the_world->get_id_safe(px, py - 1, pz); + + if (plant_above == id_dandelion || plant_above == id_rose || plant_above == id_red_mushroom || plant_above == id_brown_mushroom) + { + the_world->set_id_safe(px, py - 1, pz, id_air); + } block_timer = 10; break;