From: paramat Date: Wed, 10 May 2017 07:23:26 +0000 (+0100) Subject: Rainforest: Add emergent jungle tree and sapling X-Git-Tag: 5.0.0~112 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b90aabec80b427f84d0bf2da2fae9bcdfceb10ec;p=oweals%2Fminetest_game.git 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. --- diff --git a/mods/default/README.txt b/mods/default/README.txt index 3861eddd..cd4e768c 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 847f188f..428c0f45 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 243d1ed7..e3684c00 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 a2ce2993..3de6f2e4 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 00000000..b5264309 Binary files /dev/null and b/mods/default/schematics/emergent_jungle_tree.mts differ diff --git a/mods/default/schematics/emergent_jungle_tree_from_sapling.mts b/mods/default/schematics/emergent_jungle_tree_from_sapling.mts new file mode 100644 index 00000000..cb4e4e9e Binary files /dev/null and b/mods/default/schematics/emergent_jungle_tree_from_sapling.mts differ diff --git a/mods/default/textures/default_emergent_jungle_sapling.png b/mods/default/textures/default_emergent_jungle_sapling.png new file mode 100644 index 00000000..b363b3cc Binary files /dev/null and b/mods/default/textures/default_emergent_jungle_sapling.png differ diff --git a/mods/default/trees.lua b/mods/default/trees.lua index 2934330d..f5ee8ca3 100644 --- a/mods/default/trees.lua +++ b/mods/default/trees.lua @@ -85,6 +85,10 @@ function default.grow_sapling(pos) minetest.log("action", "An acacia bush sapling grows into a bush at ".. minetest.pos_to_string(pos)) default.grow_acacia_bush(pos) + elseif node.name == "default:emergent_jungle_sapling" then + minetest.log("action", "An emergent jungle sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + default.grow_new_emergent_jungle_tree(pos) end end @@ -394,6 +398,16 @@ function default.grow_new_jungle_tree(pos) end +-- New emergent jungle tree + +function default.grow_new_emergent_jungle_tree(pos) + local path = minetest.get_modpath("default") .. + "/schematics/emergent_jungle_tree_from_sapling.mts" + minetest.place_schematic({x = pos.x - 3, y = pos.y - 5, z = pos.z - 3}, + path, "random", nil, false) +end + + -- New pine tree function default.grow_new_pine_tree(pos)