45 Commits

Author SHA1 Message Date
079a5c1ff8 Merge remote-tracking branch 'upstream/master' 2022-08-26 15:23:42 +02:00
ca2b47492e Merge pull request #28 from Niklp09/mushroom
overwrite wield_image's of mushrooms
2022-08-19 15:06:41 +02:00
f5490e3b58 overwrite wield_images's 2022-08-19 14:53:39 +02:00
156d31280a Merge remote-tracking branch 'upstream/master' 2022-06-25 16:53:46 +02:00
bde2082ee1 Texture update for vines to CC0 (#21)
* Texture update for vines to CC0

recreated the vines and rope textures and releasing them under CC0

* Minor tweaks to textures
2022-06-24 14:32:09 +03:00
d33907ca75 Fix typo in crafting recipes in trunks
Fixes #24 
Co-authored-by: A S Lewis <aslewis@cpan.org>
2022-06-08 22:03:52 +10:00
244d5da0e2 wear too when breaking vines (#22) 2022-05-28 17:35:42 -04:00
183c043066 Merge remote-tracking branch 'upstream/master' 2022-05-27 18:49:45 +02:00
8de8b889c2 fix typo in bushes mod.conf
fixes #17
2022-05-09 23:10:56 +10:00
1d71e2c64e fix https://github.com/mt-mods/plantlife_modpack/issues/16 2022-03-19 17:04:06 -04:00
3239650e68 Merge remote-tracking branch 'upstream/master' 2022-03-06 16:17:20 +01:00
d3edfbeace Merge pull request #14 from nixnoxus/fix_tree_fern_leave_big
fix felling `farns:fern_trunk_big`
2022-01-11 22:19:26 -05:00
c82ba38e68 Merge pull request #15 from nixnoxus/add_group_sapling
Add `group:sapling` for saplings in plantlife
2022-01-11 17:18:14 -05:00
031d5f4e4e add group sapling 2022-01-11 18:55:22 +01:00
32bab30e1f fix felling farns: fern_trunk_big 2022-01-10 19:32:04 +01:00
7094d8a369 Vines: Fix recipes and global variables (#13) 2021-12-28 14:45:05 +11:00
c990942ba2 fix https://github.com/mt-mods/plantlife_modpack/issues/11 2021-12-25 21:44:43 -05:00
4953b1ba54 Rarity / fertility tweaks for various mods (#8)
For bushes, molehills and youngtrees:
Changes to rarity and minimum fertility. Also added use of rarity_fertility. Result is more balanced and less homogeneous, i.e. over a large area you'll see variation.

For vines, some further tweaks to rarity, and using tries field to improve vines distribution.
2021-12-24 09:31:30 +01:00
cb2373f089 Trunks: Prevent crashing when unknown nodes exist (#9)
Extension of commit 9ed4771515

Co-authored-by: OgelGames <olliverdc28@gmail.com>
2021-12-16 20:10:36 +11:00
1a96ac87a7 Breaking up flowers_plus mod (#5)
Splitting up flowers_plus into separate mods for seaweed, sunflowers and waterlillies, for clarity and so the user can disable them individually.
Fixed sunflower maximum heat.
Removed spawning, as we're already creating these things at worldgen.
Added settings for rarity and max count to each mod - waterlilies, seaweed and sunflowers
Removing along_shore mod as it does nothing now.
2021-12-14 13:05:23 +01:00
a6dc4890d9 Vines: Fixed humidity, and set temperature. Also fixed a couple of issues with spawning: Roots are meant to spawn under dirt blocks, also vines were appearing on the side of snow. 2021-12-11 19:45:25 +01:00
a5b752f8b2 Merge pull request #3 from JordanL2/vines_mapgen
Vines overhaul
2021-12-07 17:21:17 -05:00
4c48e5be29 Update vines/init.lua
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2021-12-07 22:19:57 +00:00
a7d0e42cd1 Update vines/init.lua
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2021-12-07 22:19:49 +00:00
2e4e4a2412 Replace vines with air if they've been disabled for compatibility 2021-12-06 10:56:05 +00:00
1d3751d755 Avoid one node vines on top of trees. 2021-12-06 10:55:42 +00:00
e2486ca7f5 Adding default to boolean settings 2021-12-06 09:33:44 +00:00
98f0c6c20f Slight simplification of on_dig. Also minor fix to generating vines of a certain length. 2021-12-05 11:41:49 +00:00
54d3b669be Vines: Simplifying digging logic. 2021-12-05 11:08:51 +00:00
93265656cc Adding vine growth speed settings 2021-12-04 20:28:11 +00:00
c76fd45a2c Option to disable vines:vines item, as it seems pointless.
All recipes allow the vines group, so any vine end item will work.
2021-12-04 20:17:44 +00:00
c7d0fd3c53 Cutting vines with shears now gives the player the vine ends, so they can make their own vine farm 2021-12-04 18:53:39 +00:00
a66b82f1f0 Fixing growth. Vines now grow once every 3-6 minutes. 2021-12-04 17:56:28 +00:00
63914caed1 Removing attached_node from vine groups, as it was causing breaking one vine to break the vine all the way up to the top, instantly 2021-12-04 17:56:28 +00:00
ba98359dd0 When a vine is destroyed, ensure the remaining part of the vine ends with a vine end node. 2021-12-04 17:56:28 +00:00
6df36da4e1 Settings to disable any type of vine and vine rope. Settings to adjust rarity of vines. 2021-12-04 17:55:49 +00:00
28ef3e0c4b Vines now generated at mapgen time. Vines now generated as a vine of random length. 2021-12-04 17:55:08 +00:00
6bdb533906 Fix trunk duplication 2021-08-24 12:15:54 +02:00
c62610f544 Try to fix crash 2021-08-18 16:20:56 +02:00
8e2148ffc3 Merge remote-tracking branch 'upstream/master' 2021-07-24 13:12:23 +02:00
680b02f7e2 fix crash for sure this time 2021-07-19 23:56:47 -04:00
a2976c609a update all generate, spawn, and grow calls
to use "." instead of ":" notation
(quells all those "deprecated" warnings)
2021-07-19 14:18:01 -04:00
46717958bc use biome_lib.get_nodedef_field
instead of biome_lib:get_nodedef_field
(change `.` to `:`)
2021-07-19 14:08:57 -04:00
5ac025cda4 Merge remote-tracking branch 'upstream/master' 2021-07-03 17:29:19 +02:00
52b2d18523 make moss buildable_to
and make sunflower attached_node like other plants
2021-06-29 13:44:00 -04:00
110 changed files with 1249 additions and 1085 deletions

View File

@ -10,7 +10,8 @@ minetest.override_item("flowers:mushroom_fertile_brown", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}, },
inventory_image = "3dmushrooms_brown_inv.png" inventory_image = "3dmushrooms_brown_inv.png",
wield_image = "3dmushrooms_brown_inv.png"
}) })
minetest.override_item("flowers:mushroom_brown", { minetest.override_item("flowers:mushroom_brown", {
@ -21,7 +22,8 @@ minetest.override_item("flowers:mushroom_brown", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}, },
inventory_image = "3dmushrooms_brown_inv.png" inventory_image = "3dmushrooms_brown_inv.png",
wield_image = "3dmushrooms_brown_inv.png"
}) })
minetest.override_item("flowers:mushroom_fertile_red", { minetest.override_item("flowers:mushroom_fertile_red", {
@ -32,7 +34,8 @@ minetest.override_item("flowers:mushroom_fertile_red", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}, },
inventory_image = "3dmushrooms_red_inv.png" inventory_image = "3dmushrooms_red_inv.png",
wield_image = "3dmushrooms_red_inv.png"
}) })
minetest.override_item("flowers:mushroom_red", { minetest.override_item("flowers:mushroom_red", {
@ -43,7 +46,8 @@ minetest.override_item("flowers:mushroom_red", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}, },
inventory_image = "3dmushrooms_red_inv.png" inventory_image = "3dmushrooms_red_inv.png",
wield_image = "3dmushrooms_red_inv.png"
}) })
-- aliases to the default mushrooms -- aliases to the default mushrooms

View File

@ -1,9 +0,0 @@
-----------------------------------------------------------------------------------------------
local title = "Along the Shore"
local version = "0.0.4"
local mname = "along_shore"
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
-----------------------------------------------------------------------------------------------

View File

@ -1,3 +0,0 @@
name = along_shore
depends = default, biome_lib
optional_depends = flowers_plus

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

View File

@ -1,30 +0,0 @@
-------------------------------------------------------------
Credit for textures of "along_shore"
-------------------------------------------------------------
(If more than one author is listed the names are in alphabetical order)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOLDER TEXTURE AUTHORS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
../along_shore/textures along_shore_seaweed_1Darker.png Neuromancer, VanessaE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
../along_shore/textures/old (along_shore_empty.png) (Mossmanikin)
along_shore_lilypads_1.png Mossmanikin, Neuromancer
along_shore_lilypads_2.png Mossmanikin, Neuromancer
along_shore_lilypads_3.png Mossmanikin, Neuromancer
along_shore_lilypads_4.png Mossmanikin, Neuromancer
along_shore_pondscum_1.png Neuromancer
along_shore_seaweed_1.png Neuromancer, VanessaE
along_shore_seaweed_2.png Mossmanikin, Neuromancer, VanessaE
along_shore_seaweed_3.png Mossmanikin, Neuromancer, VanessaE
along_shore_seaweed_4.png Mossmanikin, Neuromancer, VanessaE
flowers_seaweed.png Neuromancer, VanessaE
flowers_waterlily.png Mossmanikin, VanessaE
flowers_waterlily_22.5.png Mossmanikin, VanessaE
flowers_waterlily_45.png Mossmanikin, VanessaE
flowers_waterlily_67.5.png Mossmanikin, VanessaE
lillypad3Flower16x.png Neuromancer
LillyPad3x16.png Neuromancer
lillyPad5x16.png Neuromancer
MultiLilly16x.png Neuromancer
pondscum16xc.png Neuromancer
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

View File

