From 6ee9507418fe11e38c82e4e1a7271d2f8a43ba41 Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Fri, 4 Jan 2019 16:05:03 -0500 Subject: [PATCH] id_oak_sapling and id_birch_sapling can only be placed on id_grass or id_dirt --- src/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index a3109e9..9e60b67 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -777,6 +777,21 @@ int main(int argc, char** argv) block_timer = 10; } } + else if (place_id == id_oak_sapling || place_id == id_birch_sapling) + { + // Can only place id_oak_sapling and + // id_birch_sapling on id_grass or + // id_dirt. + + block_id sapling_below = the_world->get_id_safe(px, py + 1, pz); + + if (sapling_below == id_grass || sapling_below == id_dirt) + { + the_accessor->set_id_safe(px, py, pz, place_id); + + block_timer = 10; + } + } else if (place_id == id_reeds) { // Can only place id_reeds on id_sand or