From b90aabec80b427f84d0bf2da2fae9bcdfceb10ec Mon Sep 17 00:00:00 2001 From: paramat Date: Wed, 10 May 2017 08:23:26 +0100 Subject: [PATCH] Rainforest: Add emergent jungle tree and sapling Height 20 to 32 nodes. Dependent on chunksize >= 5. Base limited to maximum altitude y = 32. Craft sapling from 9 jungle saplings. --- mods/default/README.txt | 1 + mods/default/crafting.lua | 19 +++++++++ mods/default/mapgen.lua | 28 ++++++++++++++ mods/default/nodes.lua | 36 ++++++++++++++++++ .../schematics/emergent_jungle_tree.mts | Bin 0 -> 504 bytes .../emergent_jungle_tree_from_sapling.mts | Bin 0 -> 497 bytes .../default_emergent_jungle_sapling.png | Bin 0 -> 190 bytes mods/default/trees.lua | 14 +++++++ 8 files changed, 98 insertions(+) create mode 100644 mods/default/schematics/emergent_jungle_tree.mts create mode 100644 mods/default/schematics/emergent_jungle_tree_from_sapling.mts create mode 100644 mods/default/textures/default_emergent_jungle_sapling.png diff --git a/mods/default/README.txt b/mods/default/README.txt index 3861edd..cd4e768 100644 --- a/mods/default/README.txt +++ b/mods/default/README.txt @@ -115,6 +115,7 @@ paramat (CC BY-SA 3.0): default_silver_sandstone_block.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0) default_bookshelf_slot.png -- Derived from a texture by Gambit (CC-BY-SA 3.0) default_marram_grass_*.png -- Derived from textures by TumeniNodes (CC-BY-SA 3.0) + default_emergent_jungle_sapling.png TumeniNodes (CC BY-SA 3.0): default_desert_cobble.png -- Derived from a texture by brunob.santos (CC BY-SA 3.0) diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua index 847f188..428c0f4 100644 --- a/mods/default/crafting.lua +++ b/mods/default/crafting.lua @@ -763,14 +763,26 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "default:emergent_jungle_sapling", + recipe = { + {"default:junglesapling", "default:junglesapling", "default:junglesapling"}, + {"default:junglesapling", "default:junglesapling", "default:junglesapling"}, + {"default:junglesapling", "default:junglesapling", "default:junglesapling"}, + } +}) + + -- -- Crafting (tool repair) -- + minetest.register_craft({ type = "toolrepair", additional_wear = -0.02, }) + -- -- Cooking recipes -- @@ -849,6 +861,7 @@ minetest.register_craft({ cooktime = 5, }) + -- -- Fuels -- @@ -964,6 +977,12 @@ minetest.register_craft({ burntime = 6, }) +minetest.register_craft({ + type = "fuel", + recipe = "default:emergent_jungle_sapling", + burntime = 7, +}) + minetest.register_craft({ type = "fuel", diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index 243d1ed..e3684c0 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -1705,6 +1705,34 @@ function default.register_decorations() rotation = "random", }) + -- Emergent jungle tree + -- Due to 32 node height, altitude is limited and prescence depends on chunksize + + local chunksize = tonumber(minetest.get_mapgen_setting("chunksize")) + if chunksize >= 5 then + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:dirt_with_rainforest_litter"}, + sidelen = 80, + noise_params = { + offset = 0.0, + scale = 0.0025, + spread = {x = 250, y = 250, z = 250}, + seed = 2685, + octaves = 3, + persist = 0.7 + }, + biomes = {"rainforest"}, + y_min = 1, + y_max = 32, + schematic = minetest.get_modpath("default") .. + "/schematics/emergent_jungle_tree.mts", + flags = "place_center_x, place_center_z", + rotation = "random", + place_offset_y = -4, + }) + end + -- Jungle tree and log minetest.register_decoration({ diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index a2ce299..3de6f2e 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -80,6 +80,7 @@ default:jungletree default:junglewood default:jungleleaves default:junglesapling +default:emergent_jungle_sapling default:pine_tree default:pine_wood @@ -775,6 +776,41 @@ minetest.register_node("default:junglesapling", { end, }) +minetest.register_node("default:emergent_jungle_sapling", { + description = "Emergent Jungle Tree Sapling", + drawtype = "plantlike", + tiles = {"default_emergent_jungle_sapling.png"}, + inventory_image = "default_emergent_jungle_sapling.png", + wield_image = "default_emergent_jungle_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:emergent_jungle_sapling", + -- minp, maxp to be checked, relative to sapling pos + {x = -3, y = -5, z = -3}, + {x = 3, y = 31, z = 3}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, +}) + minetest.register_node("default:pine_tree", { description = "Pine Tree", diff --git a/mods/default/schematics/emergent_jungle_tree.mts b/mods/default/schematics/emergent_jungle_tree.mts new file mode 100644 index 0000000000000000000000000000000000000000..b526430950f44afb3c793bf99d9346a49ed4063c GIT binary patch literal 504 zcmeYb3HD`RVPI!aWniyI2KGn*S)75HfjKd=h(RbNH7&6;r^G6&G%r0TwWKIDl|ckm zEGIRwEVZ~|&f9Qqp(6r3OT~+q$Q-;VbN1I1A+M;k+jGB`xvA8K*u5}vV>|z=l-1u%eDO2{rtR3^q z?bd8u^MA>+#ii%I{1V)~r!ScIIiK-m%X8@q_vU+F+xb?iTk2f-YOZ&WbbtQdCbsJ7 zKb?hM$L_a(u3KOuc`edl-O}Idx0zdZWh6}dEqi>PYuR6(%11gsuD@>*+VXqvQMvgG z?bY7)*N9(e$oE+FZTAkb#ZuKZY_C?_{4XeRdEeRABB$6m6-I^&TQB%5b&c4;{w+{X zU`z3xAK9^aoJ(shuIwpj(2LR3F$qo-+{c<3#kpYV6e))&haQ*9<+WN2 zV`-|J^4(W^Hi@Tx(37xLUL10a(|kF@^JQP>O5RWAh`D`?=YQUD*K!RrmAi$9e(LR6 zEYQW+`hYdGp*1>ilJDN>tJhDz%W-i=_=&$-6`yoER=oLs=Zj-~piCsFcIPj9_k@KW0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