@ -10,30 +10,39 @@ local random = math.random
-- support for i18n -- support for i18n
local S = minetest.get_translator("bushes") local S = minetest.get_translator("bushes")
abstract_bushes = {} abstract_bushes = {}
minetest.register_node("bushes:youngtree2_bottom", { local bushes_bush_rarity = tonumber(minetest.settings:get("bushes_bush_rarity")) or 99.9
local bushes_bush_rarity_fertility = tonumber(minetest.settings:get("bushes_bush_rarity_fertility")) or 1.5
local bushes_bush_fertility = tonumber(minetest.settings:get("bushes_bush_fertility")) or -1
local bushes_youngtrees_rarity = tonumber(minetest.settings:get("bushes_youngtrees_rarity")) or 100
local bushes_youngtrees_rarity_fertility = tonumber(minetest.settings:get("bushes_youngtrees_rarity_fertility")) or 0.6
local bushes_youngtrees_fertility = tonumber(minetest.settings:get("bushes_youngtrees_fertility")) or -0.5
minetest.register_node("bushes:youngtree2_bottom", {
description = S("Young Tree 2 (bottom)"), description = S("Young Tree 2 (bottom)"),
drawtype="nodebox", drawtype="nodebox",
tiles = {"bushes_youngtree2trunk.png"}, tiles = {"bushes_youngtree2trunk.png"},
inventory_image = "bushes_youngtree2trunk_inv.png", inventory_image = "bushes_youngtree2trunk_inv.png",
wield_image = "bushes_youngtree2trunk_inv.png", wield_image = "bushes_youngtree2trunk_inv.png",
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
is_ground_content = true, is_ground_content = true,
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
--{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000}, --NodeBox 1 --{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000}, --NodeBox 1
{-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1 {-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1
} }
}, },
groups = {snappy=3,flammable=2,attached_node=1}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'default:stick' drop = 'default:stick'
}) })
local BushBranchCenter = { {1,1}, {3,2} } local BushBranchCenter = { {1,1}, {3,2} }
for i in pairs(BushBranchCenter) do for i in pairs(BushBranchCenter) do
local Num = BushBranchCenter[i][1] local Num = BushBranchCenter[i][1]
local TexNum = BushBranchCenter[i][2] local TexNum = BushBranchCenter[i][2]
@ -57,8 +66,8 @@ for i in pairs(BushBranchCenter) do
}, },
inventory_image = "bushes_branches_center_"..TexNum..".png", inventory_image = "bushes_branches_center_"..TexNum..".png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
groups = { groups = {
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks -- tree=1, -- MM: disabled because some recipes use group:tree for trunks
snappy=3, snappy=3,
@ -83,16 +92,16 @@ for i in pairs(BushBranchSide) do
--[[bottom]]"bushes_branches_center_"..TexNum..".png", --[[bottom]]"bushes_branches_center_"..TexNum..".png",
--[[right]] "bushes_branches_left_"..TexNum..".png", --[[right]] "bushes_branches_left_"..TexNum..".png",
--[[left]] "bushes_branches_right_"..TexNum..".png", -- MM: We could also mirror the previous here, --[[left]] "bushes_branches_right_"..TexNum..".png", -- MM: We could also mirror the previous here,
--[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different --[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different
--[[front]] "bushes_branches_right_"..TexNum..".png" --[[front]] "bushes_branches_right_"..TexNum..".png"
}, },
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
-- { left , bottom , front, right , top , back } -- { left , bottom , front, right , top , back }
{0.137748,-0.491944, 0.5 ,-0.125000,-0.179444,-0.007790}, --NodeBox 1 {0.137748,-0.491944, 0.5 ,-0.125000,-0.179444,-0.007790}, --NodeBox 1
{0.262748,-0.185995, 0.5 ,-0.237252, 0.126505,-0.260269}, --NodeBox 2 {0.262748,-0.185995, 0.5 ,-0.237252, 0.126505,-0.260269}, --NodeBox 2
{0.500000, 0.125000, 0.5 ,-0.500000, 0.500000,-0.500000}, --NodeBox 3 {0.500000, 0.125000, 0.5 ,-0.500000, 0.500000,-0.500000}, --NodeBox 3
}, },
}, },
selection_box = { selection_box = {
@ -101,8 +110,8 @@ for i in pairs(BushBranchSide) do
}, },
inventory_image = "bushes_branches_right_"..TexNum..".png", inventory_image = "bushes_branches_right_"..TexNum..".png",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
groups = { groups = {
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks -- tree=1, -- MM: disabled because some recipes use group:tree for trunks
snappy=3, snappy=3,
@ -151,9 +160,8 @@ abstract_bushes.grow_bush = function(pos)
abstract_bushes.grow_bush_node(pos,5,leaf_type) abstract_bushes.grow_bush_node(pos,5,leaf_type)
end end
abstract_bushes.grow_bush_node = function(pos,dir, leaf_type) abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z} local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z}
@ -175,7 +183,7 @@ abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
dir = 1 dir = 1
end end
if minetest.get_node(right_here).name == "air" -- instead of check_air = true, if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then or minetest.get_node(right_here).name == "default:junglegrass" then
minetest.swap_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir}) minetest.swap_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir})
--minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")") --minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")")
@ -188,63 +196,61 @@ abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"sumpf:peat", "sumpf:peat",
"sumpf:sumpf" "sumpf:sumpf"
},
rarity = bushes_bush_rarity,
rarity_fertility = bushes_bush_rarity_fertility,
plantlife_limit = bushes_bush_fertility,
min_elevation = 1, -- above sea level
}, },
max_count = 15, --10,15 abstract_bushes.grow_bush
rarity = 101 - 4, --3,4
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
},
abstract_bushes.grow_bush
) )
abstract_bushes.grow_youngtree2 = function(pos) abstract_bushes.grow_youngtree2 = function(pos)
abstract_bushes.grow_youngtree_node2(pos, random(4,5)) abstract_bushes.grow_youngtree_node2(pos, random(4,5))
end end
abstract_bushes.grow_youngtree_node2 = function(pos, height) abstract_bushes.grow_youngtree_node2 = function(pos, height)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z} local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z}
local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z}
local three_above_right_here = {x=pos.x, y=pos.y+4, z=pos.z} local three_above_right_here = {x=pos.x, y=pos.y+4, z=pos.z}
if height == 4 and if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
(minetest.get_node(right_here).name == "air" -- instead of check_air = true, or minetest.get_node(right_here).name == "default:junglegrass" then
or minetest.get_node(right_here).name == "default:junglegrass") then if height == 4 then
local two_above_right_here_south = {x=pos.x, y=pos.y+3, z=pos.z-1} local two_above_right_here_south = {x=pos.x, y=pos.y+3, z=pos.z-1}
local three_above_right_here_south = {x=pos.x, y=pos.y+4, z=pos.z-1} local three_above_right_here_south = {x=pos.x, y=pos.y+4, z=pos.z-1}
minetest.swap_node(right_here, {name="bushes:youngtree2_bottom"}) minetest.swap_node(right_here, {name="bushes:youngtree2_bottom"})
minetest.swap_node(above_right_here, {name="bushes:youngtree2_bottom"}) minetest.swap_node(above_right_here, {name="bushes:youngtree2_bottom"})
minetest.swap_node(two_above_right_here, {name="bushes:bushbranches2" , param2=2}) minetest.swap_node(two_above_right_here, {name="bushes:bushbranches2" , param2=2})
minetest.swap_node(two_above_right_here_south, {name="bushes:bushbranches2" , param2=0}) minetest.swap_node(two_above_right_here_south, {name="bushes:bushbranches2" , param2=0})
minetest.swap_node(three_above_right_here, {name="bushes:BushLeaves1" }) minetest.swap_node(three_above_right_here, {name="bushes:BushLeaves1" })
minetest.swap_node(three_above_right_here_south, {name="bushes:BushLeaves1" }) minetest.swap_node(three_above_right_here_south, {name="bushes:BushLeaves1" })
end
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"sumpf:peat", "sumpf:peat",
"sumpf:sumpf" "sumpf:sumpf"
},
rarity = bushes_youngtrees_rarity,
rarity_fertility = bushes_youngtrees_rarity_fertility,
plantlife_limit = bushes_youngtrees_fertility,
min_elevation = 1, -- above sea level
}, },
max_count = 55, --10,15 abstract_bushes.grow_youngtree2
rarity = 101 - 4, --3,4
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
},
abstract_bushes.grow_youngtree2
) )
--http://dev.minetest.net/Node_Drawtypes
minetest.log("action", "[bushes] loaded.") minetest.log("action", "[bushes] loaded.")

View File

@ -1,3 +1,3 @@
name = bushes name = bushes
depends = default, biome_lib depends = default, biome_lib
optional_depends = stonage, sumpf optional_depends = stoneage, sumpf

17
bushes/settingtypes.txt Normal file
View File

@ -0,0 +1,17 @@
#Bush rarity %
bushes_bush_rarity (Bush rarity %) float 99.9 0 100
#How much the rarity is reduced by fertility %
bushes_bush_rarity_fertility (Bush rarity fertility reduction %) float 1.5 0 100
#Bush minimum fertility (-1 to +1)
bushes_bush_fertility (Bush minimum fertility) float -0.7 -1 1
#Youngtree (from bushes mod) rarity %
bushes_youngtrees_rarity (Youngtree bush rarity %) float 100 0 100
#How much the rarity is reduced by fertility %
bushes_youngtrees_rarity_fertility (Youngtree bush rarity fertility reduction %) float 0.6 0 100
#Youngtree (from bushes mod) minimum fertility (-1 to +1)
bushes_youngtrees_fertility (Youngtree bush minimum fertility) float -0.5 -1 1

View File

@ -30,7 +30,7 @@ local modpath = minetest.get_modpath('bushes_classic')
dofile(modpath..'/cooking.lua') dofile(modpath..'/cooking.lua')
dofile(modpath..'/nodes.lua') dofile(modpath..'/nodes.lua')
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = 3600, spawn_delay = 3600,
spawn_plants = bushes_classic.spawn_list, spawn_plants = bushes_classic.spawn_list,
avoid_radius = 10, avoid_radius = 10,

View File

