Skip to content

Commit 9318c71

Browse files
TumeniNodesparamat
authored andcommitted
Biomes: Add pine bush to taiga and snowy grassland
Replaces 'bush' in snowy grassland.
1 parent d4b0b73 commit 9318c71

File tree

9 files changed

+142
-2
lines changed

9 files changed

+142
-2
lines changed

game_api.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,9 @@ Trees
918918

919919
* `default.grow_acacia_bush(pos)`
920920
* Grows an acaia bush at pos
921+
922+
* `default.grow_pine_bush(pos)`
923+
* Grows a pine bush at pos
921924

922925
Carts
923926
-----

mods/default/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ paramat (CC BY-SA 3.0):
7979
default_acacia_leaves_simple.png
8080
default_acacia_sapling.png
8181
default_acacia_bush_sapling.png
82+
default_pine_bush_sapling.png
8283
default_acacia_tree.png
8384
default_acacia_tree_top.png
8485
default_acacia_wood.png
8586
default_acacia_bush_stem.png
8687
default_bush_stem.png
88+
default_pine_bush_stem.png
8789
default_junglewood.png
8890
default_jungletree_top.png
8991
default_sandstone_brick.png

mods/default/crafting.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ minetest.register_craft({
4949
}
5050
})
5151

52+
minetest.register_craft({
53+
output = "default:pine_wood",
54+
recipe = {
55+
{"default:pine_bush_stem"},
56+
}
57+
})
58+
5259
minetest.register_craft({
5360
output = 'default:stick 4',
5461
recipe = {
@@ -953,6 +960,12 @@ minetest.register_craft({
953960
burntime = 4,
954961
})
955962

963+
minetest.register_craft({
964+
type = "fuel",
965+
recipe = "default:pine_bush_sapling",
966+
burntime = 2,
967+
})
968+
956969
minetest.register_craft({
957970
type = "fuel",
958971
recipe = "default:aspen_sapling",
@@ -1058,6 +1071,12 @@ minetest.register_craft({
10581071
burntime = 8,
10591072
})
10601073

1074+
minetest.register_craft({
1075+
type = "fuel",
1076+
recipe = "default:pine_bush_stem",
1077+
burntime = 6,
1078+
})
1079+
10611080
minetest.register_craft({
10621081
type = "fuel",
10631082
recipe = "default:junglegrass",

mods/default/mapgen.lua

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ function default.register_decorations()
19461946
minetest.register_decoration({
19471947
name = "default:bush",
19481948
deco_type = "schematic",
1949-
place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
1949+
place_on = {"default:dirt_with_grass"},
19501950
sidelen = 16,
19511951
noise_params = {
19521952
offset = -0.004,
@@ -1956,7 +1956,7 @@ function default.register_decorations()
19561956
octaves = 3,
19571957
persist = 0.7,
19581958
},
1959-
biomes = {"snowy_grassland", "grassland", "deciduous_forest",
1959+
biomes = {"grassland", "deciduous_forest",
19601960
"floatland_grassland"},
19611961
y_max = 31000,
19621962
y_min = 1,
@@ -1986,6 +1986,28 @@ function default.register_decorations()
19861986
flags = "place_center_x, place_center_z",
19871987
})
19881988

1989+
-- Pine bush
1990+
1991+
minetest.register_decoration({
1992+
name = "default:pine_bush",
1993+
deco_type = "schematic",
1994+
place_on = {"default:dirt_with_snow"},
1995+
sidelen = 16,
1996+
noise_params = {
1997+
offset = -0.004,
1998+
scale = 0.01,
1999+
spread = {x = 100, y = 100, z = 100},
2000+
seed = 137,
2001+
octaves = 3,
2002+
persist = 0.7,
2003+
},
2004+
biomes = {"taiga", "snowy_grassland"},
2005+
y_max = 31000,
2006+
y_min = 4,
2007+
schematic = minetest.get_modpath("default") .. "/schematics/pine_bush.mts",
2008+
flags = "place_center_x, place_center_z",
2009+
})
2010+
19892011
-- Grasses
19902012

19912013
register_grass_decoration(-0.03, 0.09, 5)

mods/default/nodes.lua

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ default:bush_sapling
162162
default:acacia_bush_stem
163163
default:acacia_bush_leaves
164164
default:acacia_bush_sapling
165+
default:pine_bush_stem
166+
default:pine_bush_needles
167+
default:pine_bush_sapling
165168
166169
default:sand_with_kelp
167170
@@ -1681,6 +1684,77 @@ minetest.register_node("default:acacia_bush_sapling", {
16811684
end,
16821685
})
16831686

1687+
minetest.register_node("default:pine_bush_stem", {
1688+
description = "Pine Bush Stem",
1689+
drawtype = "plantlike",
1690+
visual_scale = 1.41,
1691+
tiles = {"default_pine_bush_stem.png"},
1692+
inventory_image = "default_pine_bush_stem.png",
1693+
wield_image = "default_pine_bush_stem.png",
1694+
paramtype = "light",
1695+
sunlight_propagates = true,
1696+
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1697+
sounds = default.node_sound_wood_defaults(),
1698+
selection_box = {
1699+
type = "fixed",
1700+
fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
1701+
},
1702+
})
1703+
1704+
minetest.register_node("default:pine_bush_needles", {
1705+
description = "Pine Bush Needles",
1706+
drawtype = "allfaces_optional",
1707+
waving = 1,
1708+
tiles = {"default_pine_needles.png"},
1709+
paramtype = "light",
1710+
groups = {snappy = 3, flammable = 2, leaves = 1},
1711+
drop = {
1712+
max_items = 1,
1713+
items = {
1714+
{items = {"default:pine_bush_sapling"}, rarity = 5},
1715+
{items = {"default:pine_bush_needles"}}
1716+
}
1717+
},
1718+
sounds = default.node_sound_leaves_defaults(),
1719+
1720+
after_place_node = default.after_place_leaves,
1721+
})
1722+
1723+
minetest.register_node("default:pine_bush_sapling", {
1724+
description = "Pine Bush Sapling",
1725+
drawtype = "plantlike",
1726+
tiles = {"default_pine_bush_sapling.png"},
1727+
inventory_image = "default_pine_bush_sapling.png",
1728+
wield_image = "default_pine_bush_sapling.png",
1729+
paramtype = "light",
1730+
sunlight_propagates = true,
1731+
walkable = false,
1732+
on_timer = default.grow_sapling,
1733+
selection_box = {
1734+
type = "fixed",
1735+
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
1736+
},
1737+
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
1738+
attached_node = 1, sapling = 1},
1739+
sounds = default.node_sound_leaves_defaults(),
1740+
1741+
on_construct = function(pos)
1742+
minetest.get_node_timer(pos):start(math.random(300, 1500))
1743+
end,
1744+
1745+
on_place = function(itemstack, placer, pointed_thing)
1746+
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1747+
"default:pine_bush_sapling",
1748+
-- minp, maxp to be checked, relative to sapling pos
1749+
{x = -1, y = 0, z = -1},
1750+
{x = 1, y = 1, z = 1},
1751+
-- maximum interval of interior volume check
1752+
2)
1753+
1754+
return itemstack
1755+
end,
1756+
})
1757+
16841758
minetest.register_node("default:sand_with_kelp", {
16851759
description = "Kelp",
16861760
drawtype = "plantlike_rooted",
@@ -2532,3 +2606,9 @@ default.register_leafdecay({
25322606
leaves = {"default:acacia_bush_leaves"},
25332607
radius = 1,
25342608
})
2609+
2610+
default.register_leafdecay({
2611+
trunks = {"default:pine_bush_stem"},
2612+
leaves = {"default:pine_bush_needles"},
2613+
radius = 1,
2614+
})
111 Bytes
Binary file not shown.
166 Bytes
Loading
280 Bytes
Loading

mods/default/trees.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ function default.grow_sapling(pos)
8585
minetest.log("action", "An acacia bush sapling grows into a bush at "..
8686
minetest.pos_to_string(pos))
8787
default.grow_acacia_bush(pos)
88+
elseif node.name == "default:pine_bush_sapling" then
89+
minetest.log("action", "A pine bush sapling grows into a bush at "..
90+
minetest.pos_to_string(pos))
91+
default.grow_pine_bush(pos)
8892
elseif node.name == "default:emergent_jungle_sapling" then
8993
minetest.log("action", "An emergent jungle sapling grows into a tree at "..
9094
minetest.pos_to_string(pos))
@@ -483,6 +487,16 @@ function default.grow_acacia_bush(pos)
483487
end
484488

485489

490+
-- Pine bush
491+
492+
function default.grow_pine_bush(pos)
493+
local path = minetest.get_modpath("default") ..
494+
"/schematics/pine_bush.mts"
495+
minetest.place_schematic({x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
496+
path, "0", nil, false)
497+
end
498+
499+
486500
--
487501
-- Sapling 'on place' function to check protection of node and resulting tree volume
488502
--

0 commit comments

Comments
 (0)