mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
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.
This commit is contained in:
parent
495fa32873
commit
b90aabec80
@ -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)
|
||||
|
@ -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",
|
||||
|
@ -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({
|
||||
|
@ -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",
|
||||
|
BIN
mods/default/schematics/emergent_jungle_tree.mts
Normal file
BIN
mods/default/schematics/emergent_jungle_tree.mts
Normal file
Binary file not shown.
BIN
mods/default/schematics/emergent_jungle_tree_from_sapling.mts
Normal file
BIN
mods/default/schematics/emergent_jungle_tree_from_sapling.mts
Normal file
Binary file not shown.
BIN
mods/default/textures/default_emergent_jungle_sapling.png
Normal file
BIN
mods/default/textures/default_emergent_jungle_sapling.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 190 B |
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user