@ -1,6 +1,6 @@
--Map Generation Stuff --Map Generation Stuff
biome_lib:register_generate_plant( biome_lib.register_on_generate(
{ {
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
@ -20,7 +20,7 @@ biome_lib:register_generate_plant(
} }
) )
biome_lib:register_generate_plant( biome_lib.register_on_generate(
{ {
surface = { surface = {
"default:desert_sand", "default:desert_sand",

View File

@ -95,7 +95,7 @@ minetest.register_node("dryplants:juncus_02", {
-- GENERATE SMALL JUNCUS -- GENERATE SMALL JUNCUS
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- near water or swamp -- near water or swamp
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
--"default:desert_sand", --"default:desert_sand",
@ -116,7 +116,7 @@ biome_lib:register_generate_plant({
abstract_dryplants.grow_juncus abstract_dryplants.grow_juncus
) )
-- at dunes/beach -- at dunes/beach
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
--"default:dirt_with_grass", --"default:dirt_with_grass",
--"default:desert_sand", --"default:desert_sand",

View File

@ -11,7 +11,7 @@ abstract_dryplants.grow_grass_variation = function(pos)
minetest.swap_node(pos, {name="dryplants:grass_short"}) minetest.swap_node(pos, {name="dryplants:grass_short"})
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
}, },

View File

@ -7,7 +7,7 @@
-- Looked at code from: default -- Looked at code from: default
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
biome_lib:register_generate_plant( biome_lib.register_on_generate(
{ {
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",

View File

@ -267,7 +267,8 @@ minetest.register_node("dryplants:reedmace_sapling", {
groups = { groups = {
snappy=3, snappy=3,
flammable=2, flammable=2,
attached_node=1 attached_node=1,
sapling=1,
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
@ -330,7 +331,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- SPAWN REEDMACE -- SPAWN REEDMACE
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
--[[biome_lib:spawn_on_surfaces({ --[[biome_lib.register_active_spawner({
spawn_delay = 1200, spawn_delay = 1200,
spawn_plants = {"dryplants:reedmace_sapling"}, spawn_plants = {"dryplants:reedmace_sapling"},
spawn_chance = 400, spawn_chance = 400,
@ -351,7 +352,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
-- GENERATE REEDMACE -- GENERATE REEDMACE
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- near water or swamp -- near water or swamp
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:desert_sand", "default:desert_sand",
@ -372,7 +373,7 @@ biome_lib:register_generate_plant({
abstract_dryplants.grow_reedmace abstract_dryplants.grow_reedmace
) )
-- in water -- in water
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt", "default:dirt",
"default:dirt_with_grass", "default:dirt_with_grass",
@ -395,7 +396,7 @@ biome_lib:register_generate_plant({
abstract_dryplants.grow_reedmace_water abstract_dryplants.grow_reedmace_water
) )
-- for oases & tropical beaches & tropical swamps -- for oases & tropical beaches & tropical swamps
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:sand", "default:sand",
"sumpf:sumpf" "sumpf:sumpf"

View File

@ -87,7 +87,7 @@ end
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if abstract_ferns.config.lady_ferns_near_tree == true then if abstract_ferns.config.lady_ferns_near_tree == true then
biome_lib:register_generate_plant({ -- near trees (woodlands) biome_lib.register_on_generate({ -- near trees (woodlands)
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
@ -116,7 +116,7 @@ if abstract_ferns.config.lady_ferns_near_tree == true then
end end
if abstract_ferns.config.lady_ferns_near_rock == true then if abstract_ferns.config.lady_ferns_near_rock == true then
biome_lib:register_generate_plant({ -- near stone (mountains) biome_lib.register_on_generate({ -- near stone (mountains)
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
@ -143,7 +143,7 @@ if abstract_ferns.config.lady_ferns_near_rock == true then
end end
if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a huge fps drop if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a huge fps drop
biome_lib:register_generate_plant({ -- near ores (potential mining sites) biome_lib.register_on_generate({ -- near ores (potential mining sites)
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
@ -183,7 +183,7 @@ if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a
end end
if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant as a replacement of Ferns_near_Ores if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant as a replacement of Ferns_near_Ores
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",

View File

@ -162,6 +162,14 @@ minetest.register_node("ferns:tree_fern_leave_big", {
}, },
drop = "", drop = "",
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
after_destruct = function(pos,oldnode)
for _, d in pairs({{x=-1,z=0},{x=1,z=0},{x=0,z=-1},{x=0,z=1}}) do
local node = minetest.get_node({x=pos.x+d.x,y=pos.y+1,z=pos.z+d.z})
if node.name == "ferns:tree_fern_leave_big" then
minetest.dig_node({x=pos.x+d.x,y=pos.y+1,z=pos.z+d.z})
end
end
end,
}) })
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
@ -274,7 +282,7 @@ minetest.register_node("ferns:sapling_giant_tree_fern", {
tiles = {"ferns_sapling_tree_fern_giant.png"}, tiles = {"ferns_sapling_tree_fern_giant.png"},
inventory_image = "ferns_sapling_tree_fern_giant.png", inventory_image = "ferns_sapling_tree_fern_giant.png",
walkable = false, walkable = false,
groups = {snappy=3,flammable=2,flora=1,attached_node=1}, groups = {snappy=3,flammable=2,flora=1,attached_node=1,sapling=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -298,7 +306,7 @@ minetest.register_abm({
-- in jungles -- in jungles
if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16 "default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
@ -324,7 +332,7 @@ end
-- for oases & tropical beaches -- for oases & tropical beaches
if abstract_ferns.config.enable_giant_treeferns_in_oases == true then if abstract_ferns.config.enable_giant_treeferns_in_oases == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:sand"--, "default:sand"--,
--"default:desert_sand" --"default:desert_sand"

View File

@ -75,7 +75,7 @@ create_nodes()
-- Spawning -- Spawning
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if abstract_ferns.config.enable_horsetails_spawning == true then if abstract_ferns.config.enable_horsetails_spawning == true then
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = 1200, spawn_delay = 1200,
spawn_plants = node_names, spawn_plants = node_names,
spawn_chance = 400, spawn_chance = 400,
@ -104,7 +104,7 @@ end
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if abstract_ferns.config.enable_horsetails_on_grass == true then if abstract_ferns.config.enable_horsetails_on_grass == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:dirt_with_coniferous_litter", -- minetest >= 0.5 "default:dirt_with_coniferous_litter", -- minetest >= 0.5
@ -137,7 +137,7 @@ if abstract_ferns.config.enable_horsetails_on_grass == true then
end end
if abstract_ferns.config.enable_horsetails_on_stones == true then if abstract_ferns.config.enable_horsetails_on_stones == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:gravel", -- roots go deep "default:gravel", -- roots go deep
"default:mossycobble", "default:mossycobble",

View File

@ -156,7 +156,7 @@ minetest.register_node("ferns:sapling_tree_fern", {
tiles = {"ferns_sapling_tree_fern.png"}, tiles = {"ferns_sapling_tree_fern.png"},
inventory_image = "ferns_sapling_tree_fern.png", inventory_image = "ferns_sapling_tree_fern.png",
walkable = false, walkable = false,
groups = {snappy=3,flammable=2,flora=1,attached_node=1}, groups = {snappy=3,flammable=2,flora=1,attached_node=1,sapling=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -179,7 +179,7 @@ minetest.register_abm({
-- in jungles -- in jungles
if abstract_ferns.config.enable_treeferns_in_jungle == true then if abstract_ferns.config.enable_treeferns_in_jungle == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16 "default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
@ -208,7 +208,7 @@ end
-- for oases & tropical beaches -- for oases & tropical beaches
if abstract_ferns.config.enable_treeferns_in_oases == true then if abstract_ferns.config.enable_treeferns_in_oases == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:sand"--, "default:sand"--,
--"default:desert_sand" --"default:desert_sand"

View File

@ -1,24 +0,0 @@
Changelog
---------
2012-08-06: Tweaked selection boxes on all nodes. Tweaked seaweed to use
signlike instead of raillike drawtype, (still forced to only spawn flat as
usual). Adjusted light level limits to give it more time to grow. Created
this changelog file using github commit messages as the basis. Shrunk the
geranium flower down a bit to better match the others.
2012-08-03: Tuned out the random-numbers-inside-ABM stuff. Uses the ABM's
chance setting instead. Should be approximately the same as before, but
hopefully using a tad less CPU. Minor tweak to ABM interval/growing delay.
2012-08-01: Added blue geranium to the collection of flowers.
2012-07-31: Disable debug by default.
2012-07-30: many updates over the course of the day - first commit, removed
some redundant files, added wield/inventory image entries for each item, to
force the game to draw them properly (these shouldn't be needed, must be a
bug). Tweaked spawn code so that the radius check also includes the name of
the item being spawned as well as items in group:flower, that way all items can
have a radius test, and not just those in group:flower. Fiddled with the spawn
rates a bit.

View File

@ -1,483 +0,0 @@
-- support for i18n
local S = minetest.get_translator("flowers_plus")
-- This file supplies a few additional plants and some related crafts
-- for the plantlife modpack. Last revision: 2013-04-24
local random = math.random
flowers_plus = {}
local SPAWN_DELAY = 1000
local SPAWN_CHANCE = 200
local flowers_seed_diff = 329
local lilies_max_count = 320
local lilies_rarity = 33
local seaweed_max_count = 320
local seaweed_rarity = 33
local sunflowers_max_count = 10
local sunflowers_rarity = 25
-- register the various rotations of waterlilies
local lilies_list = {
{ nil , nil , 1 },
{ "225", "22.5" , 2 },
{ "45" , "45" , 3 },
{ "675", "67.5" , 4 },
{ "s1" , "small_1" , 5 },
{ "s2" , "small_2" , 6 },
{ "s3" , "small_3" , 7 },
{ "s4" , "small_4" , 8 },
}
for i in ipairs(lilies_list) do
local deg1 = ""
local deg2 = ""
local lily_groups = {snappy = 3,flammable=2,flower=1}
if lilies_list[i][1] ~= nil then
deg1 = "_"..lilies_list[i][1]
deg2 = "_"..lilies_list[i][2]
lily_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 }
end
minetest.register_node(":flowers:waterlily"..deg1, {
description = S("Waterlily"),
drawtype = "nodebox",
tiles = {
"flowers_waterlily"..deg2..".png",
"flowers_waterlily"..deg2..".png^[transformFY"
},
inventory_image = "flowers_waterlily.png",
wield_image = "flowers_waterlily.png",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = lily_groups,
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.4, -0.5, -0.4, 0.4, -0.45, 0.4 },
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
},
buildable_to = true,
node_placement_prediction = "",
liquids_pointable = true,
drop = "flowers:waterlily",
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
local pt = pointed_thing
local place_pos = nil
local top_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local under_node = minetest.get_node(pt.under)
local above_node = minetest.get_node(pt.above)
local top_node = minetest.get_node(top_pos)
if biome_lib:get_nodedef_field(under_node.name, "buildable_to") then
if under_node.name ~= "default:water_source" then
place_pos = pt.under
elseif top_node.name ~= "default:water_source"
and biome_lib:get_nodedef_field(top_node.name, "buildable_to") then
place_pos = top_pos
else
return
end
elseif biome_lib:get_nodedef_field(above_node.name, "buildable_to") then
place_pos = pt.above
end
if place_pos and not minetest.is_protected(place_pos, placer:get_player_name()) then
local nodename = "default:cobble" -- if this block appears, something went....wrong :-)
if not keys["sneak"] then
local node = minetest.get_node(pt.under)
local waterlily = random(1,8)
if waterlily == 1 then
nodename = "flowers:waterlily"
elseif waterlily == 2 then
nodename = "flowers:waterlily_225"
elseif waterlily == 3 then
nodename = "flowers:waterlily_45"
elseif waterlily == 4 then
nodename = "flowers:waterlily_675"
elseif waterlily == 5 then
nodename = "flowers:waterlily_s1"
elseif waterlily == 6 then
nodename = "flowers:waterlily_s2"
elseif waterlily == 7 then
nodename = "flowers:waterlily_s3"
elseif waterlily == 8 then
nodename = "flowers:waterlily_s4"
end
minetest.swap_node(place_pos, {name = nodename, param2 = random(0,3) })
else
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
minetest.swap_node(place_pos, {name = "flowers:waterlily", param2 = fdir})
end
if not biome_lib.expect_infinite_stacks then
itemstack:take_item()
end
return itemstack
end
end,
})
end
local algae_list = { {nil}, {2}, {3}, {4} }
for i in ipairs(algae_list) do
local num = ""
local algae_groups = {snappy = 3,flammable=2,flower=1}
if algae_list[i][1] ~= nil then
num = "_"..algae_list[i][1]
algae_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 }
end
minetest.register_node(":flowers:seaweed"..num, {
description = S("Seaweed"),
drawtype = "nodebox",
tiles = {
"flowers_seaweed"..num..".png",
"flowers_seaweed"..num..".png^[transformFY"
},
inventory_image = "flowers_seaweed_2.png",
wield_image = "flowers_seaweed_2.png",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = algae_groups,
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.4, -0.5, -0.4, 0.4, -0.45, 0.4 },
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
},
buildable_to = true,
liquids_pointable = true,
drop = "flowers:seaweed",
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
local pt = pointed_thing
local place_pos = nil
local top_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local under_node = minetest.get_node(pt.under)
local above_node = minetest.get_node(pt.above)
local top_node = minetest.get_node(top_pos)
if biome_lib:get_nodedef_field(under_node.name, "buildable_to") then
if under_node.name ~= "default:water_source" then
place_pos = pt.under
elseif top_node.name ~= "default:water_source"
and biome_lib:get_nodedef_field(top_node.name, "buildable_to") then
place_pos = top_pos
else
return
end
elseif biome_lib:get_nodedef_field(above_node.name, "buildable_to") then
place_pos = pt.above
end
if not minetest.is_protected(place_pos, placer:get_player_name()) then
local nodename = "default:cobble" -- :D
if not keys["sneak"] then
--local node = minetest.get_node(pt.under)
local seaweed = random(1,4)
if seaweed == 1 then
nodename = "flowers:seaweed"
elseif seaweed == 2 then
nodename = "flowers:seaweed_2"
elseif seaweed == 3 then
nodename = "flowers:seaweed_3"
elseif seaweed == 4 then
nodename = "flowers:seaweed_4"
end
minetest.swap_node(place_pos, {name = nodename, param2 = random(0,3) })
else
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
minetest.swap_node(place_pos, {name = "flowers:seaweed", param2 = fdir})
end
if not biome_lib.expect_infinite_stacks then
itemstack:take_item()
end
return itemstack
end
end,
})
end
local box = {
type="fixed",
fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
}
local sunflower_drop = "farming:seed_wheat"
if minetest.registered_items["farming:seed_spelt"] then
sunflower_drop = "farming:seed_spelt"
end
minetest.register_node(":flowers:sunflower", {
description = S("Sunflower"),
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
inventory_image = "flowers_sunflower_inv.png",
mesh = "flowers_sunflower.obj",
tiles = { "flowers_sunflower.png" },
walkable = false,
buildable_to = true,
is_ground_content = true,
groups = { dig_immediate=3, flora=1, flammable=3 },
sounds = default.node_sound_leaves_defaults(),
selection_box = box,
collision_box = box,
drop = {
max_items = 1,
items = {
{items = {sunflower_drop}, rarity = 8},
{items = {"flowers:sunflower"}},
}
}
})
local extra_aliases = {
"waterlily",
"waterlily_225",
"waterlily_45",
"waterlily_675",
"seaweed"
}
for i in ipairs(extra_aliases) do
local flower = extra_aliases[i]
minetest.register_alias("flowers:flower_"..flower, "flowers:"..flower)
end
minetest.register_alias( "trunks:lilypad" , "flowers:waterlily_s1" )
minetest.register_alias( "along_shore:lilypads_1" , "flowers:waterlily_s1" )
minetest.register_alias( "along_shore:lilypads_2" , "flowers:waterlily_s2" )
minetest.register_alias( "along_shore:lilypads_3" , "flowers:waterlily_s3" )
minetest.register_alias( "along_shore:lilypads_4" , "flowers:waterlily_s4" )
minetest.register_alias( "along_shore:pondscum_1" , "flowers:seaweed" )
minetest.register_alias( "along_shore:seaweed_1" , "flowers:seaweed" )
minetest.register_alias( "along_shore:seaweed_2" , "flowers:seaweed_2" )
minetest.register_alias( "along_shore:seaweed_3" , "flowers:seaweed_3" )
minetest.register_alias( "along_shore:seaweed_4" , "flowers:seaweed_4" )
-- ongen registrations
flowers_plus.grow_waterlily = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
for i in ipairs(lilies_list) do
local chance = random(1,8)
local ext = ""
local num = lilies_list[i][3]
if lilies_list[i][1] ~= nil then
ext = "_"..lilies_list[i][1]
end
if chance == num then
minetest.swap_node(right_here, {name="flowers:waterlily"..ext, param2=random(0,3)})
end
end
end
biome_lib:register_generate_plant({
surface = {"default:water_source"},
max_count = lilies_max_count,
rarity = lilies_rarity,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:dirt_with_grass"},
near_nodes_size = 4,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
temp_max = -0.22,
temp_min = 0.22,
},
flowers_plus.grow_waterlily
)
flowers_plus.grow_seaweed = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
minetest.swap_node(right_here, {name="along_shore:seaweed_"..random(1,4), param2=random(1,3)})
end
biome_lib:register_generate_plant({
surface = {"default:water_source"},
max_count = seaweed_max_count,
rarity = seaweed_rarity,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:dirt_with_grass"},
near_nodes_size = 4,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
},
flowers_plus.grow_seaweed
)
-- seaweed at beaches
-- MM: not satisfied with it, but IMHO some beaches should have some algae
biome_lib:register_generate_plant({
surface = {"default:water_source"},
max_count = seaweed_max_count,
rarity = seaweed_rarity,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:sand"},
near_nodes_size = 1,
near_nodes_vertical = 0,
near_nodes_count = 3,
plantlife_limit = -0.9,
temp_max = -0.64, -- MM: more or less random values, just to make sure it's not everywhere
temp_min = -0.22, -- MM: more or less random values, just to make sure it's not everywhere
},
flowers_plus.grow_seaweed
)
biome_lib:register_generate_plant({
surface = {"default:sand"},
max_count = seaweed_max_count*2,
rarity = seaweed_rarity/2,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:water_source"},
near_nodes_size = 1,
near_nodes_vertical = 0,
near_nodes_count = 3,
plantlife_limit = -0.9,
temp_max = -0.64, -- MM: more or less random values, just to make sure it's not everywhere
temp_min = -0.22, -- MM: more or less random values, just to make sure it's not everywhere
},
flowers_plus.grow_seaweed
)
biome_lib:register_generate_plant({
surface = {"default:dirt_with_grass"},
avoid_nodes = { "flowers:sunflower" },
max_count = sunflowers_max_count,
rarity = sunflowers_rarity,
min_elevation = 0,
plantlife_limit = -0.9,
temp_max = 0.53,
random_facedir = {0,3},
},
"flowers:sunflower"
)
-- spawn ABM registrations
biome_lib:spawn_on_surfaces({
spawn_delay = SPAWN_DELAY/2,
spawn_plants = {
"flowers:waterlily",
"flowers:waterlily_225",
"flowers:waterlily_45",
"flowers:waterlily_675",
"flowers:waterlily_s1",
"flowers:waterlily_s2",
"flowers:waterlily_s3",
"flowers:waterlily_s4"
},
avoid_radius = 2.5,
spawn_chance = SPAWN_CHANCE*4,
spawn_surfaces = {"default:water_source"},
avoid_nodes = {"group:flower", "group:flora" },
seed_diff = flowers_seed_diff,
light_min = 9,
depth_max = 2,
random_facedir = {0,3}
})
biome_lib:spawn_on_surfaces({
spawn_delay = SPAWN_DELAY*2,
spawn_plants = {"flowers:seaweed"},
spawn_chance = SPAWN_CHANCE*2,
spawn_surfaces = {"default:water_source"},
avoid_nodes = {"group:flower", "group:flora"},
seed_diff = flowers_seed_diff,
light_min = 4,
light_max = 10,
neighbors = {"default:dirt_with_grass"},
facedir = 1
})
biome_lib:spawn_on_surfaces({
spawn_delay = SPAWN_DELAY*2,
spawn_plants = {"flowers:seaweed"},
spawn_chance = SPAWN_CHANCE*2,
spawn_surfaces = {"default:dirt_with_grass"},
avoid_nodes = {"group:flower", "group:flora" },
seed_diff = flowers_seed_diff,
light_min = 4,
light_max = 10,
neighbors = {"default:water_source"},
ncount = 1,
facedir = 1
})
biome_lib:spawn_on_surfaces({
spawn_delay = SPAWN_DELAY*2,
spawn_plants = {"flowers:seaweed"},
spawn_chance = SPAWN_CHANCE*2,
spawn_surfaces = {"default:stone"},
avoid_nodes = {"group:flower", "group:flora" },
seed_diff = flowers_seed_diff,
light_min = 4,
light_max = 10,
neighbors = {"default:water_source"},
ncount = 6,
facedir = 1
})
biome_lib:spawn_on_surfaces({
spawn_delay = SPAWN_DELAY*2,
spawn_plants = {"flowers:sunflower"},
spawn_chance = SPAWN_CHANCE*2,
spawn_surfaces = {"default:dirt_with_grass"},
avoid_nodes = {"group:flower", "flowers:sunflower"},
seed_diff = flowers_seed_diff,
light_min = 11,
light_max = 14,
min_elevation = 0,
plantlife_limit = -0.9,
temp_max = 0.53,
random_facedir = {0,3},
avoid_radius = 5
})
-- Cotton plants are now provided by the default "farming" mod.
-- old cotton plants -> farming cotton stage 8
-- cotton wads -> string (can be crafted into wool blocks)
-- potted cotton plants -> potted white dandelions
minetest.register_alias("flowers:cotton_plant", "farming:cotton_8")
minetest.register_alias("flowers:flower_cotton", "farming:cotton_8")
minetest.register_alias("flowers:flower_cotton_pot", "flowers:potted_dandelion_white")
minetest.register_alias("flowers:potted_cotton_plant", "flowers:potted_dandelion_white")
minetest.register_alias("flowers:cotton", "farming:string")
minetest.register_alias("flowers:cotton_wad", "farming:string")
minetest.register_alias("sunflower:sunflower", "flowers:sunflower")
print("[Flowers] Loaded.")

View File

@ -1,5 +0,0 @@
minetest.register_alias("junglegrass:shortest", "air")
minetest.register_alias("junglegrass:short", "air")
minetest.register_alias("junglegrass:medium", "air")
minetest.log("action", "[junglegrass] loaded.")

View File

@ -1 +0,0 @@
name = junglegrass

View File

@ -1,14 +1,13 @@
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
local title = "Mole Hills"
local version = "0.0.3"
local mname = "molehills"
-----------------------------------------------------------------------------------------------
-- Idea by Sokomine -- Idea by Sokomine
-- Code & textures by Mossmanikin -- Code & textures by Mossmanikin
abstract_molehills = {} abstract_molehills = {}
dofile(minetest.get_modpath("molehills").."/molehills_settings.txt") local molehills_rarity = tonumber(minetest.settings:get("molehills_rarity")) or 99.5
local molehills_rarity_fertility = tonumber(minetest.settings:get("molehills_rarity_fertility")) or 1
local molehills_fertility = tonumber(minetest.settings:get("molehills_fertility")) or -0.6
-- support for i18n -- support for i18n
local S = minetest.get_translator("molehills") local S = minetest.get_translator("molehills")
@ -49,11 +48,11 @@ minetest.register_craft({ -- molehills --> dirt
-- GeNeRaTiNG -- GeNeRaTiNG
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
abstract_molehills.place_molehill = function(pos) abstract_molehills.place_molehill = function(pos)
local right_here = {x=pos.x , y=pos.y+1, z=pos.z } local right_here = {x=pos.x , y=pos.y+1, z=pos.z }
if minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }).name ~= "air" if minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }).name ~= "air"
and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z }).name ~= "air" and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z }).name ~= "air"
and minetest.get_node({x=pos.x , y=pos.y, z=pos.z+1}).name ~= "air" and minetest.get_node({x=pos.x , y=pos.y, z=pos.z+1}).name ~= "air"
and minetest.get_node({x=pos.x , y=pos.y, z=pos.z-1}).name ~= "air" and minetest.get_node({x=pos.x , y=pos.y, z=pos.z-1}).name ~= "air"
and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z+1}).name ~= "air" and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z+1}).name ~= "air"
and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z-1}).name ~= "air" and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z-1}).name ~= "air"
and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z+1}).name ~= "air" and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z+1}).name ~= "air"
@ -62,19 +61,15 @@ abstract_molehills.place_molehill = function(pos)
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
max_count = Molehills_Max_Count, rarity = molehills_rarity,
rarity = Molehills_Rarity, rarity_fertility = molehills_rarity_fertility,
min_elevation = 1, plantlife_limit = molehills_fertility,
max_elevation = 40, min_elevation = 1,
avoid_nodes = {"group:tree","group:liquid","group:stone","group:falling_node"--[[,"air"]]}, max_elevation = 40,
avoid_radius = 4, avoid_nodes = {"group:tree","group:liquid","group:stone","group:falling_node"--[[,"air"]]},
plantlife_limit = -0.3, avoid_radius = 4,
}, },
abstract_molehills.place_molehill abstract_molehills.place_molehill
) )
-----------------------------------------------------------------------------------------------
print("[Mod] "..title.." ["..version.."] ["..mname.."]".."Loaded...")
-----------------------------------------------------------------------------------------------

View File

@ -1,6 +0,0 @@
-- Settings for generation of stuff (at map-generation time)
Molehills_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
Molehills_Rarity = 95 -- larger values make molehills more rare (100 means chance of 0 %)

View File

@ -0,0 +1,8 @@
#Molehills rarity %
molehills_rarity (Molehills rarity %) float 99.5 0 100
#How much the rarity is reduced by fertility %
molehills_rarity_fertility (Molehills rarity fertility reduction %) float 1 0 100
#Molehills minimum fertility (-1 to +1)
molehills_fertility (Molehills minimum fertility) float -0.6 -1 1

168
pl_seaweed/init.lua Normal file
View File

@ -0,0 +1,168 @@
-- support for i18n
local S = minetest.get_translator("pl_seaweed")
pl_seaweed = {}
local seaweed_max_count = tonumber(minetest.settings:get("pl_seaweed_max_count")) or 320
local seaweed_rarity = tonumber(minetest.settings:get("pl_seaweed_rarity")) or 33
local algae_list = { {nil}, {2}, {3}, {4} }
for i in ipairs(algae_list) do
local num = ""
local algae_groups = {snappy = 3,flammable=2,flower=1}
if algae_list[i][1] ~= nil then
num = "_"..algae_list[i][1]
algae_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 }
end
minetest.register_node(":flowers:seaweed"..num, {
description = S("Seaweed"),
drawtype = "nodebox",
tiles = {
"flowers_seaweed"..num..".png",
"flowers_seaweed"..num..".png^[transformFY"
},
inventory_image = "flowers_seaweed_2.png",
wield_image = "flowers_seaweed_2.png",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = algae_groups,
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.4, -0.5, -0.4, 0.4, -0.45, 0.4 },
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
},
buildable_to = true,
liquids_pointable = true,
drop = "flowers:seaweed",
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
local pt = pointed_thing
local place_pos = nil
local top_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local under_node = minetest.get_node(pt.under)
local above_node = minetest.get_node(pt.above)
local top_node = minetest.get_node(top_pos)
if biome_lib.get_nodedef_field(under_node.name, "buildable_to") then
if under_node.name ~= "default:water_source" then
place_pos = pt.under
elseif top_node.name ~= "default:water_source"
and biome_lib.get_nodedef_field(top_node.name, "buildable_to") then
place_pos = top_pos
else
return
end
elseif biome_lib.get_nodedef_field(above_node.name, "buildable_to") then
place_pos = pt.above
end
if not place_pos then return end -- something went wrong :P
if not minetest.is_protected(place_pos, placer:get_player_name()) then
local nodename = "default:cobble" -- :D
if not keys["sneak"] then
--local node = minetest.get_node(pt.under)
local seaweed = math.random(1,4)
if seaweed == 1 then
nodename = "flowers:seaweed"
elseif seaweed == 2 then
nodename = "flowers:seaweed_2"
elseif seaweed == 3 then
nodename = "flowers:seaweed_3"
elseif seaweed == 4 then
nodename = "flowers:seaweed_4"
end
minetest.swap_node(place_pos, {name = nodename, param2 = math.random(0,3) })
else
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
minetest.swap_node(place_pos, {name = "flowers:seaweed", param2 = fdir})
end
if not biome_lib.expect_infinite_stacks then
itemstack:take_item()
end
return itemstack
end
end,
})
end
pl_seaweed.grow_seaweed = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local seaweed = math.random(1,4)
local node_name = "flowers:seaweed"
if seaweed > 1 then
node_name = node_name .. "_" .. seaweed
end
minetest.swap_node(right_here, {name=node_name, param2=math.random(1,3)})
end
biome_lib.register_on_generate({
surface = {"default:water_source"},
max_count = seaweed_max_count,
rarity = seaweed_rarity,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:dirt_with_grass"},
near_nodes_size = 4,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
},
pl_seaweed.grow_seaweed
)
-- pl_seaweed at beaches
-- MM: not satisfied with it, but IMHO some beaches should have some algae
biome_lib.register_on_generate({
surface = {"default:water_source"},
max_count = seaweed_max_count,
rarity = seaweed_rarity,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:sand"},
near_nodes_size = 1,
near_nodes_vertical = 0,
near_nodes_count = 3,
plantlife_limit = -0.9,
temp_max = -0.64, -- MM: more or less random values, just to make sure it's not everywhere
temp_min = -0.22, -- MM: more or less random values, just to make sure it's not everywhere
},
pl_seaweed.grow_seaweed
)
biome_lib.register_on_generate({
surface = {"default:sand"},
max_count = seaweed_max_count*2,
rarity = seaweed_rarity/2,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:water_source"},
near_nodes_size = 1,
near_nodes_vertical = 0,
near_nodes_count = 3,
plantlife_limit = -0.9,
temp_max = -0.64, -- MM: more or less random values, just to make sure it's not everywhere
temp_min = -0.22, -- MM: more or less random values, just to make sure it's not everywhere
},
pl_seaweed.grow_seaweed
)
minetest.register_alias( "flowers:flower_seaweed" , "flowers:seaweed" )
minetest.register_alias( "along_shore:pondscum_1" , "flowers:seaweed" )
minetest.register_alias( "along_shore:seaweed_1" , "flowers:seaweed" )
minetest.register_alias( "along_shore:seaweed_2" , "flowers:seaweed_2" )
minetest.register_alias( "along_shore:seaweed_3" , "flowers:seaweed_3" )
minetest.register_alias( "along_shore:seaweed_4" , "flowers:seaweed_4" )

View File

@ -0,0 +1,11 @@
# textdomain: pl_seaweed
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Xanthin, 2017.
#
Seaweed=Seetang

View File

@ -0,0 +1,10 @@
# textdomain: pl_seaweed
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# fat115 <fat115@framasoft.org>, 2017.
#
Seaweed=Algues

View File

@ -0,0 +1,10 @@
# textdomain: pl_seaweed
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# mahmutelmas06@hotmail.com, 2017.
#
Seaweed=Deniz yosunu

View File

@ -0,0 +1,10 @@
# textdomain: pl_seaweed
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Carlos Barraza <carlosbarrazaes@gmail.com>, 2017.
#
Seaweed=Algas marinas

View File

@ -0,0 +1,11 @@
# textdomain: pl_seaweed
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
Seaweed=

View File

@ -1,3 +1,3 @@
name = flowers_plus name = pl_seaweed
depends = biome_lib depends = biome_lib
optional_depends = farming, flowers optional_depends = farming, flowers

View File

@ -0,0 +1,5 @@
#Seaweed maximum count
pl_seaweed_max_count (Seaweed maximum count) int 320 1 1000
#Seaweed rarity
pl_seaweed_rarity (Seaweed rarity) int 33 0 100

View File

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

View File

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 222 B

View File

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

View File

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 226 B

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

55
pl_sunflowers/init.lua Normal file
View File

@ -0,0 +1,55 @@
-- support for i18n
local S = minetest.get_translator("pl_sunflowers")
local sunflowers_max_count = tonumber(minetest.settings:get("pl_sunflowers_max_count")) or 10
local sunflowers_rarity = tonumber(minetest.settings:get("pl_sunflowers_rarity")) or 25
local box = {
type="fixed",
fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
}
local sunflower_drop = "farming:seed_wheat"
if minetest.registered_items["farming:seed_spelt"] then
sunflower_drop = "farming:seed_spelt"
end
minetest.register_node(":flowers:sunflower", {
description = S("Sunflower"),
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
inventory_image = "flowers_sunflower_inv.png",
mesh = "flowers_sunflower.obj",
tiles = { "flowers_sunflower.png" },
walkable = false,
buildable_to = true,
is_ground_content = true,
groups = { dig_immediate=3, flora=1, flammable=3, attached_node=1 },
sounds = default.node_sound_leaves_defaults(),
selection_box = box,
collision_box = box,
drop = {
max_items = 1,
items = {
{items = {sunflower_drop}, rarity = 8},
{items = {"flowers:sunflower"}},
}
}
})
biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"},
avoid_nodes = { "flowers:sunflower" },
max_count = sunflowers_max_count,
rarity = sunflowers_rarity,
min_elevation = 0,
plantlife_limit = -0.9,
temp_max = -0.1,
random_facedir = {0,3},
},
"flowers:sunflower"
)
minetest.register_alias("sunflower:sunflower", "flowers:sunflower")

View File

@ -1,4 +1,4 @@
# textdomain: flowers_plus # textdomain: pl_sunflowers
# SOME DESCRIPTIVE TITLE. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
@ -8,6 +8,4 @@
Waterlily=Seerose
Seaweed=Seetang
Sunflower=Sonnenblume Sunflower=Sonnenblume

View File

@ -0,0 +1,10 @@
# textdomain: pl_sunflowers
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Carlos Barraza <carlosbarrazaes@gmail.com>, 2017.
#
Sunflower=Girasol

View File

@ -1,4 +1,4 @@
# textdomain: flowers_plus # textdomain: pl_sunflowers
# SOME DESCRIPTIVE TITLE. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
@ -7,6 +7,4 @@
# #
Waterlily=Nénuphar
Seaweed=Algues
Sunflower=Tournesol Sunflower=Tournesol

View File

@ -1,4 +1,4 @@
# textdomain: flowers_plus # textdomain: pl_sunflowers
# SOME DESCRIPTIVE TITLE. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
@ -7,6 +7,4 @@
# #
Waterlily=Nilüfer
Seaweed=Deniz yosunu
Sunflower=Ayçiçeği Sunflower=Ayçiçeği

View File

@ -1,4 +1,4 @@
# textdomain: flowers_plus # textdomain: pl_sunflowers
# SOME DESCRIPTIVE TITLE. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
@ -8,6 +8,4 @@
Waterlily=
Seaweed=
Sunflower= Sunflower=

3
pl_sunflowers/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = pl_sunflowers
depends = biome_lib
optional_depends = farming, flowers

View File

@ -0,0 +1,5 @@
#Sunflowers maximum count
pl_sunflowers_max_count (Sunflowers maximum count) int 10 1 1000
#Sunflowers rarity
pl_sunflowers_rarity (Sunflowers rarity) int 25 0 100

View File

Before

Width:  |  Height:  |  Size: 811 B

After

Width:  |  Height:  |  Size: 811 B

View File

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 378 B

164
pl_waterlilies/init.lua Normal file
View File

@ -0,0 +1,164 @@
-- support for i18n
local S = minetest.get_translator("pl_waterlilies")
pl_waterlilies = {}
local lilies_max_count = tonumber(minetest.settings:get("pl_waterlilies_max_count")) or 320
local lilies_rarity = tonumber(minetest.settings:get("pl_waterlilies_rarity")) or 33
local lilies_list = {
{ nil , nil , 1 },
{ "225", "22.5" , 2 },
{ "45" , "45" , 3 },
{ "675", "67.5" , 4 },
{ "s1" , "small_1" , 5 },
{ "s2" , "small_2" , 6 },
{ "s3" , "small_3" , 7 },
{ "s4" , "small_4" , 8 },
}
for i in ipairs(lilies_list) do
local deg1 = ""
local deg2 = ""
local lily_groups = {snappy = 3,flammable=2,flower=1}
if lilies_list[i][1] ~= nil then
deg1 = "_"..lilies_list[i][1]
deg2 = "_"..lilies_list[i][2]
lily_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 }
end
minetest.register_node(":flowers:waterlily"..deg1, {
description = S("Waterlily"),
drawtype = "nodebox",
tiles = {
"flowers_waterlily"..deg2..".png",
"flowers_waterlily"..deg2..".png^[transformFY"
},
inventory_image = "flowers_waterlily.png",
wield_image = "flowers_waterlily.png",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = lily_groups,
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.4, -0.5, -0.4, 0.4, -0.45, 0.4 },
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
},
buildable_to = true,
node_placement_prediction = "",
liquids_pointable = true,
drop = "flowers:waterlily",
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
local pt = pointed_thing
local place_pos = nil
local top_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local under_node = minetest.get_node(pt.under)
local above_node = minetest.get_node(pt.above)
local top_node = minetest.get_node(top_pos)
if biome_lib.get_nodedef_field(under_node.name, "buildable_to") then
if under_node.name ~= "default:water_source" then
place_pos = pt.under
elseif top_node.name ~= "default:water_source"
and biome_lib.get_nodedef_field(top_node.name, "buildable_to") then
place_pos = top_pos
else
return
end
elseif biome_lib.get_nodedef_field(above_node.name, "buildable_to") then
place_pos = pt.above
end
if place_pos and not minetest.is_protected(place_pos, placer:get_player_name()) then
local nodename = "default:cobble" -- if this block appears, something went....wrong :-)
if not keys["sneak"] then
local node = minetest.get_node(pt.under)
local waterlily = math.random(1,8)
if waterlily == 1 then
nodename = "flowers:waterlily"
elseif waterlily == 2 then
nodename = "flowers:waterlily_225"
elseif waterlily == 3 then
nodename = "flowers:waterlily_45"
elseif waterlily == 4 then
nodename = "flowers:waterlily_675"
elseif waterlily == 5 then
nodename = "flowers:waterlily_s1"
elseif waterlily == 6 then
nodename = "flowers:waterlily_s2"
elseif waterlily == 7 then
nodename = "flowers:waterlily_s3"
elseif waterlily == 8 then
nodename = "flowers:waterlily_s4"
end
minetest.swap_node(place_pos, {name = nodename, param2 = math.random(0,3) })
else
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
minetest.swap_node(place_pos, {name = "flowers:waterlily", param2 = fdir})
end
if not biome_lib.expect_infinite_stacks then
itemstack:take_item()
end
return itemstack
end
end,
})
end
pl_waterlilies.grow_waterlily = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
for i in ipairs(lilies_list) do
local chance = math.random(1,8)
local ext = ""
local num = lilies_list[i][3]
if lilies_list[i][1] ~= nil then
ext = "_"..lilies_list[i][1]
end
if chance == num then
minetest.swap_node(right_here, {name="flowers:waterlily"..ext, param2=math.random(0,3)})
end
end
end
biome_lib.register_on_generate({
surface = {"default:water_source"},
max_count = lilies_max_count,
rarity = lilies_rarity,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:dirt_with_grass"},
near_nodes_size = 4,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
temp_max = -0.22,
temp_min = 0.22,
},
pl_waterlilies.grow_waterlily
)
minetest.register_alias( "flowers:flower_waterlily", "flowers:waterlily")
minetest.register_alias( "flowers:flower_waterlily_225", "flowers:waterlily_225")
minetest.register_alias( "flowers:flower_waterlily_45", "flowers:waterlily_45")
minetest.register_alias( "flowers:flower_waterlily_675", "flowers:waterlily_675")
minetest.register_alias( "trunks:lilypad" , "flowers:waterlily_s1" )
minetest.register_alias( "along_shore:lilypads_1" , "flowers:waterlily_s1" )
minetest.register_alias( "along_shore:lilypads_2" , "flowers:waterlily_s2" )
minetest.register_alias( "along_shore:lilypads_3" , "flowers:waterlily_s3" )
minetest.register_alias( "along_shore:lilypads_4" , "flowers:waterlily_s4" )

View File

@ -0,0 +1,11 @@
# textdomain: pl_waterlilies
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Xanthin, 2017.
#
Waterlily=Seerose

View File

@ -1,4 +1,4 @@
# textdomain: flowers_plus # textdomain: pl_waterlilies
# SOME DESCRIPTIVE TITLE. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
@ -8,5 +8,3 @@
Waterlily=Lirio de agua Waterlily=Lirio de agua
Seaweed=Algas marinas
Sunflower=Girasol

View File

@ -0,0 +1,10 @@
# textdomain: pl_waterlilies
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# fat115 <fat115@framasoft.org>, 2017.
#
Waterlily=Nénuphar

View File

@ -0,0 +1,10 @@
# textdomain: pl_waterlilies
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# mahmutelmas06@hotmail.com, 2017.
#
Waterlily=Nilüfer

View File

@ -0,0 +1,11 @@
# textdomain: pl_waterlillies
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
Waterlily=

3
pl_waterlilies/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = pl_waterlilies
depends = biome_lib
optional_depends = farming, flowers

View File

@ -0,0 +1,5 @@
#Water-lilies maximum count
pl_waterlilies_max_count (Water-lilies maximum count) int 320 1 1000
#Water-lilies rarity
pl_waterlilies_rarity (Water-lilies rarity) int 33 0 100

View File

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 412 B

View File

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 409 B

View File

Before

Width:  |  Height:  |  Size: 421 B

After

Width:  |  Height:  |  Size: 421 B

View File

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 435 B

View File

Before

Width:  |  Height:  |  Size: 468 B

After

Width:  |  Height:  |  Size: 468 B

View File

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 472 B

View File

Before

Width:  |  Height:  |  Size: 422 B

After

Width:  |  Height:  |  Size: 422 B

View File

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 219 B

View File

@ -70,7 +70,7 @@ minetest.register_node('poisonivy:climbing', {
buildable_to = true, buildable_to = true,
}) })
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = SPAWN_DELAY, spawn_delay = SPAWN_DELAY,
spawn_plants = {"poisonivy:seedling"}, spawn_plants = {"poisonivy:seedling"},
avoid_radius = 10, avoid_radius = 10,
@ -83,7 +83,7 @@ biome_lib:spawn_on_surfaces({
verticals_list = walls_list verticals_list = walls_list
}) })
biome_lib:grow_plants({ biome_lib.update_plant({
grow_delay = SPAWN_DELAY, grow_delay = SPAWN_DELAY,
grow_chance = GROW_CHANCE, grow_chance = GROW_CHANCE,
grow_plant = "poisonivy:seedling", grow_plant = "poisonivy:seedling",
@ -91,7 +91,7 @@ biome_lib:grow_plants({
grow_nodes = {"default:dirt_with_grass"} grow_nodes = {"default:dirt_with_grass"}
}) })
biome_lib:grow_plants({ biome_lib.update_plant({
grow_delay = GROW_DELAY, grow_delay = GROW_DELAY,
grow_chance = GROW_CHANCE*2, grow_chance = GROW_CHANCE*2,
grow_plant = "poisonivy:climbing", grow_plant = "poisonivy:climbing",

View File

@ -35,11 +35,11 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = "trunks:twig_1 4", output = "trunks:twig_1 4",
recipe = {{"bushes:bushbranches2"}} recipe = {{"bushes:bushbranches3"}}
}) })
minetest.register_craft({ minetest.register_craft({
output = "trunks:twig_1 4", output = "trunks:twig_1 4",
recipe = {{"bushes:bushbranches3"}} recipe = {{"bushes:bushbranches4"}}
}) })
end end
minetest.register_craft({ -- twigs block --> twigs minetest.register_craft({ -- twigs block --> twigs

View File

@ -4,11 +4,13 @@
-- TWiGS -- TWiGS
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
local fakenode = { function check_node_buildable_to(pos)
name = "default:stone", -- could be anything that's guaranteed to exist at mapgen time, and isn't buildable_to local node = minetest.get_node(pos)
param1 = 0, local def = minetest.registered_nodes[node.name]
param2 = 0 if def then
} return def.buildable_to
end
end
abstract_trunks.place_twig = function(pos) abstract_trunks.place_twig = function(pos)
local twig_size = math.random(1,27) local twig_size = math.random(1,27)
@ -23,142 +25,208 @@ abstract_trunks.place_twig = function(pos)
local west = {x=pos.x-1, y=pos.y+1, z=pos.z } local west = {x=pos.x-1, y=pos.y+1, z=pos.z }
local north_west = {x=pos.x-1, y=pos.y+1, z=pos.z+1} local north_west = {x=pos.x-1, y=pos.y+1, z=pos.z+1}
local node_here = minetest.get_node(right_here)
local node_north = minetest.get_node(north)
local node_n_e = minetest.get_node(north_east)
local node_east = minetest.get_node(east)
local node_s_e = minetest.get_node(south_east)
local node_south = minetest.get_node(south)
local node_s_w = minetest.get_node(south_west)
local node_west = minetest.get_node(west)
local node_n_w = minetest.get_node(north_west)
node_north = minetest.registered_nodes[node_north.name] and node_north or fakenode
node_n_e = minetest.registered_nodes[node_n_e.name] and node_n_e or fakenode
node_east = minetest.registered_nodes[node_east.name] and node_east or fakenode
node_s_e = minetest.registered_nodes[node_s_e.name] and node_s_e or fakenode
node_south = minetest.registered_nodes[node_south.name] and node_south or fakenode
node_s_w = minetest.registered_nodes[node_s_w.name] and node_s_w or fakenode
node_west = minetest.registered_nodes[node_west.name] and node_west or fakenode
node_n_w = minetest.registered_nodes[node_n_w.name] and node_n_w or fakenode
-- small twigs -- small twigs
if twig_size <= 16 then if twig_size <= 16 then
minetest.swap_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)}) minetest.swap_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)})
end end
-- big twigs -- big twigs
if Big_Twigs == true then if Big_Twigs == true then
local n1, n2
local r1, r2
-- big twig 1 -- big twig 1
if twig_size == 17 then if twig_size == 17 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z+1})
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to) then or check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z})) then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_5"}) minetest.swap_node(right_here, {name="trunks:twig_5"})
end end
if minetest.registered_nodes[node_n_e.name].buildable_to then if check_node_buildable_to(north_east) then
minetest.swap_node(north_east, {name="trunks:twig_7"}) minetest.swap_node(north_east, {name="trunks:twig_7"})
end end
if minetest.registered_nodes[node_east.name].buildable_to then if check_node_buildable_to(east) then
minetest.swap_node(east, {name="trunks:twig_8"}) minetest.swap_node(east, {name="trunks:twig_8"})
end end
elseif twig_size == 20 then
n1 = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1})
n2 = minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1})
r1 = n1 and minetest.registered_nodes[n1.name]
r2 = n2 and minetest.registered_nodes[n2.name]
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then
minetest.swap_node(right_here, {name="trunks:twig_5", param2=3})
end
if minetest.registered_nodes[node_n_w.name].buildable_to then
minetest.swap_node(north_west, {name="trunks:twig_7", param2=3})
end
if minetest.registered_nodes[node_north.name].buildable_to then
minetest.swap_node(north, {name="trunks:twig_8", param2=3})
end
end
-- big twig 2
elseif twig_size == 21 then
n1 = minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1})
n2 = minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1})
r1 = n1 and minetest.registered_nodes[n1.name]
r2 = n2 and minetest.registered_nodes[n2.name]
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then
minetest.swap_node(right_here, {name="trunks:twig_9"})
end
if minetest.registered_nodes[node_north.name].buildable_to then
minetest.swap_node(north, {name="trunks:twig_10"})
end
if minetest.registered_nodes[node_n_e.name].buildable_to then
minetest.swap_node(north_east, {name="trunks:twig_11"})
end
end
elseif twig_size == 22 then
n1 = minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z})
n2 = minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1})
r1 = n1 and minetest.registered_nodes[n1.name]
r2 = n2 and minetest.registered_nodes[n2.name]
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=1})
end
if minetest.registered_nodes[node_east.name].buildable_to then
minetest.swap_node(east, {name="trunks:twig_10", param2=1})
end
if minetest.registered_nodes[node_s_e.name].buildable_to then
minetest.swap_node(south_east, {name="trunks:twig_11", param2=1})
end
end
elseif twig_size == 23 then
n1 = minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1})
n2 = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z-1})
r1 = n1 and minetest.registered_nodes[n1.name]
r2 = n2 and minetest.registered_nodes[n2.name]
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=2})
end
if minetest.registered_nodes[node_south.name].buildable_to then
minetest.swap_node(south, {name="trunks:twig_10", param2=2})
end
if minetest.registered_nodes[node_s_w.name].buildable_to then
minetest.swap_node(south_west, {name="trunks:twig_11", param2=2})
end
end
elseif twig_size == 24 then
n1 = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z})
n2 = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1})
r1 = n1 and minetest.registered_nodes[n1.name]
r2 = n2 and minetest.registered_nodes[n2.name]
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=3})
end
if minetest.registered_nodes[node_west.name].buildable_to then
minetest.swap_node(west, {name="trunks:twig_10", param2=3})
end
if minetest.registered_nodes[node_n_w.name].buildable_to then
minetest.swap_node(north_west, {name="trunks:twig_11", param2=3})
end
end
elseif twig_size <= 25 then
minetest.swap_node(right_here, {name="trunks:twig_"..math.random(12,13), param2=math.random(0,3)})
end end
elseif twig_size == 18 then elseif twig_size == 18 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z-1})
or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to) then or check_node_buildable_to({x=pos.x,y=pos.y,z=pos.z-1})) then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_5", param2=1}) minetest.swap_node(right_here, {name="trunks:twig_5", param2=1})
end end
if minetest.registered_nodes[node_s_e.name].buildable_to then if check_node_buildable_to(south_east) then
minetest.swap_node(south_east, {name="trunks:twig_7", param2=1}) minetest.swap_node(south_east, {name="trunks:twig_7", param2=1})
end end
if minetest.registered_nodes[node_south.name].buildable_to then if check_node_buildable_to(south) then
minetest.swap_node(south, {name="trunks:twig_8", param2=1}) minetest.swap_node(south, {name="trunks:twig_8", param2=1})
end end
end end
elseif twig_size == 19 then elseif twig_size == 19 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z-1})
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to) then or check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z})) then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_5", param2=2}) minetest.swap_node(right_here, {name="trunks:twig_5", param2=2})
end end
if minetest.registered_nodes[node_s_w.name].buildable_to then if check_node_buildable_to(south_west) then
minetest.swap_node(south_west, {name="trunks:twig_7", param2=2}) minetest.swap_node(south_west, {name="trunks:twig_7", param2=2})
end end
if minetest.registered_nodes[node_west.name].buildable_to then if check_node_buildable_to(west) then
minetest.swap_node(west, {name="trunks:twig_8", param2=2}) minetest.swap_node(west, {name="trunks:twig_8", param2=2})
end end
end end
elseif twig_size == 20 then elseif twig_size == 20 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to if not (check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z+1})
or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to) then or check_node_buildable_to({x=pos.x,y=pos.y,z=pos.z+1})) then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_5", param2=3}) minetest.swap_node(right_here, {name="trunks:twig_5", param2=3})
end end
if minetest.registered_nodes[node_n_w.name].buildable_to then if check_node_buildable_to(north_west) then
minetest.swap_node(north_west, {name="trunks:twig_7", param2=3}) minetest.swap_node(north_west, {name="trunks:twig_7", param2=3})
end end
if minetest.registered_nodes[node_north.name].buildable_to then if check_node_buildable_to(north) then
minetest.swap_node(north, {name="trunks:twig_8", param2=3}) minetest.swap_node(north, {name="trunks:twig_8", param2=3})
end end
end end
-- big twig 2 -- big twig 2
elseif twig_size == 21 then elseif twig_size == 21 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to if not (check_node_buildable_to({x=pos.x,y=pos.y,z=pos.z+1})
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to) then or check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z+1})) then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_9"}) minetest.swap_node(right_here, {name="trunks:twig_9"})
end end
if minetest.registered_nodes[node_north.name].buildable_to then if check_node_buildable_to(north) then
minetest.swap_node(north, {name="trunks:twig_10"}) minetest.swap_node(north, {name="trunks:twig_10"})
end end
if minetest.registered_nodes[node_n_e.name].buildable_to then if check_node_buildable_to(north_east) then
minetest.swap_node(north_east, {name="trunks:twig_11"}) minetest.swap_node(north_east, {name="trunks:twig_11"})
end end
end end
elseif twig_size == 22 then elseif twig_size == 22 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z})
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to) then or check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z-1})) then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=1}) minetest.swap_node(right_here, {name="trunks:twig_9", param2=1})
end end
if minetest.registered_nodes[node_east.name].buildable_to then if check_node_buildable_to(east) then
minetest.swap_node(east, {name="trunks:twig_10", param2=1}) minetest.swap_node(east, {name="trunks:twig_10", param2=1})
end end
if minetest.registered_nodes[node_s_e.name].buildable_to then if check_node_buildable_to(south_east) then
minetest.swap_node(south_east, {name="trunks:twig_11", param2=1}) minetest.swap_node(south_east, {name="trunks:twig_11", param2=1})
end end
end end
elseif twig_size == 23 then elseif twig_size == 23 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to if not (check_node_buildable_to({x=pos.x,y=pos.y,z=pos.z-1})
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z-1}).name].buildable_to) then or check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z-1})) then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=2}) minetest.swap_node(right_here, {name="trunks:twig_9", param2=2})
end end
if minetest.registered_nodes[node_south.name].buildable_to then if check_node_buildable_to(south) then
minetest.swap_node(south, {name="trunks:twig_10", param2=2}) minetest.swap_node(south, {name="trunks:twig_10", param2=2})
end end
if minetest.registered_nodes[node_s_w.name].buildable_to then if check_node_buildable_to(south_west) then
minetest.swap_node(south_west, {name="trunks:twig_11", param2=2}) minetest.swap_node(south_west, {name="trunks:twig_11", param2=2})
end end
end end
elseif twig_size == 24 then elseif twig_size == 24 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to if not (check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z})
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to) then or check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z+1})) then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=3}) minetest.swap_node(right_here, {name="trunks:twig_9", param2=3})
end end
if minetest.registered_nodes[node_west.name].buildable_to then if check_node_buildable_to(west) then
minetest.swap_node(west, {name="trunks:twig_10", param2=3}) minetest.swap_node(west, {name="trunks:twig_10", param2=3})
end end
if minetest.registered_nodes[node_n_w.name].buildable_to then if check_node_buildable_to(north_west) then
minetest.swap_node(north_west, {name="trunks:twig_11", param2=3}) minetest.swap_node(north_west, {name="trunks:twig_11", param2=3})
end end
end end
@ -169,7 +237,7 @@ abstract_trunks.place_twig = function(pos)
end end
if Twigs_on_ground == true then if Twigs_on_ground == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
max_count = Twigs_on_ground_Max_Count, max_count = Twigs_on_ground_Max_Count,
rarity = Twigs_on_ground_Rarity, rarity = Twigs_on_ground_Rarity,
@ -186,7 +254,7 @@ biome_lib:register_generate_plant({
end end
if Twigs_on_water == true then if Twigs_on_water == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:water_source"}, surface = {"default:water_source"},
max_count = Twigs_on_water_Max_Count, max_count = Twigs_on_water_Max_Count,
rarity = Twigs_on_water_Rarity, rarity = Twigs_on_water_Rarity,
@ -256,16 +324,7 @@ abstract_trunks.place_trunk = function(pos)
local east = {x=pos.x+1, y=pos.y+1, z=pos.z} local east = {x=pos.x+1, y=pos.y+1, z=pos.z}
local east2 = {x=pos.x+2, y=pos.y+1, z=pos.z} local east2 = {x=pos.x+2, y=pos.y+1, z=pos.z}
local node_here = minetest.get_node(right_here) if check_node_buildable_to(right_here) then -- instead of check_air = true,
local node_north = minetest.get_node(north)
local node_north2 = minetest.get_node(north2)
local node_south = minetest.get_node(south)
local node_south2 = minetest.get_node(south2)
local node_west = minetest.get_node(west)
local node_west2 = minetest.get_node(west2)
local node_east = minetest.get_node(east)
local node_east2 = minetest.get_node(east2)
if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true,
for i in pairs(TRuNKS) do for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1] local MoD = TRuNKS[i][1]
local TRuNK = TRuNKS[i][2] local TRuNK = TRuNKS[i][2]
@ -282,63 +341,63 @@ abstract_trunks.place_trunk = function(pos)
end end
elseif trunk_type == 2 and Horizontal_Trunks == true then elseif trunk_type == 2 and Horizontal_Trunks == true then
if minetest.get_modpath(MoD) ~= nil then if minetest.get_modpath(MoD) ~= nil then
if minetest.registered_nodes[node_north.name].buildable_to then if check_node_buildable_to(north) then
minetest.swap_node(north, {name=MoD..":"..TRuNK, param2=4}) minetest.swap_node(north, {name=MoD..":"..TRuNK, param2=4})
end end
if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then if length >= 4 and check_node_buildable_to(north2) then
minetest.swap_node(north2, {name=MoD..":"..TRuNK, param2=4}) minetest.swap_node(north2, {name=MoD..":"..TRuNK, param2=4})
end end
minetest.swap_node(right_here, {name=MoD..":"..TRuNK, param2=4}) minetest.swap_node(right_here, {name=MoD..":"..TRuNK, param2=4})
if minetest.registered_nodes[node_south.name].buildable_to then if check_node_buildable_to(south) then
minetest.swap_node(south, {name=MoD..":"..TRuNK, param2=4}) minetest.swap_node(south, {name=MoD..":"..TRuNK, param2=4})
end end
if length == 5 and minetest.registered_nodes[node_south2.name].buildable_to then if length == 5 and check_node_buildable_to(south2) then
minetest.swap_node(south2, {name=MoD..":"..TRuNK, param2=4}) minetest.swap_node(south2, {name=MoD..":"..TRuNK, param2=4})
end end
else else
if minetest.registered_nodes[node_north.name].buildable_to then if check_node_buildable_to(north) then
minetest.swap_node(north, {name="default:tree", param2=4}) minetest.swap_node(north, {name="default:tree", param2=4})
end end
if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then if length >= 4 and check_node_buildable_to(north2) then
minetest.swap_node(north2, {name="default:tree", param2=4}) minetest.swap_node(north2, {name="default:tree", param2=4})
end end
minetest.swap_node(right_here, {name="default:tree", param2=4}) minetest.swap_node(right_here, {name="default:tree", param2=4})
if minetest.registered_nodes[node_south.name].buildable_to then if check_node_buildable_to(south) then
minetest.swap_node(south, {name="default:tree", param2=4}) minetest.swap_node(south, {name="default:tree", param2=4})
end end
if length == 5 and minetest.registered_nodes[node_south2.name].buildable_to then if length == 5 and check_node_buildable_to(south2) then
minetest.swap_node(south2, {name="default:tree", param2=4}) minetest.swap_node(south2, {name="default:tree", param2=4})
end end
end end
elseif trunk_type == 3 and Horizontal_Trunks == true then elseif trunk_type == 3 and Horizontal_Trunks == true then
if minetest.get_modpath(MoD) ~= nil then if minetest.get_modpath(MoD) ~= nil then
if minetest.registered_nodes[node_west.name].buildable_to then if check_node_buildable_to(west) then
minetest.swap_node(west, {name=MoD..":"..TRuNK, param2=12}) minetest.swap_node(west, {name=MoD..":"..TRuNK, param2=12})
end end
if length >= 4 and minetest.registered_nodes[node_west2.name].buildable_to then if length >= 4 and check_node_buildable_to(west2) then
minetest.swap_node(west2, {name=MoD..":"..TRuNK, param2=12}) minetest.swap_node(west2, {name=MoD..":"..TRuNK, param2=12})
end end
minetest.swap_node(right_here, {name=MoD..":"..TRuNK, param2=12}) minetest.swap_node(right_here, {name=MoD..":"..TRuNK, param2=12})
if minetest.registered_nodes[node_east.name].buildable_to then if check_node_buildable_to(east) then
minetest.swap_node(east, {name=MoD..":"..TRuNK, param2=12}) minetest.swap_node(east, {name=MoD..":"..TRuNK, param2=12})
end end
if length == 5 and minetest.registered_nodes[node_east2.name].buildable_to then if length == 5 and check_node_buildable_to(east2) then
minetest.swap_node(east2, {name=MoD..":"..TRuNK, param2=12}) minetest.swap_node(east2, {name=MoD..":"..TRuNK, param2=12})
end end
else else
if minetest.registered_nodes[node_west.name].buildable_to then if check_node_buildable_to(west) then
minetest.swap_node(west, {name="default:tree", param2=12}) minetest.swap_node(west, {name="default:tree", param2=12})
end end
if length >= 4 and minetest.registered_nodes[node_west2.name].buildable_to then if length >= 4 and check_node_buildable_to(west2) then
minetest.swap_node(west2, {name="default:tree", param2=12}) minetest.swap_node(west2, {name="default:tree", param2=12})
end end
minetest.swap_node(right_here, {name="default:tree", param2=12}) minetest.swap_node(right_here, {name="default:tree", param2=12})
if minetest.registered_nodes[node_east.name].buildable_to then if check_node_buildable_to(east) then
minetest.swap_node(east, {name="default:tree", param2=12}) minetest.swap_node(east, {name="default:tree", param2=12})
end end
if length == 5 and minetest.registered_nodes[node_east2.name].buildable_to then if length == 5 and check_node_buildable_to(east2) then
minetest.swap_node(east2, {name="default:tree", param2=12}) minetest.swap_node(east2, {name="default:tree", param2=12})
end end
end end
@ -348,7 +407,7 @@ abstract_trunks.place_trunk = function(pos)
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
max_count = Trunks_Max_Count, -- 320, max_count = Trunks_Max_Count, -- 320,
rarity = Trunks_Rarity, -- 99, rarity = Trunks_Rarity, -- 99,
@ -382,7 +441,7 @@ abstract_trunks.grow_moss_on_ground = function(pos)
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
max_count = Moss_on_ground_Max_Count, max_count = Moss_on_ground_Max_Count,
rarity = Moss_on_ground_Rarity, rarity = Moss_on_ground_Rarity,
@ -413,17 +472,9 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
local at_side_e = {x=pos.x+1, y=pos.y, z=pos.z} local at_side_e = {x=pos.x+1, y=pos.y, z=pos.z}
local at_side_s = {x=pos.x, y=pos.y, z=pos.z-1} local at_side_s = {x=pos.x, y=pos.y, z=pos.z-1}
local at_side_w = {x=pos.x-1, y=pos.y, z=pos.z} local at_side_w = {x=pos.x-1, y=pos.y, z=pos.z}
local undrneath = {x=pos.x, y=pos.y-1, z=pos.z}
local node_here = minetest.get_node(on_ground)
local node_north = minetest.get_node(at_side_n)
local node_east = minetest.get_node(at_side_e)
local node_south = minetest.get_node(at_side_s)
local node_west = minetest.get_node(at_side_w)
local node_under = minetest.get_node(undrneath)
--if minetest.get_item_group(node_under.name, "tree") < 1 then --if minetest.get_item_group(node_under.name, "tree") < 1 then
if minetest.registered_nodes[node_here.name].buildable_to then if check_node_buildable_to(on_ground) then
local moss_type = math.random(1,41) local moss_type = math.random(1,41)
local rot = math.random(0,3) local rot = math.random(0,3)
if moss_type == 1 then if moss_type == 1 then
@ -432,7 +483,7 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
minetest.swap_node(on_ground, {name="trunks:moss_plain_"..rot, param2=1}) minetest.swap_node(on_ground, {name="trunks:moss_plain_"..rot, param2=1})
end end
end end
if minetest.registered_nodes[node_north.name].buildable_to then if check_node_buildable_to(at_side_n) then
local moss_type = math.random(1,31) -- cliche of more moss at north local moss_type = math.random(1,31) -- cliche of more moss at north
local rot = math.random(0,3) local rot = math.random(0,3)
if moss_type == 1 then if moss_type == 1 then
@ -441,7 +492,7 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
minetest.swap_node(at_side_n, {name="trunks:moss_plain_"..rot, param2=5}) minetest.swap_node(at_side_n, {name="trunks:moss_plain_"..rot, param2=5})
end end
end end
if minetest.registered_nodes[node_east.name].buildable_to then if check_node_buildable_to(at_side_e) then
local moss_type = math.random(1,41) local moss_type = math.random(1,41)
local rot = math.random(0,3) local rot = math.random(0,3)
if moss_type == 1 then if moss_type == 1 then
@ -450,7 +501,7 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
minetest.swap_node(at_side_e, {name="trunks:moss_plain_"..rot, param2=3}) minetest.swap_node(at_side_e, {name="trunks:moss_plain_"..rot, param2=3})
end end
end end
if minetest.registered_nodes[node_south.name].buildable_to then if check_node_buildable_to(at_side_s) then
local moss_type = math.random(1,41) local moss_type = math.random(1,41)
local rot = math.random(0,3) local rot = math.random(0,3)
if moss_type == 1 then if moss_type == 1 then
@ -459,7 +510,7 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
minetest.swap_node(at_side_s, {name="trunks:moss_plain_"..rot, param2=4}) minetest.swap_node(at_side_s, {name="trunks:moss_plain_"..rot, param2=4})
end end
end end
if minetest.registered_nodes[node_west.name].buildable_to then if check_node_buildable_to(at_side_w) then
local moss_type = math.random(1,41) local moss_type = math.random(1,41)
local rot = math.random(0,3) local rot = math.random(0,3)
if moss_type == 1 then if moss_type == 1 then
@ -471,7 +522,7 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
--end --end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:tree", "default:tree",
"default:jungletree", "default:jungletree",
@ -520,10 +571,6 @@ abstract_trunks.grow_roots = function(pos)
local node_here = minetest.get_node(right_here) local node_here = minetest.get_node(right_here)
local node_below = minetest.get_node(below) local node_below = minetest.get_node(below)
local node_north = minetest.get_node(north)
local node_east = minetest.get_node(east)
local node_south = minetest.get_node(south)
local node_west = minetest.get_node(west)
for i in pairs(TRuNKS) do for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1] local MoD = TRuNKS[i][1]
@ -532,23 +579,23 @@ abstract_trunks.grow_roots = function(pos)
and node_here.name == MoD..":"..TRuNK and node_here.name == MoD..":"..TRuNK
and string.find(node_below.name, "dirt") and string.find(node_below.name, "dirt")
and node_here.param2 == 0 then and node_here.param2 == 0 then
if minetest.registered_nodes[node_north.name].buildable_to then if check_node_buildable_to(north) then
minetest.swap_node(north, {name="trunks:"..TRuNK.."root", param2=2}) minetest.swap_node(north, {name="trunks:"..TRuNK.."root", param2=2})
end end
if minetest.registered_nodes[node_east.name].buildable_to then if check_node_buildable_to(east) then
minetest.swap_node(east, {name="trunks:"..TRuNK.."root", param2=3}) minetest.swap_node(east, {name="trunks:"..TRuNK.."root", param2=3})
end end
if minetest.registered_nodes[node_south.name].buildable_to then if check_node_buildable_to(south) then
minetest.swap_node(south, {name="trunks:"..TRuNK.."root", param2=0}) minetest.swap_node(south, {name="trunks:"..TRuNK.."root", param2=0})
end end
if minetest.registered_nodes[node_west.name].buildable_to then if check_node_buildable_to(west) then
minetest.swap_node(west, {name="trunks:"..TRuNK.."root", param2=1}) minetest.swap_node(west, {name="trunks:"..TRuNK.."root", param2=1})
end end
end end
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"group:tree"}, surface = {"group:tree"},
max_count = 1000, max_count = 1000,
rarity = 1, rarity = 1,

View File

@ -58,6 +58,7 @@ for i in pairs(NoDe) do
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
itemstack:take_item() itemstack:take_item()
end end
return itemstack
end end
end, end,
}) })
@ -95,6 +96,7 @@ for r = 0, 3 do
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
node_box = cbox, node_box = cbox,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node=1, not_in_creative_inventory = r}, groups = {snappy = 3, flammable = 3, attached_node=1, not_in_creative_inventory = r},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = "trunks:moss_plain_0", drop = "trunks:moss_plain_0",
@ -114,6 +116,7 @@ for r = 0, 3 do
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
node_box = cbox, node_box = cbox,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node=1, not_in_creative_inventory = r}, groups = {snappy = 3, flammable = 3, attached_node=1, not_in_creative_inventory = r},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = "trunks:moss_with_fungus_0", drop = "trunks:moss_with_fungus_0",

View File

@ -1,6 +1,6 @@
# Vines Mod by Bas80 (Edited by TenPlus1) # Vines Mod by Bas80 (Edited by TenPlus1)
### License: MIT for code, CC for textures ### License: MIT for code, CC0 for textures
## Features ## Features
- Rope block for spawning rope that slowly drops into the deep. - Rope block for spawning rope that slowly drops into the deep.

View File

@ -3,50 +3,107 @@ vines = {
recipes = {} recipes = {}
} }
local enable_roots = minetest.settings:get_bool("vines_enable_roots") local enable_vines = minetest.settings:get_bool("vines_enable_vines", true)
local enable_rope = minetest.settings:get_bool("vines_enable_rope", true)
local enable_roots = minetest.settings:get_bool("vines_enable_roots", true)
local enable_standard = minetest.settings:get_bool("vines_enable_standard", true)
local enable_side = minetest.settings:get_bool("vines_enable_side", true)
local enable_jungle = minetest.settings:get_bool("vines_enable_jungle", true)
local enable_willow = minetest.settings:get_bool("vines_enable_willow", true)
local rarity_roots = tonumber(minetest.settings:get("vines_rarity_roots")) or 70
local default_rarity = 95
local rarity_standard = tonumber(minetest.settings:get("vines_rarity_standard")) or default_rarity
local rarity_side = tonumber(minetest.settings:get("vines_rarity_side")) or default_rarity
local rarity_jungle = tonumber(minetest.settings:get("vines_rarity_jungle")) or default_rarity
local rarity_willow = tonumber(minetest.settings:get("vines_rarity_willow")) or default_rarity
local growth_min = tonumber(minetest.settings:get("vines_growth_min")) or 180
local growth_max = tonumber(minetest.settings:get("vines_growth_max")) or 360
-- support for i18n -- support for i18n
local S = minetest.get_translator("vines") local S = minetest.get_translator("vines")
-- ITEMS -- ITEMS
minetest.register_craftitem("vines:vines", { if enable_vines ~= false then
description = S("Vines"), minetest.register_craftitem("vines:vines", {
inventory_image = "vines_item.png", description = S("Vines"),
groups = {vines = 1, flammable = 2} inventory_image = "vines_item.png",
}) groups = {vines = 1, flammable = 2}
})
end
-- FUNCTIONS -- FUNCTIONS
local random = math.random local random = math.random
local function dig_down(pos, node, digger) local function on_dig(pos, node, player)
local vine_name_end = node.name:gsub("_middle", "_end")
local drop_item = "vines:vines"
if enable_vines == false then
drop_item = vine_name_end
end
if digger == nil then return end local wielded_item = minetest.is_player(player) and player:get_wielded_item()
if wielded_item then
local node_def = minetest.registered_nodes[node.name]
local dig_params = minetest.get_dig_params(
node_def.groups,
wielded_item:get_tool_capabilities(),
wielded_item:get_wear()
)
if dig_params.wear then
wielded_item:add_wear(dig_params.wear)
player:set_wielded_item(wielded_item)
end
local np = {x = pos.x, y = pos.y - 1, z = pos.z} if wielded_item:get_name() == 'vines:shears' then
drop_item = vine_name_end
end
end
local break_pos = {x = pos.x, y = pos.y, z = pos.z}
while minetest.get_item_group(minetest.get_node(break_pos).name, "vines") > 0 do
minetest.remove_node(break_pos)
minetest.handle_node_drops(break_pos, {drop_item}, player)
break_pos.y = break_pos.y - 1
end
end
local function ensure_vine_end(pos, oldnode)
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
local nn = minetest.get_node(np) local nn = minetest.get_node(np)
local vine_name_end = oldnode.name:gsub("_middle", "_end")
if minetest.get_item_group(nn.name, "vines") > 0 then if minetest.get_item_group(nn.name, "vines") > 0 then
minetest.node_dig(np, nn, digger) minetest.swap_node(np, { name = vine_name_end, param2 = oldnode.param2 })
minetest.registered_items[vine_name_end].on_construct(np, minetest.get_node(np))
end end
end end
vines.register_vine = function( name, defs, biome ) vines.register_vine = function( name, defs, biome )
local groups = {vines = 1, snappy = 3, flammable = 2, attached_node = 1} local groups = {vines = 1, snappy = 3, flammable = 2}
local vine_name_end = 'vines:' .. name .. '_end' local vine_name_end = 'vines:' .. name .. '_end'
local vine_name_middle = 'vines:' .. name .. '_middle' local vine_name_middle = 'vines:' .. name .. '_middle'
local vine_image_end = "vines_" .. name .. "_end.png" local vine_image_end = "vines_" .. name .. "_end.png"
local vine_image_middle = "vines_" .. name .. "_middle.png" local vine_image_middle = "vines_" .. name .. "_middle.png"
local drop_node = vine_name_end
biome.spawn_plants = {vine_name_end} local spawn_plants = function(pos, fdir)
local max_length = math.random(defs.average_length)
local vine_group = 'group:' .. name .. '_vines' local current_length = 1
if minetest.get_node({ x=pos.x, y=pos.y - 1, z=pos.z }).name == 'air' then
biome.spawn_surfaces[#biome.spawn_surfaces + 1] = vine_group while minetest.get_node({ x=pos.x, y=pos.y - 1, z=pos.z }).name == 'air' and current_length < max_length do
minetest.swap_node(pos, { name = vine_name_middle, param2 = fdir })
pos.y = pos.y - 1
current_length = current_length + 1
end
minetest.set_node(pos, { name = vine_name_end, param2 = fdir })
end
end
local selection_box = {type = "wallmounted",} local selection_box = {type = "wallmounted",}
local drawtype = 'signlike' local drawtype = 'signlike'
@ -66,7 +123,7 @@ vines.register_vine = function( name, defs, biome )
walkable = false, walkable = false,
climbable = true, climbable = true,
wield_image = vine_image_end, wield_image = vine_image_end,
drop = "vines:vines", drop = {},
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
@ -81,8 +138,7 @@ vines.register_vine = function( name, defs, biome )
on_construct = function(pos) on_construct = function(pos)
local timer = minetest.get_node_timer(pos) local timer = minetest.get_node_timer(pos)
timer:start(random(growth_min, growth_max))
timer:start(random(5, 10))
end, end,
on_timer = function(pos) on_timer = function(pos)
@ -90,12 +146,11 @@ vines.register_vine = function( name, defs, biome )
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local bottom = {x = pos.x, y = pos.y - 1, z = pos.z} local bottom = {x = pos.x, y = pos.y - 1, z = pos.z}
local bottom_node = minetest.get_node( bottom ) local bottom_node = minetest.get_node( bottom )
if bottom_node.name == "air" then if bottom_node.name == "air" then
if not random(defs.average_length) == 1 then if random(defs.average_length) ~= 1 then
minetest.set_node(pos, { minetest.swap_node(pos, {
name = vine_name_middle, param2 = node.param2}) name = vine_name_middle, param2 = node.param2})
minetest.set_node(bottom, { minetest.set_node(bottom, {
@ -103,13 +158,15 @@ vines.register_vine = function( name, defs, biome )
local timer = minetest.get_node_timer(bottom_node) local timer = minetest.get_node_timer(bottom_node)
timer:start(random(5, 10)) timer:start(random(growth_min, growth_max))
end end
end end
end, end,
after_dig_node = function(pos, node, metadata, digger) on_dig = on_dig,
dig_down(pos, node, digger)
after_destruct = function(pos, oldnode)
ensure_vine_end(pos, oldnode)
end, end,
}) })
@ -117,7 +174,7 @@ vines.register_vine = function( name, defs, biome )
description = S("Matured") .. " " .. defs.description, description = S("Matured") .. " " .. defs.description,
walkable = false, walkable = false,
climbable = true, climbable = true,
drop = "vines:vines", drop = {},
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
@ -130,12 +187,14 @@ vines.register_vine = function( name, defs, biome )
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = selection_box, selection_box = selection_box,
after_dig_node = function(pos, node, metadata, digger) on_dig = on_dig,
dig_down(pos, node, digger)
after_destruct = function(pos, oldnode)
ensure_vine_end(pos, oldnode)
end, end,
}) })
biome_lib:spawn_on_surfaces(biome) biome_lib.register_on_generate(biome, spawn_plants)
end end
-- ALIASES -- ALIASES
@ -152,147 +211,136 @@ minetest.register_alias( 'vines:jungle_rotten', 'air' )
minetest.register_alias( 'vines:willow', 'air' ) minetest.register_alias( 'vines:willow', 'air' )
minetest.register_alias( 'vines:willow_rotten', 'air' ) minetest.register_alias( 'vines:willow_rotten', 'air' )
-- CRAFTS
minetest.register_craft({
output = 'vines:rope_block',
recipe = {
{'group:vines', 'group:vines', 'group:vines'},
{'group:vines', 'group:wood', 'group:vines'},
{'group:vines', 'group:vines', 'group:vines'},
}
})
if minetest.get_modpath("moreblocks") then
-- ROPE
if enable_rope ~= false then
minetest.register_craft({ minetest.register_craft({
output = 'vines:rope_block', output = 'vines:rope_block',
recipe = { recipe = {
{'moreblocks:rope', 'moreblocks:rope', 'moreblocks:rope'}, {'group:vines', 'group:vines', 'group:vines'},
{'moreblocks:rope', 'group:wood', 'moreblocks:rope'}, {'group:vines', 'group:wood', 'group:vines'},
{'moreblocks:rope', 'moreblocks:rope', 'moreblocks:rope'}, {'group:vines', 'group:vines', 'group:vines'},
} }
}) })
end
minetest.register_craft({ if minetest.get_modpath("moreblocks") then
output = 'vines:shears', minetest.register_craft({
recipe = { output = 'vines:rope_block',
{'', 'default:steel_ingot', ''}, recipe = {
{'group:stick', 'group:wood', 'default:steel_ingot'}, {'moreblocks:rope', 'moreblocks:rope', 'moreblocks:rope'},
{'', '', 'group:stick'} {'moreblocks:rope', 'group:wood', 'moreblocks:rope'},
} {'moreblocks:rope', 'moreblocks:rope', 'moreblocks:rope'},
}) }
})
-- NODES
minetest.register_node("vines:rope_block", {
description = S("Rope"),
sunlight_propagates = true,
paramtype = "light",
tiles = {
"default_wood.png^vines_rope.png",
"default_wood.png^vines_rope.png",
"default_wood.png",
"default_wood.png",
"default_wood.png^vines_rope.png",
"default_wood.png^vines_rope.png",
},
groups = {flammable = 2, choppy = 2, oddly_breakable_by_hand = 1},
after_place_node = function(pos)
local p = {x = pos.x, y = pos.y - 1, z = pos.z}
local n = minetest.get_node(p)
if n.name == "air" then
minetest.add_node(p, {name = "vines:rope_end"})
end
end,
after_dig_node = function(pos, node, digger)
local p = {x = pos.x, y = pos.y - 1, z = pos.z}
local n = minetest.get_node(p)
while n.name == 'vines:rope' or n.name == 'vines:rope_end' do
minetest.remove_node(p)
p = {x = p.x, y = p.y - 1, z = p.z}
n = minetest.get_node(p)
end
end end
})
minetest.register_node("vines:rope", { minetest.register_node("vines:rope_block", {
description = S("Rope"), description = S("Rope"),
walkable = false, sunlight_propagates = true,
climbable = true, paramtype = "light",
sunlight_propagates = true, tiles = {
paramtype = "light", "default_wood.png^vines_rope.png",
drop = {}, "default_wood.png^vines_rope.png",
tiles = {"vines_rope.png"}, "default_wood.png",
drawtype = "plantlike", "default_wood.png",
groups = {flammable = 2, not_in_creative_inventory = 1}, "default_wood.png^vines_rope.png",
sounds = default.node_sound_leaves_defaults(), "default_wood.png^vines_rope.png",
selection_box = { },
type = "fixed", groups = {flammable = 2, choppy = 2, oddly_breakable_by_hand = 1},
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
})
minetest.register_node("vines:rope_end", { after_place_node = function(pos)
description = S("Rope"),
walkable = false,
climbable = true,
sunlight_propagates = true,
paramtype = "light",
drop = {},
tiles = {"vines_rope_end.png"},
drawtype = "plantlike",
groups = {flammable = 2, not_in_creative_inventory = 1},
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos) local p = {x = pos.x, y = pos.y - 1, z = pos.z}
local n = minetest.get_node(p)
local yesh = {x = pos.x, y = pos.y - 1, z = pos.z} if n.name == "air" then
minetest.add_node(p, {name = "vines:rope_end"})
end
end,
minetest.add_node(yesh, {name = "vines:rope"}) after_dig_node = function(pos, node, digger)
end,
selection_box = { local p = {x = pos.x, y = pos.y - 1, z = pos.z}
type = "fixed", local n = minetest.get_node(p)
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
on_construct = function(pos) while n.name == 'vines:rope' or n.name == 'vines:rope_end' do
local timer = minetest.get_node_timer(pos) minetest.remove_node(p)
timer:start(1) p = {x = p.x, y = p.y - 1, z = p.z}
end, n = minetest.get_node(p)
end
end
})
on_timer = function( pos, elapsed ) minetest.register_node("vines:rope", {
description = S("Rope"),
walkable = false,
climbable = true,
sunlight_propagates = true,
paramtype = "light",
drop = {},
tiles = {"vines_rope.png"},
drawtype = "plantlike",
groups = {flammable = 2, not_in_creative_inventory = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
})
local p = {x = pos.x, y = pos.y - 1, z = pos.z} minetest.register_node("vines:rope_end", {
local n = minetest.get_node(p) description = S("Rope"),
walkable = false,
climbable = true,
sunlight_propagates = true,
paramtype = "light",
drop = {},
tiles = {"vines_rope_end.png"},
drawtype = "plantlike",
groups = {flammable = 2, not_in_creative_inventory = 1},
sounds = default.node_sound_leaves_defaults(),
if n.name == "air" then after_place_node = function(pos)
minetest.set_node(pos, {name = "vines:rope"}) local yesh = {x = pos.x, y = pos.y - 1, z = pos.z}
minetest.add_node(p, {name = "vines:rope_end"})
else minetest.add_node(yesh, {name = "vines:rope"})
end,
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
on_construct = function(pos)
local timer = minetest.get_node_timer(pos) local timer = minetest.get_node_timer(pos)
timer:start(1) timer:start(1)
end,
on_timer = function( pos, elapsed )
local p = {x = pos.x, y = pos.y - 1, z = pos.z}
local n = minetest.get_node(p)
if n.name == "air" then
minetest.set_node(pos, {name = "vines:rope"})
minetest.add_node(p, {name = "vines:rope_end"})
else
local timer = minetest.get_node_timer(pos)
timer:start(1)
end
end end
end })
}) end
-- SHEARS -- SHEARS
minetest.register_tool("vines:shears", { minetest.register_tool("vines:shears", {
description = S("Shears"), description = S("Shears"),
inventory_image = "vines_shears.png", inventory_image = "vines_shears.png",
@ -308,108 +356,144 @@ minetest.register_tool("vines:shears", {
}, },
}) })
-- VINES minetest.register_craft({
local spawn_root_surfaces = {} output = 'vines:shears',
recipe = {
if enable_roots ~= false then {'', 'default:steel_ingot', ''},
spawn_root_surfaces = { {'group:stick', 'group:wood', 'default:steel_ingot'},
"default:dirt_with_grass", {'', '', 'group:stick'}
"default:dirt"
} }
})
-- ROOT VINES
if enable_roots ~= false then
vines.register_vine('root',
{description = S("Roots"), average_length = 9}, {
check_air = false,
avoid_nodes = {"vines:root_middle"},
avoid_radius = 5,
surface = {
"default:dirt_with_grass",
"default:dirt"
},
spawn_on_bottom = true,
plantlife_limit = -0.6,
rarity = rarity_roots,
tries = 3,
humidity_min = 0.4,
temp_min = 0.4,
})
else
minetest.register_alias('vines:root_middle', 'air')
minetest.register_alias('vines:root_end', 'air')
end end
vines.register_vine('root', -- STANDARD VINES
{description = S("Roots"), average_length = 9}, { if enable_standard ~= false then
choose_random_wall = true, vines.register_vine('vine',
avoid_nodes = {"vines:root_middle"}, {description = S("Vines"), average_length = 5}, {
avoid_radius = 5, check_air = false,
spawn_delay = 500, avoid_nodes = {"group:vines"},
spawn_chance = 10, avoid_radius = 5,
spawn_surfaces = spawn_root_surfaces, surface = {
spawn_on_bottom = true, -- "default:leaves",
plantlife_limit = -0.6, "default:jungleleaves",
humidity_min = 0.4, "moretrees:jungletree_leaves_red",
}) "moretrees:jungletree_leaves_yellow",
"moretrees:jungletree_leaves_green"
},
spawn_on_bottom = true,
plantlife_limit = -0.9,
rarity = rarity_standard,
tries = 1,
humidity_min = 0.7,
temp_min = 0.4,
})
else
minetest.register_alias('vines:vine_middle', 'air')
minetest.register_alias('vines:vine_end', 'air')
end
vines.register_vine('vine', -- SIDE VINES
{description = S("Vines"), average_length = 5}, { if enable_side ~= false then
choose_random_wall = true, vines.register_vine('side',
avoid_nodes = {"group:vines"}, {description = S("Vines"), average_length = 6}, {
avoid_radius = 5, check_air = false,
spawn_delay = 500, avoid_nodes = {"group:vines", "default:apple"},
spawn_chance = 100, avoid_radius = 3,
spawn_surfaces = { surface = {
-- "default:leaves", -- "default:leaves",
"default:jungleleaves", "default:jungleleaves",
"moretrees:jungletree_leaves_red", "moretrees:jungletree_leaves_red",
"moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_yellow",
"moretrees:jungletree_leaves_green" "moretrees:jungletree_leaves_green"
}, },
spawn_on_bottom = true, spawn_on_side = true,
plantlife_limit = -0.9, plantlife_limit = -0.9,
humidity_min = 0.7, rarity = rarity_side,
}) tries = 1,
humidity_min = 0.4,
temp_min = 0.4,
})
else
minetest.register_alias('vines:side_middle', 'air')
minetest.register_alias('vines:side_end', 'air')
end
vines.register_vine('side', -- JUNGLE VINES
{description = S("Vines"), average_length = 6}, { if enable_jungle ~= false then
choose_random_wall = true, vines.register_vine("jungle",
avoid_nodes = {"group:vines", "default:apple"}, {description = S("Jungle Vines"), average_length = 7}, {
avoid_radius = 3, check_air = false,
spawn_delay = 500, near_nodes = {
spawn_chance = 100, "default:jungleleaves",
spawn_surfaces = { "moretrees:jungletree_leaves_red",
-- "default:leaves", "moretrees:jungletree_leaves_yellow",
"default:jungleleaves", "moretrees:jungletree_leaves_green"
"moretrees:jungletree_leaves_red", },
"moretrees:jungletree_leaves_yellow", near_nodes_size = 4,
"moretrees:jungletree_leaves_green" near_nodes_vertical = 4,
}, avoid_nodes = {
spawn_on_side = true, "vines:jungle_middle",
plantlife_limit = -0.9, "vines:jungle_end",
humidity_min = 0.4, },
}) avoid_radius = 5,
surface = {
"default:jungletree",
"moretrees:jungletree_trunk"
},
spawn_on_side = true,
plantlife_limit = -0.9,
rarity = rarity_jungle,
tries = 1,
humidity_min = 0.2,
temp_min = 0.3,
})
else
minetest.register_alias('vines:jungle_middle', 'air')
minetest.register_alias('vines:jungle_end', 'air')
end
vines.register_vine("jungle", -- WILLOW VINES
{description = S("Jungle Vines"), average_length = 7}, { if enable_willow ~= false then
choose_random_wall = true, vines.register_vine( 'willow',
neighbors = { {description = S("Willow Vines"), average_length = 9}, {
"default:jungleleaves", check_air = false,
"moretrees:jungletree_leaves_red", avoid_nodes = {"vines:willow_middle"},
"moretrees:jungletree_leaves_yellow", avoid_radius = 5,
"moretrees:jungletree_leaves_green" near_nodes = {'default:water_source'},
}, near_nodes_size = 1,
avoid_nodes = { near_nodes_count = 1,
"vines:jungle_middle", near_nodes_vertical = 7,
"vines:jungle_end", plantlife_limit = -0.8,
}, spawn_on_side = true,
avoid_radius = 5, surface = {"moretrees:willow_leaves"},
spawn_delay = 500, rarity = rarity_willow,
spawn_chance = 100, tries = 1,
spawn_surfaces = { humidity_min = 0.5,
"default:jungletree", temp_min = 0.5,
"moretrees:jungletree_trunk" })
}, else
spawn_on_side = true, minetest.register_alias('vines:willow_middle', 'air')
plantlife_limit = -0.9, minetest.register_alias('vines:willow_end', 'air')
humidity_min = 0.2, end
})
vines.register_vine( 'willow',
{description = S("Willow Vines"), average_length = 9}, {
choose_random_wall = true,
avoid_nodes = {"vines:willow_middle"},
avoid_radius = 5,
near_nodes = {'default:water_source'},
near_nodes_size = 1,
near_nodes_count = 1,
near_nodes_vertical = 7,
plantlife_limit = -0.8,
spawn_chance = 10,
spawn_delay = 500,
spawn_on_side = true,
spawn_surfaces = {"moretrees:willow_leaves"},
humidity_min = 0.5
})
print("[Vines] Loaded!")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 59 KiB

41
vines/settingtypes.txt Normal file
View File

@ -0,0 +1,41 @@
#Enable the vines item
vines_enable_vines (Enable vines item) bool true
#Enables ropes made of vine.
vines_enable_rope (Enable vine ropes) bool true
#Enables root vines.
vines_enable_roots (Enable root vines) bool true
#Rarity of root vines, from 1 to 100, higher numbers are rarer.
vines_rarity_roots (Rarity of roots vines) float 95 0 100
#Enables the standard type of vines.
vines_enable_standard (Enable standard vines) bool true
#Rarity of standard vines, from 1 to 100, higher numbers are rarer.
vines_rarity_standard (Rarity of standard vines) float 95 0 100
#Enables the type of vines that grow on the sides of leaf blocks.
vines_enable_side (Enable side vines) bool true
#Rarity of side vines, from 1 to 100, higher numbers are rarer.
vines_rarity_side (Rarity of side vines) float 95 0 100
#Enables jungle style vines.
vines_enable_jungle (Enable jungle vines) bool true
#Rarity of jungle vines, from 1 to 100, higher numbers are rarer.
vines_rarity_jungle (Rarity of jungle vines) float 95 0 100
#Enables willow vines.
vines_enable_willow (Enable willow vines) bool true
#Rarity of willow vines, from 1 to 100, higher numbers are rarer.
vines_rarity_willow (Rarity of willow vines) float 95 0 100
#Vine growth speed, minimum number of seconds between each growth.
vines_growth_min (Minimum number of seconds between growth) int 180 1 3600
#Vine growth speed, maximum number of seconds between each growth.
vines_growth_max (Maximum number of seconds between growth) int 360 1 3600

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 225 B

Some files were not shown because too many files have changed in this diff Show More