Compare commits
124 Commits
Author | SHA1 | Date |
---|---|---|
bri cassa | ee51e847df | |
bri cassa | cd93d09d01 | |
wsor4035 | 54a3e1d98b | |
Niklp | a6c8e4a9d3 | |
Niklp09 | e9eb1f51e8 | |
wsor4035 | fc1d05978e | |
Niklp09 | 9aa5d85218 | |
Niklp | fbd4aaf034 | |
Niklp | 3fce92a9f5 | |
Niklp | 46608a7fb9 | |
OgelGames | ab9a912598 | |
Niklp | 72572bb5c8 | |
Niklp | 6a3c47157f | |
Niklp | 9e771e2988 | |
Niklp | 69e272cd64 | |
wsor4035 | 12cfbe3cb5 | |
Niklp | 2af1d996d2 | |
wsor4035 | 3b7fa4e8ea | |
wsor4035 | 877d94dace | |
wsor4035 | ded2685047 | |
Niklp | e58042acd0 | |
Wuzzy | f4185762d5 | |
Niklp | c7f65aac83 | |
wsor4035 | d9782771c3 | |
wsor4035 | d483c2a1ae | |
wsor4035 | c6b1ce5ca5 | |
wsor4035 | 23d04af7d6 | |
bri cassa | ac33f684b2 | |
unknown | 577404c850 | |
fluxionary | a2cbc18351 | |
jolesh | 9483fee7b3 | |
fluxionary | 1894d91609 | |
fluxionary | 438a1adb32 | |
fluxionary | e159b843d2 | |
Niklp | 6e842d9b0d | |
reusityback | 8287ae2476 | |
bri cassa | 079a5c1ff8 | |
Niklp | ca2b47492e | |
Niklp | f5490e3b58 | |
bri cassa | 156d31280a | |
Sirrobzeroone | bde2082ee1 | |
A S Lewis | d33907ca75 | |
fluxionary | 244d5da0e2 | |
bri cassa | 183c043066 | |
OgelGames | 8de8b889c2 | |
wsor4035 | 1d71e2c64e | |
bri cassa | 3239650e68 | |
wsor4035 | d3edfbeace | |
wsor4035 | c82ba38e68 | |
nixnoxus | 031d5f4e4e | |
nixnoxus | 32bab30e1f | |
Jordan Leppert | 7094d8a369 | |
unknown | c990942ba2 | |
Jordan Leppert | 4953b1ba54 | |
Jordan Leppert | cb2373f089 | |
Jordan Leppert | 1a96ac87a7 | |
Jordan Leppert | a6dc4890d9 | |
wsor4035 | a5b752f8b2 | |
Jordan Leppert | 4c48e5be29 | |
Jordan Leppert | a7d0e42cd1 | |
Jordan Leppert | 2e4e4a2412 | |
Jordan Leppert | 1d3751d755 | |
Jordan Leppert | e2486ca7f5 | |
Jordan Leppert | 98f0c6c20f | |
Jordan Leppert | 54d3b669be | |
Jordan Leppert | 93265656cc | |
Jordan Leppert | c76fd45a2c | |
Jordan Leppert | c7d0fd3c53 | |
Jordan Leppert | a66b82f1f0 | |
Jordan Leppert | 63914caed1 | |
Jordan Leppert | ba98359dd0 | |
Jordan Leppert | 6df36da4e1 | |
Jordan Leppert | 28ef3e0c4b | |
bri cassa | 6bdb533906 | |
bri cassa | c62610f544 | |
bri cassa | 8e2148ffc3 | |
Vanessa Dannenberg | 680b02f7e2 | |
Vanessa Dannenberg | a2976c609a | |
Vanessa Dannenberg | 46717958bc | |
bri cassa | 5ac025cda4 | |
Vanessa Dannenberg | 52b2d18523 | |
bri cassa | efe869d386 | |
bri cassa | b597f99014 | |
Vanessa Dannenberg | bfd08f01c8 | |
Vanessa Dannenberg | 9ed4771515 | |
Vanessa Dannenberg | 3f107a8067 | |
Vanessa Dannenberg | b3cbd3df2e | |
Vanessa Dannenberg | b1b4a08834 | |
Vanessa Dannenberg | f01e4bb55f | |
bri cassa | 637f96e215 | |
Vanessa Dannenberg | 7b4f54ead0 | |
Vanessa Dannenberg | c061ef23cf | |
Oversword | d87d8e51f5 | |
bri cassa | fa9f30043f | |
Vanessa Dannenberg | 70df655a42 | |
Vanessa Dannenberg | 4876fc1265 | |
Vanessa Dannenberg | 81b2b0898b | |
Sys Quatre | d97f25e112 | |
Vanessa Dannenberg | a750bac532 | |
Tin Švagelj | b4b24dedba | |
Sys Quatre | 86896848d5 | |
VanessaE | 622016713e | |
Sys Quatre | 5b66d54632 | |
Sys Quatre | 031260a62d | |
Sys Quatre | d4e83d7e78 | |
Sys Quatre | 8d65559828 | |
Sys Quatre | ec8132b06c | |
Sys Quatre | 4dcf14ce1f | |
Sys Quatre | d7b543f5d7 | |
Sys Quatre | f661500cb3 | |
Sys Quatre | c2681261e0 | |
Sys Quatre | 2c433e0b57 | |
Sys Quatre | 1f52bbea19 | |
Sys Quatre | 10ff005066 | |
VanessaE | 9963e588d6 | |
Sys Quatre | 80b548535a | |
Vanessa Dannenberg | 686dd21b9d | |
Louis Royer | 47c20dc550 | |
Sys Quatre | 45a8064d3d | |
Vanessa Dannenberg | 31e0066238 | |
Vanessa Dannenberg | 3d13053d97 | |
Sys Quatre | 1696d8bd8f | |
Vanessa Dannenberg | 07b6fc48ea | |
Pierre-Adrien Langrognet | 9a3d101c89 |
|
@ -0,0 +1,13 @@
|
|||
name: luacheck
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
luacheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: apt
|
||||
run: sudo apt-get install -y luarocks
|
||||
- name: luacheck install
|
||||
run: luarocks install --local luacheck
|
||||
- name: luacheck run
|
||||
run: $HOME/.luarocks/bin/luacheck ./
|
|
@ -1 +0,0 @@
|
|||
*~
|
24
.luacheckrc
|
@ -1,15 +1,21 @@
|
|||
unused_args = false
|
||||
allow_defined_top = true
|
||||
max_line_length = 185
|
||||
|
||||
read_globals = {
|
||||
exclude_files = {".luacheckrc"}
|
||||
|
||||
globals = {
|
||||
"biome_lib",
|
||||
"DIR_DELIM",
|
||||
"minetest", "core",
|
||||
"dump",
|
||||
"vector", "nodeupdate",
|
||||
"VoxelManip", "VoxelArea",
|
||||
"PseudoRandom", "ItemStack",
|
||||
"intllib",
|
||||
"default",
|
||||
"bushes_classic",
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
table = {fields = {"copy"}},
|
||||
|
||||
"minetest", "ItemStack",
|
||||
"vector",
|
||||
|
||||
"default",
|
||||
"moretrees",
|
||||
"dump",
|
||||
}
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
default
|
||||
flowers
|
|
@ -1,7 +1,5 @@
|
|||
-- 3D Mushroom mod by VanessaE
|
||||
|
||||
mushroom = {}
|
||||
|
||||
minetest.override_item("flowers:mushroom_fertile_brown", {
|
||||
drawtype = "mesh",
|
||||
mesh = "3dmushrooms.obj",
|
||||
|
@ -10,7 +8,8 @@ minetest.override_item("flowers:mushroom_fertile_brown", {
|
|||
type = "fixed",
|
||||
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", {
|
||||
|
@ -21,7 +20,8 @@ minetest.override_item("flowers:mushroom_brown", {
|
|||
type = "fixed",
|
||||
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", {
|
||||
|
@ -32,7 +32,8 @@ minetest.override_item("flowers:mushroom_fertile_red", {
|
|||
type = "fixed",
|
||||
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", {
|
||||
|
@ -43,7 +44,8 @@ minetest.override_item("flowers:mushroom_red", {
|
|||
type = "fixed",
|
||||
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
|
||||
|
@ -61,5 +63,3 @@ minetest.register_alias("mushroom:spore1", "flowers:mushroom_spores_red")
|
|||
minetest.register_alias("mushroom:poison", "flowers:mushroom_red")
|
||||
|
||||
minetest.register_alias("mushroom:identifier", "default:mese_crystal_fragment")
|
||||
|
||||
print("[3D Mushrooms] loaded.")
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
name = 3dmushrooms
|
||||
depends = flowers
|
|
@ -1,3 +0,0 @@
|
|||
default
|
||||
biome_lib
|
||||
flowers_plus?
|
|
@ -1,9 +0,0 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Along the Shore"
|
||||
local version = "0.0.4"
|
||||
local mname = "along_shore"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
||||
-----------------------------------------------------------------------------------------------
|
Before Width: | Height: | Size: 234 B |
|
@ -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
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
Before Width: | Height: | Size: 439 B |
Before Width: | Height: | Size: 305 B |
Before Width: | Height: | Size: 74 B |
Before Width: | Height: | Size: 305 B |
Before Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 543 B |
Before Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 424 B |
Before Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 543 B |
|
@ -1,5 +0,0 @@
|
|||
default
|
||||
biome_lib
|
||||
plantlife_i18n
|
||||
stonage?
|
||||
sumpf?
|
201
bushes/init.lua
|
@ -7,8 +7,10 @@
|
|||
-- Branch textures created by Neuromancer.
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
abstract_bushes = {}
|
||||
local S = minetest.get_translator("bushes")
|
||||
|
||||
local bush_rarity = minetest.settings:get("bushes.bush_rarity") or 0.008
|
||||
local youngtree_rarity = minetest.settings:get("youngtree.bush_rarity") or 0.006
|
||||
|
||||
minetest.register_node("bushes:youngtree2_bottom", {
|
||||
description = S("Young Tree 2 (bottom)"),
|
||||
|
@ -22,11 +24,10 @@ paramtype = "light",
|
|||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--{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
|
||||
}
|
||||
},
|
||||
groups = {snappy=3,flammable=2},
|
||||
groups = {snappy=3,flammable=2,attached_node=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = 'default:stick'
|
||||
})
|
||||
|
@ -42,6 +43,7 @@ for i in pairs(BushBranchCenter) do
|
|||
"bushes_leaves_"..TexNum..".png",
|
||||
"bushes_branches_center_"..TexNum..".png"
|
||||
},
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
|
@ -61,7 +63,8 @@ for i in pairs(BushBranchCenter) do
|
|||
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
leaves=1
|
||||
leaves=1,
|
||||
attached_node=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = 'default:stick 4'
|
||||
|
@ -83,6 +86,7 @@ for i in pairs(BushBranchSide) do
|
|||
--[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different
|
||||
--[[front]] "bushes_branches_right_"..TexNum..".png"
|
||||
},
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
|
@ -104,7 +108,8 @@ for i in pairs(BushBranchSide) do
|
|||
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
leaves=1
|
||||
leaves=1,
|
||||
attached_node=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = 'default:stick 3'
|
||||
|
@ -118,55 +123,24 @@ for i in pairs(BushLeafNode) do
|
|||
description = S("Bush Leaves @1", Num),
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = {"bushes_leaves_"..Num..".png"},
|
||||
use_texture_alpha = "clip",
|
||||
paramtype = "light",
|
||||
groups = { -- MM: Should we add leafdecay?
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1
|
||||
attached_node=1,
|
||||
leaves=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
abstract_bushes.grow_bush = function(pos)
|
||||
local leaf_type = math.random(1,2)
|
||||
local bush_side_height = math.random(0,1)
|
||||
local chance_of_bush_node_right = math.random(1,10)
|
||||
if chance_of_bush_node_right> 5 then
|
||||
local right_pos = {x=pos.x+1, y=pos.y+bush_side_height, z=pos.z}
|
||||
abstract_bushes.grow_bush_node(right_pos,3,leaf_type)
|
||||
end
|
||||
local chance_of_bush_node_left = math.random(1,10)
|
||||
if chance_of_bush_node_left> 5 then
|
||||
bush_side_height = math.random(0,1)
|
||||
local left_pos = {x=pos.x-1, y=pos.y+bush_side_height, z=pos.z}
|
||||
abstract_bushes.grow_bush_node(left_pos,1,leaf_type)
|
||||
end
|
||||
local chance_of_bush_node_front = math.random(1,10)
|
||||
if chance_of_bush_node_front> 5 then
|
||||
bush_side_height = math.random(0,1)
|
||||
local front_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z+1}
|
||||
abstract_bushes.grow_bush_node(front_pos,2,leaf_type)
|
||||
end
|
||||
local chance_of_bush_node_back = math.random(1,10)
|
||||
if chance_of_bush_node_back> 5 then
|
||||
bush_side_height = math.random(0,1)
|
||||
local back_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z-1}
|
||||
abstract_bushes.grow_bush_node(back_pos,0,leaf_type)
|
||||
end
|
||||
|
||||
abstract_bushes.grow_bush_node(pos,5,leaf_type)
|
||||
end
|
||||
|
||||
abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
|
||||
|
||||
|
||||
local function grow_bush_node(pos, dir, leaf_type)
|
||||
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 bush_branch_type = 2
|
||||
|
||||
-- MM: I'm not sure if it's slower now than before...
|
||||
if dir ~= 5 and leaf_type == 1 then
|
||||
bush_branch_type = 2
|
||||
end
|
||||
|
@ -182,54 +156,108 @@ abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
|
|||
dir = 1
|
||||
end
|
||||
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||
local nodename = minetest.get_node(right_here).name
|
||||
if nodename == "air" or nodename == "default:junglegrass" then -- instead of check_air = true,
|
||||
minetest.swap_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir})
|
||||
--minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")")
|
||||
minetest.swap_node(above_right_here, {name="bushes:BushLeaves"..leaf_type})
|
||||
|
||||
local chance_of_high_leaves = math.random(1,10)
|
||||
if chance_of_high_leaves > 5 then
|
||||
local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z}
|
||||
--minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")")
|
||||
minetest.swap_node(two_above_right_here, {name="bushes:BushLeaves"..leaf_type})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function grow_bush(pos)
|
||||
-- replace possible grass nodes
|
||||
minetest.swap_node({x=pos.x, y=pos.y+1, z=pos.z}, {name="air"})
|
||||
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
local leaf_type = math.random(1,2)
|
||||
local bush_side_height = math.random(0,1)
|
||||
|
||||
local chance_of_bush_node_right = math.random(1,10)
|
||||
if chance_of_bush_node_right > 5 then
|
||||
local right_pos = {x=pos.x+1, y=pos.y+bush_side_height, z=pos.z}
|
||||
grow_bush_node(right_pos,3,leaf_type)
|
||||
end
|
||||
|
||||
local chance_of_bush_node_left = math.random(1,10)
|
||||
if chance_of_bush_node_left > 5 then
|
||||
local left_pos = {x=pos.x-1, y=pos.y+bush_side_height, z=pos.z}
|
||||
grow_bush_node(left_pos,1,leaf_type)
|
||||
end
|
||||
|
||||
local chance_of_bush_node_front = math.random(1,10)
|
||||
if chance_of_bush_node_front > 5 then
|
||||
local front_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z+1}
|
||||
grow_bush_node(front_pos,2,leaf_type)
|
||||
end
|
||||
|
||||
local chance_of_bush_node_back = math.random(1,10)
|
||||
if chance_of_bush_node_back > 5 then
|
||||
local back_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z-1}
|
||||
grow_bush_node(back_pos,0,leaf_type)
|
||||
end
|
||||
|
||||
grow_bush_node(pos,5,leaf_type)
|
||||
end
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "bushes:bush",
|
||||
decoration = {
|
||||
"air"
|
||||
},
|
||||
fill_ratio = bush_rarity,
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 15, --10,15
|
||||
rarity = 101 - 4, --3,4
|
||||
min_elevation = 1, -- above sea level
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_bushes.grow_bush
|
||||
)
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
})
|
||||
|
||||
abstract_bushes.grow_youngtree2 = function(pos)
|
||||
local height = math.random(4,5)
|
||||
abstract_bushes.grow_youngtree_node2(pos,height)
|
||||
--[[
|
||||
this is purposefully wrapped in a on mods loaded callback to that it gets the proper ids
|
||||
if other mods clear the registered decorations
|
||||
]]
|
||||
local did
|
||||
minetest.register_on_mods_loaded(function()
|
||||
did = minetest.get_decoration_id("bushes:bush")
|
||||
minetest.set_gen_notify("decoration", {did})
|
||||
end)
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
local g = minetest.get_mapgen_object("gennotify")
|
||||
local locations = {}
|
||||
|
||||
local deco_locations = g["decoration#" .. did] or {}
|
||||
for _, pos in pairs(deco_locations) do
|
||||
locations[#locations+1] = pos
|
||||
end
|
||||
|
||||
abstract_bushes.grow_youngtree_node2 = function(pos, height)
|
||||
|
||||
if #locations == 0 then return end
|
||||
for _, pos in ipairs(locations) do
|
||||
grow_bush(pos)
|
||||
end
|
||||
end)
|
||||
|
||||
local function grow_youngtree_node2(pos, height)
|
||||
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 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}
|
||||
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||
local nodename = minetest.get_node(right_here).name
|
||||
if nodename == "air" or nodename == "default:junglegrass" then -- instead of check_air = true,
|
||||
if height == 4 then
|
||||
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}
|
||||
|
||||
minetest.swap_node(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})
|
||||
|
@ -237,26 +265,55 @@ abstract_bushes.grow_youngtree_node2 = function(pos, height)
|
|||
minetest.swap_node(three_above_right_here, {name="bushes:BushLeaves1" })
|
||||
minetest.swap_node(three_above_right_here_south, {name="bushes:BushLeaves1" })
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local function grow_youngtree2(pos)
|
||||
local height = math.random(4,5)
|
||||
grow_youngtree_node2(pos,height)
|
||||
end
|
||||
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
minetest.register_decoration({
|
||||
name = "bushes:youngtree",
|
||||
decoration = {
|
||||
"air"
|
||||
},
|
||||
fill_ratio = youngtree_rarity,
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 55, --10,15
|
||||
rarity = 101 - 4, --3,4
|
||||
min_elevation = 1, -- above sea level
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_bushes.grow_youngtree2
|
||||
)
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
})
|
||||
|
||||
--http://dev.minetest.net/Node_Drawtypes
|
||||
--[[
|
||||
this is purposefully wrapped in a on mods loaded callback to that it gets the proper ids
|
||||
if other mods clear the registered decorations
|
||||
]]
|
||||
local did2
|
||||
minetest.register_on_mods_loaded(function()
|
||||
did2 = minetest.get_decoration_id("bushes:youngtree")
|
||||
minetest.set_gen_notify("decoration", {did2})
|
||||
end)
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
local g = minetest.get_mapgen_object("gennotify")
|
||||
local locations = {}
|
||||
|
||||
local deco_locations = g["decoration#" .. did2] or {}
|
||||
for _, pos in pairs(deco_locations) do
|
||||
locations[#locations+1] = pos
|
||||
end
|
||||
|
||||
if #locations == 0 then return end
|
||||
for _, pos in ipairs(locations) do
|
||||
grow_youngtree2(pos)
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.log("action", "[bushes] loaded.")
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bushes
|
||||
Young Tree 2 (bottom)=Strauch 2 (Ansatz)
|
||||
Bush Branches @1=Buschäste @1
|
||||
Bush Leaves @1=Buschblätter @1
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bushes
|
||||
Young Tree 2 (bottom)=Juna Arbo 2 (malsupro)
|
||||
Bush Branches @1=Arbustaj Branĉoj @1
|
||||
Bush Leaves @1=Arbustaj Folioj @1
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bushes
|
||||
Young Tree 2 (bottom)=Arbuste 2 (bas)
|
||||
Bush Branches @1=Branches de buisson @1
|
||||
Bush Leaves @1=Feuilles de buisson @1
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bushes
|
||||
Young Tree 2 (bottom)=
|
||||
Bush Branches @1=
|
||||
Bush Leaves @1=
|
|
@ -0,0 +1,4 @@
|
|||
name = bushes
|
||||
title = Bushes
|
||||
depends = default
|
||||
optional_depends = stoneage, sumpf, ebiomes
|
|
@ -0,0 +1,5 @@
|
|||
# Bush rarity (higher number -> higher probability)
|
||||
bushes.bush_rarity (Bush rarity) float 0.008 0.0001 1
|
||||
|
||||
# Youngtree rarity (higher number -> higher probability)
|
||||
bushes.youngtree_rarity (Youngtree rarity) float 0.006 0.0001 1
|
|
@ -1,5 +1,5 @@
|
|||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("bushes_classic")
|
||||
|
||||
-- Basket
|
||||
|
||||
|
@ -33,9 +33,12 @@ end
|
|||
|
||||
-- override farming_plus strawberry and add food_ group
|
||||
if minetest.get_modpath("farming_plus") then
|
||||
local groups = table.copy(minetest.registered_items["farming_plus:strawberry_item"].groups)
|
||||
groups["food_strawberry"] = 1
|
||||
groups["food_berry"] = 1
|
||||
|
||||
minetest.override_item("farming_plus:strawberry_item", {
|
||||
groups = {food_strawberry = 1, food_berry = 1, flammable = 2},
|
||||
groups = groups,
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
biome_lib
|
||||
plantlife_i18n
|
||||
farming?
|
||||
farming_plus?
|
|
@ -4,7 +4,7 @@
|
|||
bushes_classic = {}
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("bushes_classic")
|
||||
|
||||
bushes_classic.bushes = {
|
||||
"strawberry",
|
||||
|
@ -30,12 +30,19 @@ local modpath = minetest.get_modpath('bushes_classic')
|
|||
dofile(modpath..'/cooking.lua')
|
||||
dofile(modpath..'/nodes.lua')
|
||||
|
||||
biome_lib:spawn_on_surfaces({
|
||||
spawn_delay = 3600,
|
||||
spawn_plants = bushes_classic.spawn_list,
|
||||
avoid_radius = 10,
|
||||
spawn_chance = 100,
|
||||
spawn_surfaces = {
|
||||
local spawn_plants = bushes_classic.spawn_list
|
||||
|
||||
local function get_biome_data(pos, perlin_fertile)
|
||||
local fertility = perlin_fertile:get_2d({x=pos.x, y=pos.z})
|
||||
|
||||
local data = minetest.get_biome_data(pos)
|
||||
-- Original values this method returned were +1 (lowest) to -1 (highest)
|
||||
-- so we need to convert the 0-100 range from get_biome_data() to that.
|
||||
return fertility, 1 - (data.heat / 100 * 2), 1 - (data.humidity / 100 * 2)
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {
|
||||
"default:dirt_with_grass",
|
||||
"woodsoils:dirt_with_leaves_1",
|
||||
"woodsoils:grass_with_leaves_1",
|
||||
|
@ -43,16 +50,31 @@ biome_lib:spawn_on_surfaces({
|
|||
"farming:soil",
|
||||
"farming:soil_wet"
|
||||
},
|
||||
avoid_nodes = {"group:bush"},
|
||||
seed_diff = 545342534, -- chosen by a fair mashing of the keyboard - guaranteed to be random :P
|
||||
plantlife_limit = -0.1,
|
||||
light_min = 10,
|
||||
temp_min = 0.15, -- approx 20C
|
||||
temp_max = -0.15, -- approx 35C
|
||||
humidity_min = 0, -- 50% RH
|
||||
humidity_max = -1, -- 100% RH
|
||||
interval = 3600,
|
||||
chance = 100,
|
||||
label = "[bushes_classic] spawn bushes",
|
||||
min_y = -16,
|
||||
max_y = 48,
|
||||
action = function(pos, node)
|
||||
local p_top = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local n_top = minetest.get_node_or_nil(p_top)
|
||||
if not n_top or n_top.name ~= "air" then return end
|
||||
|
||||
local perlin_fertile_area = minetest.get_perlin(545342534, 3, 0.6, 100)
|
||||
|
||||
local fertility, temperature, humidity = get_biome_data(pos, perlin_fertile_area)
|
||||
|
||||
local pos_biome_ok = fertility > -0.1 and temperature <= 0.15 and temperature >= -0.15 and humidity <= 0 and humidity >= -1
|
||||
if not pos_biome_ok then return end
|
||||
|
||||
if minetest.find_node_near(p_top, 10 + math.random(-1.5,2), {"group:bush"}) then
|
||||
return -- Nodes to avoid are nearby
|
||||
end
|
||||
|
||||
local plant_to_spawn = spawn_plants[math.random(1, #spawn_plants)]
|
||||
|
||||
minetest.swap_node(p_top, {name = plant_to_spawn, param2 = 0})
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_alias("bushes:basket_pies", "bushes:basket_strawberry")
|
||||
|
||||
print(S("[Bushes_classic] Loaded."))
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
# textdomain: bushes_classic
|
||||
Sugar=Zucker
|
||||
Strawberry=Erdbeere
|
||||
Raw Strawberry pie=Rohe Erdbeertorte
|
||||
Cooked Strawberry pie=Erdbeertorte
|
||||
Slice of Strawberry pie=Erdbeertortenstück
|
||||
Basket with Strawberry pies=Korb mit Erdbeertorten
|
||||
Strawberry Bush=Erdbeerbusch
|
||||
Blackberry=Brombeere
|
||||
Raw Blackberry pie=Rohe Brombeertorte
|
||||
Cooked Blackberry pie=Brombeertorte
|
||||
Slice of Blackberry pie=Brombeertortenstück
|
||||
Basket with Blackberry pies=Korb mit Brombeertorten
|
||||
Blackberry Bush=Brombeerbusch
|
||||
Blueberry=Blaubeere
|
||||
Raw Blueberry pie=Rohe Blaubeertorte
|
||||
Cooked Blueberry pie=Blaubeertorte
|
||||
Slice of Blueberry pie=Blaubeertortenstück
|
||||
Basket with Blueberry pies=Korb mit Blaubeertorten
|
||||
Blueberry Bush=Blaubeerbusch
|
||||
Raspberry=Himbeere
|
||||
Raw Raspberry pie=Rohe Himbeertorte
|
||||
Cooked Raspberry pie=Himbeertorte
|
||||
Slice of Raspberry pie=Himbeertortenstück
|
||||
Basket with Raspberry pies=Korb mit Himbeertorten
|
||||
Raspberry Bush=Himbeerbusch
|
||||
Gooseberry=Stachelbeere
|
||||
Raw Gooseberry pie=Rohe Stachelbeertorte
|
||||
Cooked Gooseberry pie=Stachelbeertorte
|
||||
Slice of Gooseberry pie=Stachelbeertortenstück
|
||||
Basket with Gooseberry pies=Korb mit Stachelbeertorten
|
||||
Gooseberry Bush=Stachelbeerbusch
|
||||
Mixed Berry=Beerenmix
|
||||
Raw Mixed Berry pie=Rohe Beerenmixtorte
|
||||
Cooked Mixed Berry pie=Beerenmixtorte
|
||||
Slice of Mixed Berry pie=Beerenmixtortenstück
|
||||
Basket with Mixed Berry pies=Korb mit Beerenmixtorten
|
||||
Currently fruitless Bush=Zur Zeit früchteloser Busch
|
||||
Basket=Korb
|
|
@ -0,0 +1,39 @@
|
|||
# textdomain: bushes_classic
|
||||
Sugar=Sukero
|
||||
Strawberry=Frago
|
||||
Raw Strawberry pie=Kruda Fragokuko
|
||||
Cooked Strawberry pie=Kuirita Fragokuko
|
||||
Slice of Strawberry pie=Tranĉaĵo de Fragokuko
|
||||
Basket with Strawberry pies=Korbo kun Fragokukoj
|
||||
Strawberry Bush=Fraga Arbusto
|
||||
Blackberry=Rubuso
|
||||
Raw Blackberry pie=Kruda Rubusokuko
|
||||
Cooked Blackberry pie=Kuirita Rubusokuko
|
||||
Slice of Blackberry pie=Tranĉaĵo de Rubusokuko
|
||||
Basket with Blackberry pies=Korbo kun Rubusokukoj
|
||||
Blackberry Bush=Rubusa Arbusto
|
||||
Blueberry=Mirtelo
|
||||
Raw Blueberry pie=Kruda Mirtelokuko
|
||||
Cooked Blueberry pie=Kuirita Mirtelokuko
|
||||
Slice of Blueberry pie=Tranĉaĵo de Mirtelokuko
|
||||
Basket with Blueberry pies=Korbo kun Mirtelokukoj
|
||||
Blueberry Bush=Mirtela Arbusto
|
||||
Raspberry=Frambo
|
||||
Raw Raspberry pie=Kruda Frambokuko
|
||||
Cooked Raspberry pie=Kuirita Frambokuko
|
||||
Slice of Raspberry pie=Tranĉaĵo de Frambokuko
|
||||
Basket with Raspberry pies=Korbo kun Frambokukoj
|
||||
Raspberry Bush=Framba Arbusto
|
||||
Gooseberry=Grosbero
|
||||
Raw Gooseberry pie=Kruda Grosberkuko
|
||||
Cooked Gooseberry pie=Kuirita Grosberkuko
|
||||
Slice of Gooseberry pie=Tranĉaĵo de Grosberkuko
|
||||
Basket with Gooseberry pies=Korbo kun Grosberkuko
|
||||
Gooseberry Bush=Grosberarbusto
|
||||
Mixed Berry=Miksita Bero
|
||||
Raw Mixed Berry pie=Kruda Miksita Bera Kuko
|
||||
Cooked Mixed Berry pie=Kuirita Miksa Beraj Kukoj
|
||||
Slice of Mixed Berry pie=Tranĉaĵo de Miksita Bera Kuko
|
||||
Basket with Mixed Berry pies=Korbo kun Miksitaj Beraj Kukoj
|
||||
Currently fruitless Bush=Nuntempe senfrukta Arbusto
|
||||
Basket=Korbo
|
|
@ -0,0 +1,39 @@
|
|||
# textdomain: bushes_classic
|
||||
Sugar=Azúcar
|
||||
Strawberry=Frutilla
|
||||
Raw Strawberry pie=Pastel de Frutilla Crudo
|
||||
Cooked Strawberry pie=Pastel de Frutilla Cocido
|
||||
Slice of Strawberry pie=Rebanada de Pastel de Frutilla
|
||||
Basket with Strawberry pies=Cesta con Pasteles de Frutilla
|
||||
Strawberry Bush=Arbusto de Frutilla
|
||||
Blackberry=Mora
|
||||
Raw Blackberry pie=Pastel de Mora Crudo
|
||||
Cooked Blackberry pie=Pastel de Mora Cocido
|
||||
Slice of Blackberry pie=Rebanada de Pastel de Mora
|
||||
Basket with Blackberry pies=Cesta con Pasteles de Mora
|
||||
Blackberry Bush=Arbusto de Mora
|
||||
Blueberry=Arándano
|
||||
Raw Blueberry pie=Pastel de Arándano Crudo
|
||||
Cooked Blueberry pie=Pastel de Arándano Cocido
|
||||
Slice of Blueberry pie=Rebanada de Pastel de Arándano
|
||||
Basket with Blueberry pies=Cesta con Pasteles de Arándano
|
||||
Blueberry Bush=Arbusto de Arándano
|
||||
Raspberry=Frambuesa
|
||||
Raw Raspberry pie=Pastel de Frambuesa Crudo
|
||||
Cooked Raspberry pie=Pastel de Frambuesa Cocido
|
||||
Slice of Raspberry pie=Rebanada de Pastel de Frambuesa
|
||||
Basket with Raspberry pies=Cesta con Pasteles de Frambuesa
|
||||
Raspberry Bush=Arbusto de Frambuesa
|
||||
Gooseberry=Grosella
|
||||
Raw Gooseberry pie=Pastel de Grosella Crudo
|
||||
Cooked Gooseberry pie=Pastel de Grosella Cocido
|
||||
Slice of Gooseberry pie=Rebanada de Pastel de Grosella
|
||||
Basket with Gooseberry pies=Cesta con Pasteles de Grosella
|
||||
Gooseberry Bush=Arbusto de Grosella
|
||||
Mixed Berry=Mezcla de Baya
|
||||
Raw Mixed Berry pie=Pastel de Mezcla de Bayas Cruda
|
||||
Cooked Mixed Berry pie=Pastel de Mezcla de Bayas Cocido
|
||||
Slice of Mixed Berry pie=Rebanada de Pastel de Mezcla de Bayas
|
||||
Basket with Mixed Berry pies=Cesta con Pasteles de Mezcla de Baya
|
||||
Currently fruitless Bush=Arbusto actualmente infructuoso
|
||||
Basket=Cesta
|
|
@ -0,0 +1,39 @@
|
|||
# textdomain: bushes_classic
|
||||
Sugar=Sucre
|
||||
Strawberry=Fraises
|
||||
Raw Strawberry pie=Tarte aux fraises (crue)
|
||||
Cooked Strawberry pie=Tarte aux fraises (cuite)
|
||||
Slice of Strawberry pie=Part de tarte aux fraises
|
||||
Basket with Strawberry pies=Panier de tartes aux fraises
|
||||
Strawberry Bush=Buisson de fraises
|
||||
Blackberry=Mûres
|
||||
Raw Blackberry pie=Tarte aux mûres (crue)
|
||||
Cooked Blackberry pie=Tarte aux mûres (cuite)
|
||||
Slice of Blackberry pie=Part de tarte aux mûres
|
||||
Basket with Blackberry pies=Panier de tartes aux fraises
|
||||
Blackberry Bush=Buisson de mûres
|
||||
Blueberry=Myrtilles
|
||||
Raw Blueberry pie=Tarte aux myrtilles (crue)
|
||||
Cooked Blueberry pie=Tarte aux myrtilles (cuite)
|
||||
Slice of Blueberry pie=Part de tarte aux myrtilles
|
||||
Basket with Blueberry pies=Panier de tartes aux mûres
|
||||
Blueberry Bush=Buisson de myrtilles
|
||||
Raspberry=Framboises
|
||||
Raw Raspberry pie=Tarte aux framboises (crue)
|
||||
Cooked Raspberry pie=Tarte aux framboises (cuite)
|
||||
Slice of Raspberry pie=Part de tarts aux framboises
|
||||
Basket with Raspberry pies=Panier de tartes aux framboises
|
||||
Raspberry Bush=Buisson de framboises
|
||||
Gooseberry=Groseilles
|
||||
Raw Gooseberry pie=Tarte aux groseilles (crue)
|
||||
Cooked Gooseberry pie=Tarte aux groseilles (cuite)
|
||||
Slice of Gooseberry pie=Part de tarte aux groseilles
|
||||
Basket with Gooseberry pies=Panier de tartes aux groseilles
|
||||
Gooseberry Bush=Buisson de groseilles
|
||||
Mixed Berry=Fruits rouges
|
||||
Raw Mixed Berry pie=Tarte aux fruits rouges (crue)
|
||||
Cooked Mixed Berry pie=Tarte aux fruits rouges (cuite)
|
||||
Slice of Mixed Berry pie=Part de tarte aux fruits rouges
|
||||
Basket with Mixed Berry pies=Panier de tartes aux fruits rouges
|
||||
Currently fruitless Bush=Buisson sans fruits pour l'instant
|
||||
Basket=Panier
|
|
@ -0,0 +1,39 @@
|
|||
# textdomain: bushes_classic
|
||||
Sugar=Şeker
|
||||
Strawberry=Çilek
|
||||
Raw Strawberry pie=Çilekli çiğ pasta
|
||||
Cooked Strawberry pie=Pişmiş çilekli pasta
|
||||
Slice of Strawberry pie=Çilekli pasta dilimi
|
||||
Basket with Strawberry pies=Çilekli pasta sepeti
|
||||
Strawberry Bush=Çilek fidanı
|
||||
Blackberry=Böğürtlen
|
||||
Raw Blackberry pie=Böğürtlenli çiğ pasta
|
||||
Cooked Blackberry pie=Pişmiş böğürtlenli pasta
|
||||
Slice of Blackberry pie=Böğürtlenli pasta dilimi
|
||||
Basket with Blackberry pies=Böğürtlenli pasta sepeti
|
||||
Blackberry Bush=Böğürtlen fidanı
|
||||
Blueberry=Yaban mersini
|
||||
Raw Blueberry pie=Yaban mersinli çiğ pasta
|
||||
Cooked Blueberry pie=Pişmiş yaban mersinli pasta
|
||||
Slice of Blueberry pie=Yaban mersinli pasta dilimi
|
||||
Basket with Blueberry pies=Yaban mersini pastalı sepet
|
||||
Blueberry Bush=Yaban mersini fidanı
|
||||
Raspberry=Ahududu
|
||||
Raw Raspberry pie=Ahududulu çiğ pasta
|
||||
Cooked Raspberry pie=Pişmiş ahududulu pasta
|
||||
Slice of Raspberry pie=Ahududulu pasta dilimi
|
||||
Basket with Raspberry pies=Ahududulu pasta sepeti
|
||||
Raspberry Bush=Ahududu fidanı
|
||||
Gooseberry=Bektaşi üzümü
|
||||
Raw Gooseberry pie=Bektaşi üzümlü çiğ pasta
|
||||
Cooked Gooseberry pie=Pişmiş bektaşi üzümlü pasta
|
||||
Slice of Gooseberry pie=Bektaşi üzümlü pasta dilimi
|
||||
Basket with Gooseberry pies=Bektaşi üzümlü pasta sepeti
|
||||
Gooseberry Bush=Bektaşi üzümü fidanı
|
||||
Mixed Berry=Dut
|
||||
Raw Mixed Berry pie=Dutlu çiğ pasta
|
||||
Cooked Mixed Berry pie=Pişmiş dutlu pasta
|
||||
Slice of Mixed Berry pie=Dutlu pasta dilimi
|
||||
Basket with Mixed Berry pies=Dutlu pasta sepeti
|
||||
Currently fruitless Bush=Fidanı şu anda meyvesiz
|
||||
Basket=Sepet
|
|
@ -0,0 +1,39 @@
|
|||
# textdomain: bushes_classic
|
||||
Sugar=
|
||||
Strawberry=
|
||||
Raw Strawberry pie=
|
||||
Cooked Strawberry pie=
|
||||
Slice of Strawberry pie=
|
||||
Basket with Strawberry pies=
|
||||
Strawberry Bush=
|
||||
Blackberry=
|
||||
Raw Blackberry pie=
|
||||
Cooked Blackberry pie=
|
||||
Slice of Blackberry pie=
|
||||
Basket with Blackberry pies=
|
||||
Blackberry Bush=
|
||||
Blueberry=
|
||||
Raw Blueberry pie=
|
||||
Cooked Blueberry pie=
|
||||
Slice of Blueberry pie=
|
||||
Basket with Blueberry pies=
|
||||
Blueberry Bush=
|
||||
Raspberry=
|
||||
Raw Raspberry pie=
|
||||
Cooked Raspberry pie=
|
||||
Slice of Raspberry pie=
|
||||
Basket with Raspberry pies=
|
||||
Raspberry Bush=
|
||||
Gooseberry=
|
||||
Raw Gooseberry pie=
|
||||
Cooked Gooseberry pie=
|
||||
Slice of Gooseberry pie=
|
||||
Basket with Gooseberry pies=
|
||||
Gooseberry Bush=
|
||||
Mixed Berry=
|
||||
Raw Mixed Berry pie=
|
||||
Cooked Mixed Berry pie=
|
||||
Slice of Mixed Berry pie=
|
||||
Basket with Mixed Berry pies=
|
||||
Currently fruitless Bush=
|
||||
Basket=
|
|
@ -0,0 +1,2 @@
|
|||
name = bushes_classic
|
||||
optional_depends = farming, farming_plus
|
|
@ -1,9 +1,11 @@
|
|||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("bushes_classic")
|
||||
|
||||
plantlife_bushes = {}
|
||||
|
||||
-- TODO: add support for nodebreakers? those dig like mese picks
|
||||
local random = math.random
|
||||
|
||||
plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
if not (digger and pos and oldnode) then
|
||||
return
|
||||
|
@ -63,7 +65,7 @@ plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|||
|
||||
-- with a chance of 1/3, return 2 bushes
|
||||
local amount
|
||||
if math.random(1,3) == 1 then
|
||||
if can_harvest and random(1,3) == 1 then
|
||||
amount = "2"
|
||||
else
|
||||
amount = "1"
|
||||
|
@ -75,7 +77,7 @@ plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|||
elseif groupcaps.choppy then
|
||||
|
||||
-- the amount of sticks may vary
|
||||
local amount = math.random(4, 20)
|
||||
local amount = random(4, 20)
|
||||
-- return some sticks
|
||||
harvested = "default:stick " .. amount
|
||||
|
||||
|
@ -136,7 +138,7 @@ minetest.register_abm({
|
|||
local dirt = minetest.get_node(dirtpos)
|
||||
local is_soil = minetest.get_item_group(dirt.name, "soil") or minetest.get_item_group(dirt.name, "potting_soil")
|
||||
|
||||
if is_soil and (dirt.name == "farming:soil_wet" or math.random(1,3) == 1) then
|
||||
if is_soil and (dirt.name == "farming:soil_wet" or random(1,3) == 1) then
|
||||
minetest.swap_node( pos, {name = "bushes:" .. bush_name .. "_bush"})
|
||||
end
|
||||
end
|
||||
|
@ -161,17 +163,18 @@ for i, bush_name in ipairs(bushes_classic.bushes) do
|
|||
groups = { dig_immediate = 3 },
|
||||
})
|
||||
|
||||
local texture_top, texture_bottom
|
||||
|
||||
local groups = {snappy = 3, bush = 1, flammable = 2, attached_node=1}
|
||||
if bush_name == "mixed_berry" then
|
||||
bush_name = "fruitless";
|
||||
texture_top = "bushes_fruitless_bush_top.png"
|
||||
texture_bottom = "bushes_fruitless_bush_bottom.png"
|
||||
groups.not_in_creative_inventory = 1
|
||||
else
|
||||
texture_top = "bushes_bush_top.png"
|
||||
texture_bottom = "bushes_bush_bottom.png"
|
||||
end
|
||||
|
||||
local node_dig_prediction
|
||||
local node_placement_prediction
|
||||
if bush_name ~= "fruitless" then
|
||||
node_dig_prediction = "bushes:fruitless_bush"
|
||||
node_placement_prediction = "bushes:fruitless_bush"
|
||||
end
|
||||
|
||||
minetest.register_node(":bushes:" .. bush_name .. "_bush", {
|
||||
|
@ -185,6 +188,8 @@ for i, bush_name in ipairs(bushes_classic.bushes) do
|
|||
groups = groups,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = "",
|
||||
node_dig_prediction = node_dig_prediction,
|
||||
node_placement_prediction = node_placement_prediction,
|
||||
after_dig_node = function( pos, oldnode, oldmetadata, digger )
|
||||
return plantlife_bushes.after_dig_node(pos, oldnode, oldmetadata, digger);
|
||||
end,
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
default
|
||||
plantlife_i18n
|
|
@ -1,15 +1,2 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Cave Stuff"
|
||||
local version = "0.0.3"
|
||||
local mname = "cavestuff"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
|
||||
dofile(minetest.get_modpath("cavestuff").."/nodes.lua")
|
||||
dofile(minetest.get_modpath("cavestuff").."/mapgen.lua")
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: cavestuff
|
||||
Pebble=Kieselstein
|
||||
Desert Pebble=Wüstenkiesel
|
||||
Stalactite=Stalaktit
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: cavestuff
|
||||
Pebble=Ŝtoneto
|
||||
Desert Pebble=Dezerta Ŝtoneto
|
||||
Stalactite=Stalaktito
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: cavestuff
|
||||
Pebble=Caillou
|
||||
Desert Pebble=Caillou du désert
|
||||
Stalactite=Stalactite
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: cavestuff
|
||||
Pebble=
|
||||
Desert Pebble=
|
||||
Stalactite=
|
|
@ -1,52 +1,65 @@
|
|||
--Map Generation Stuff
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
if maxp.y >= 2 and minp.y <= 0 then
|
||||
-- Generate pebbles
|
||||
local perlin1 = minetest.get_perlin(329, 3, 0.6, 100)
|
||||
-- Assume X and Z lengths are equal
|
||||
local divlen = 16
|
||||
local divs = (maxp.x-minp.x)/divlen+1;
|
||||
for divx=0,divs-1 do
|
||||
for divz=0,divs-1 do
|
||||
local x0 = minp.x + math.floor((divx+0)*divlen)
|
||||
local z0 = minp.z + math.floor((divz+0)*divlen)
|
||||
local x1 = minp.x + math.floor((divx+1)*divlen)
|
||||
local z1 = minp.z + math.floor((divz+1)*divlen)
|
||||
-- Determine pebble amount from perlin noise
|
||||
local pebble_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 2 * 2)
|
||||
-- Find random positions for pebbles based on this random
|
||||
local pr = PseudoRandom(seed+1)
|
||||
for i=0,pebble_amount do
|
||||
local x = pr:next(x0, x1)
|
||||
local z = pr:next(z0, z1)
|
||||
-- Find ground level (0...15)
|
||||
local ground_y = nil
|
||||
for y=30,0,-1 do
|
||||
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then
|
||||
ground_y = y
|
||||
break
|
||||
end
|
||||
end
|
||||
minetest.register_decoration({
|
||||
decoration = {
|
||||
"cavestuff:pebble_1",
|
||||
"cavestuff:pebble_2"
|
||||
},
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:gravel",
|
||||
"default:stone",
|
||||
"default:permafrost_with_stones"
|
||||
},
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.0078125,
|
||||
spread = {
|
||||
y = 100,
|
||||
z = 100,
|
||||
x = 100
|
||||
},
|
||||
seed = 0,
|
||||
octaves = 3,
|
||||
persist = 0.6,
|
||||
flags = "absvalue",
|
||||
lacunarity = 2
|
||||
},
|
||||
param2 = 0,
|
||||
flags = "all_floors",
|
||||
deco_type = "simple",
|
||||
param2_max = 3,
|
||||
y_min = -16,
|
||||
y_max = 48
|
||||
})
|
||||
|
||||
if ground_y then
|
||||
local p = {x=x,y=ground_y+1,z=z}
|
||||
local nn = minetest.get_node(p).name
|
||||
-- Check if the node can be replaced
|
||||
if minetest.registered_nodes[nn] and
|
||||
minetest.registered_nodes[nn].buildable_to then
|
||||
nn = minetest.get_node({x=x,y=ground_y,z=z}).name
|
||||
-- If desert sand, add dry shrub
|
||||
if nn == "default:dirt_with_grass" then
|
||||
minetest.swap_node(p,{name="cavestuff:pebble_"..pr:next(1,2), param2=math.random(0,3)})
|
||||
elseif nn == "default:desert_sand" then
|
||||
minetest.swap_node(p,{name="cavestuff:desert_pebble_"..pr:next(1,2), param2=math.random(0,3)})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
minetest.register_decoration({
|
||||
decoration = {
|
||||
"cavestuff:desert_pebble_1",
|
||||
"cavestuff:desert_pebble_2"
|
||||
},
|
||||
place_on = {
|
||||
"default:desert_sand",
|
||||
"default:desert_stone"
|
||||
},
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.0078125,
|
||||
spread = {
|
||||
y = 100,
|
||||
z = 100,
|
||||
x = 100
|
||||
},
|
||||
seed = 0,
|
||||
octaves = 3,
|
||||
persist = 0.6,
|
||||
flags = "absvalue",
|
||||
lacunarity = 2
|
||||
},
|
||||
param2 = 0,
|
||||
flags = "all_floors",
|
||||
deco_type = "simple",
|
||||
param2_max = 3,
|
||||
y_min = -16,
|
||||
y_max = 48
|
||||
})
|
|
@ -0,0 +1,2 @@
|
|||
name = cavestuff
|
||||
depends = default
|
|
@ -1,5 +1,7 @@
|
|||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("cavestuff")
|
||||
|
||||
local random = math.random
|
||||
|
||||
--Rocks
|
||||
|
||||
|
@ -15,12 +17,12 @@ minetest.register_node("cavestuff:pebble_1",{
|
|||
tiles = {"undergrowth_pebble.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3, stone=1},
|
||||
groups = {cracky=3, stone=1, attached_node=1},
|
||||
selection_box = cbox,
|
||||
collision_box = cbox,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random pebble node
|
||||
local stack = ItemStack("cavestuff:pebble_"..math.random(1,2))
|
||||
local stack = ItemStack("cavestuff:pebble_"..random(1,2))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("cavestuff:pebble_1 "..itemstack:get_count()-(1-ret:get_count()))
|
||||
end,
|
||||
|
@ -32,10 +34,9 @@ minetest.register_node("cavestuff:pebble_2",{
|
|||
mesh = "cavestuff_pebble.obj",
|
||||
tiles = {"undergrowth_pebble.png"},
|
||||
drop = "cavestuff:pebble_1",
|
||||
tiles = {"undergrowth_pebble.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3, stone=1, not_in_creative_inventory=1},
|
||||
groups = {cracky=3, stone=1, attached_node=1, not_in_creative_inventory=1},
|
||||
selection_box = cbox,
|
||||
collision_box = cbox,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
|
@ -48,12 +49,12 @@ minetest.register_node("cavestuff:desert_pebble_1",{
|
|||
tiles = {"default_desert_stone.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3, stone=1},
|
||||
groups = {cracky=3, stone=1, attached_node=1},
|
||||
selection_box = cbox,
|
||||
collision_box = cbox,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random pebble node
|
||||
local stack = ItemStack("cavestuff:desert_pebble_"..math.random(1,2))
|
||||
local stack = ItemStack("cavestuff:desert_pebble_"..random(1,2))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("cavestuff:desert_pebble_1 "..itemstack:get_count()-(1-ret:get_count()))
|
||||
end,
|
||||
|
@ -67,7 +68,7 @@ minetest.register_node("cavestuff:desert_pebble_2",{
|
|||
tiles = {"default_desert_stone.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3, stone=1, not_in_creative_inventory=1},
|
||||
groups = {cracky=3, stone=1, attached_node=1, not_in_creative_inventory=1},
|
||||
selection_box = cbox,
|
||||
collision_box = cbox,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
|
@ -85,20 +86,35 @@ minetest.register_node("cavestuff:stalactite_1",{
|
|||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.187500,0.425000,-0.150003,0.162500,0.500000,0.162500},
|
||||
{-0.112500,0.162500,-0.100000,0.087500,0.475000,0.087500},
|
||||
{-0.062500,-0.275000,-0.062500,0.062500,0.500000,0.062500},
|
||||
{-0.037500,-0.837500,0.037500,0.037500,0.500000,-0.025000},
|
||||
{-0.187500,-0.425000,-0.150003,0.162500,-0.500000,0.162500},
|
||||
{-0.112500,-0.162500,-0.100000,0.087500,-0.475000,0.087500},
|
||||
{-0.062500,0.275000,-0.062500,0.062500,-0.500000,0.062500},
|
||||
{-0.037500,0.837500,0.037500,0.037500,-0.500000,-0.025000},
|
||||
}
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pt = pointed_thing
|
||||
if minetest.get_node(pt.under).name=="default:stone"
|
||||
and minetest.get_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}).name=="air"
|
||||
and minetest.get_node({x=pt.under.x, y=pt.under.y-2, z=pt.under.z}).name=="air" then
|
||||
minetest.swap_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}, {name="cavestuff:stalactite_"..math.random(1,3)})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
|
||||
local base = pointed_thing.under
|
||||
local place = vector.add(base, dir)
|
||||
local above = vector.add(place, dir)
|
||||
|
||||
if not placer then return end
|
||||
local playername = placer:get_player_name()
|
||||
if minetest.is_protected(place, playername)
|
||||
or minetest.is_protected(above, playername) then
|
||||
minetest.record_protection_violation(place, playername)
|
||||
return
|
||||
end
|
||||
|
||||
if minetest.get_node(base).name == "default:stone"
|
||||
and minetest.get_node(place).name == "air"
|
||||
and minetest.get_node(above).name == "air"
|
||||
then
|
||||
minetest.swap_node(place, {
|
||||
name = "cavestuff:stalactite_"..math.random(1,3),
|
||||
param2 = minetest.dir_to_wallmounted(vector.multiply(dir, -1))
|
||||
})
|
||||
if not minetest.is_creative_enabled(playername) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
|
@ -116,10 +132,10 @@ minetest.register_node("cavestuff:stalactite_2",{
|
|||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500},
|
||||
{-0.112500,0.112500,-0.100000,0.087500,0.475000,0.087500},
|
||||
{-0.062500,-0.675000,-0.062500,0.062500,0.500000,0.062500},
|
||||
{-0.037500,-0.975000,0.037500,0.037500,0.500000,-0.025000},
|
||||
{-0.187500,-0.387500,-0.150003,0.162500,-0.500000,0.162500},
|
||||
{-0.112500,-0.112500,-0.100000,0.087500,-0.475000,0.087500},
|
||||
{-0.062500,0.675000,-0.062500,0.062500,-0.500000,0.062500},
|
||||
{-0.037500,0.975000,0.037500,0.037500,-0.500000,-0.025000},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -134,12 +150,10 @@ minetest.register_node("cavestuff:stalactite_3",{
|
|||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500},
|
||||
{-0.112500,0.037500,-0.100000,0.087500,0.475000,0.087500},
|
||||
{-0.062500,-0.437500,-0.062500,0.062500,0.500000,0.062500},
|
||||
{-0.037500,-1.237500,0.037500,0.037500,0.500000,-0.025000},
|
||||
{-0.187500,-0.387500,-0.150003,0.162500,-0.500000,0.162500},
|
||||
{-0.112500,-0.037500,-0.100000,0.087500,-0.475000,0.087500},
|
||||
{-0.062500,0.437500,-0.062500,0.062500,-0.500000,0.062500},
|
||||
{-0.037500,1.237500,0.037500,0.037500,-0.500000,-0.025000},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
--Stalagmites
|
||||
|
|
|
@ -53,7 +53,7 @@ minetest.register_craft({
|
|||
{"default:stick",""}
|
||||
}
|
||||
})
|
||||
if minetest.get_modpath("flint") ~= nil then
|
||||
if minetest.get_modpath("flint") then
|
||||
minetest.register_craft({
|
||||
output = "dryplants:sickle",
|
||||
recipe = {
|
||||
|
@ -63,7 +63,7 @@ if minetest.get_modpath("flint") ~= nil then
|
|||
}
|
||||
})
|
||||
end
|
||||
if minetest.get_modpath("stoneage") ~= nil then
|
||||
if minetest.get_modpath("stoneage") then
|
||||
minetest.register_craft({
|
||||
output = "dryplants:sickle",
|
||||
recipe = {
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
default
|
||||
biome_lib
|
||||
plantlife_i18n
|
||||
farming?
|
|
@ -1,33 +1,15 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Grasses" -- former "Dry plants"
|
||||
local version = "0.1.5"
|
||||
local mname = "dryplants"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- textures & ideas partly by Neuromancer
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("dryplants")
|
||||
|
||||
-- Contains code from: default, farming
|
||||
-- Looked at code from: darkage, sickle, stairs
|
||||
-- Dependencies: default, farming, biome_lib
|
||||
-- Supports:
|
||||
-----------------------------------------------------------------------------------------------
|
||||
abstract_dryplants = {}
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
|
||||
dofile(minetest.get_modpath("dryplants").."/crafting.lua")
|
||||
dofile(minetest.get_modpath("dryplants").."/settings.txt")
|
||||
dofile(minetest.get_modpath("dryplants").."/reed.lua")
|
||||
if REEDMACE_GENERATES == true then
|
||||
|
||||
dofile(minetest.get_modpath("dryplants").."/reedmace.lua")
|
||||
end
|
||||
if SMALL_JUNCUS_GENERATES == true then
|
||||
dofile(minetest.get_modpath("dryplants").."/juncus.lua")
|
||||
end
|
||||
if EXTRA_TALL_GRASS_GENERATES == true then
|
||||
dofile(minetest.get_modpath("dryplants").."/moregrass.lua")
|
||||
end
|
||||
|
||||
--dofile(minetest.get_modpath("dryplants").."/meadowvariation.lua")
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
@ -130,6 +112,7 @@ minetest.register_node("dryplants:grass", {
|
|||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
tiles = {"dryplants_grass.png"},
|
||||
use_texture_alpha = "clip",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
|
@ -144,7 +127,7 @@ minetest.register_node("dryplants:grass", {
|
|||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_abm({
|
||||
nodenames = {"dryplants:grass"},
|
||||
interval = HAY_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
|
||||
interval = 3600, --1200, -- 20 minutes: a minetest-day/night-cycle
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
minetest.swap_node(pos, {name="dryplants:hay"})
|
||||
|
@ -161,6 +144,7 @@ minetest.register_node("dryplants:hay", {
|
|||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
tiles = {"dryplants_hay.png"},
|
||||
use_texture_alpha = "clip",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
|
@ -189,8 +173,8 @@ minetest.register_node("dryplants:grass_short", {
|
|||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_abm({
|
||||
nodenames = {"dryplants:grass_short"},
|
||||
interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
|
||||
chance = 100/GRASS_REGROWING_CHANCE,
|
||||
interval = 1200, --1200, -- 20 minutes: a minetest-day/night-cycle
|
||||
chance = 100/1200,
|
||||
action = function(pos)
|
||||
-- Only become dirt with grass if no cut grass or hay lies on top
|
||||
local above = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})
|
||||
|
@ -199,7 +183,3 @@ minetest.register_abm({
|
|||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,21 +1,12 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- Grasses - Juncus 0.0.5
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- textures & ideas partly by Neuromancer
|
||||
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: default
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("dryplants")
|
||||
|
||||
abstract_dryplants.grow_juncus = function(pos)
|
||||
local function grow_juncus(pos)
|
||||
local juncus_type = math.random(2,3)
|
||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||
|
||||
local nodename = minetest.get_node(right_here).name
|
||||
if nodename == "air" or nodename == "default:junglegrass" then
|
||||
if juncus_type == 2 then
|
||||
minetest.swap_node(right_here, {name="dryplants:juncus_02"})
|
||||
else
|
||||
|
@ -46,6 +37,10 @@ minetest.register_node("dryplants:juncus", {
|
|||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not itemstack or not placer or not pointed_thing then
|
||||
return
|
||||
end
|
||||
|
||||
local playername = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, playername) or
|
||||
minetest.is_protected(pointed_thing.under, playername) then
|
||||
|
@ -60,12 +55,13 @@ minetest.register_node("dryplants:juncus", {
|
|||
else
|
||||
minetest.swap_node(right_here, {name="dryplants:juncus"})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.is_creative_enabled(playername) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("dryplants:juncus_02", {
|
||||
description = S("Juncus"),
|
||||
drawtype = "plantlike",
|
||||
|
@ -92,44 +88,69 @@ minetest.register_node("dryplants:juncus_02", {
|
|||
-- GENERATE SMALL JUNCUS
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- near water or swamp
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
minetest.register_decoration({
|
||||
name = "dryplants:juncus_water",
|
||||
decoration = {"air"},
|
||||
fill_ratio = 0.16,
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
--"default:sand",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = JUNCUS_NEAR_WATER_PER_MAPBLOCK,
|
||||
rarity = 101 - JUNCUS_NEAR_WATER_RARITY,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
spawn_by = {
|
||||
"default:water_source",
|
||||
"sumpf:dirtywater_source",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
abstract_dryplants.grow_juncus
|
||||
)
|
||||
check_offset = -1,
|
||||
num_spawn_by = 1
|
||||
})
|
||||
|
||||
-- at dunes/beach
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
--"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
minetest.register_decoration({
|
||||
name = "dryplants:juncus_beach",
|
||||
decoration = {"air"},
|
||||
fill_ratio = 0.08,
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:sand",
|
||||
--"stoneage:grass_with_silex",
|
||||
--"sumpf:peat",
|
||||
--"sumpf:sumpf"
|
||||
},
|
||||
max_count = JUNCUS_AT_BEACH_PER_MAPBLOCK,
|
||||
rarity = 101 - JUNCUS_AT_BEACH_RARITY,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:dirt_with_grass"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_dryplants.grow_juncus
|
||||
)
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
spawn_by = {"default:dirt_with_grass"},
|
||||
check_offset = -1,
|
||||
num_spawn_by = 1
|
||||
})
|
||||
|
||||
local did, did2
|
||||
minetest.register_on_mods_loaded(function()
|
||||
did = minetest.get_decoration_id("dryplants:juncus_water")
|
||||
did2 = minetest.get_decoration_id("dryplants:juncus_beach")
|
||||
minetest.set_gen_notify("decoration", {did, did2})
|
||||
end)
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
local g = minetest.get_mapgen_object("gennotify")
|
||||
local locations = {}
|
||||
|
||||
local deco_locations_1 = g["decoration#" .. did] or {}
|
||||
local deco_locations_2 = g["decoration#" .. did2] or {}
|
||||
|
||||
for _, pos in pairs(deco_locations_1) do
|
||||
locations[#locations+1] = pos
|
||||
end
|
||||
for _, pos in pairs(deco_locations_2) do
|
||||
locations[#locations+1] = pos
|
||||
end
|
||||
|
||||
if #locations == 0 then return end
|
||||
for _, pos in ipairs(locations) do
|
||||
grow_juncus(pos)
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# textdomain: dryplants
|
||||
Sickle=Sichel
|
||||
Cut Grass=Grasschnitt
|
||||
Hay=Heu
|
||||
Short Grass=Kurzes Gras
|
||||
Juncus=Binsen
|
||||
Wet Reed=Nasses Schilf
|
||||
Wet Reed Slab=Nasse Schilfplatte
|
||||
Wet Reed Roof=Nasses Schilfdach
|
||||
Wet Reed Roof Corner 1=Nasser Schilfdachwinkel 1
|
||||
Wet Reed Roof Corner 2=Nasser Schilfdachwinkel 2
|
||||
Reed=Schilf
|
||||
Reed Slab=Schilfstufe
|
||||
Reed Roof=Schilfdach
|
||||
Reed Roof Corner 1=Schilfdachwinkel 1
|
||||
Reed Roof Corner 2=Schilfdachwinkel
|
||||
Reedmace=Rohrkolben
|
||||
Reedmace, height: 1=Rohrkolben, Höhe: 1
|
||||
Reedmace, height: 2=Rohrkolben, Höhe: 2
|
||||
Reedmace, height: 3=Rohrkolben, Höhe: 3
|
||||
Reedmace, height: 3 & Spikes=Rohrkolben, Höhe: 3 & Rispe
|
|
@ -0,0 +1,21 @@
|
|||
# textdomain: dryplants
|
||||
Sickle=
|
||||
Cut Grass=Tranĉita Herbenon
|
||||
Hay=Fojno
|
||||
Short Grass=Mallonga Herbo
|
||||
Juncus=Junko
|
||||
Wet Reed=Malseka Kano
|
||||
Wet Reed Slab=Slabo de Malseka Kano
|
||||
Wet Reed Roof=Tegmento de Malseka Kano
|
||||
Wet Reed Roof Corner 1=Tegmentangulo 1 de Malseka Kano
|
||||
Wet Reed Roof Corner 2=Tegmentangulo 2 de Malseka Kano
|
||||
Reed=Kano
|
||||
Reed Slab=Slabo de Kano
|
||||
Reed Roof=Tegmento de Kano
|
||||
Reed Roof Corner 1=Tegmentangulo 1 de Kano
|
||||
Reed Roof Corner 2=Tegmentangulo 2 de Kano
|
||||
Reedmace=Tifeo
|
||||
Reedmace, height: 1=Tifeo, alteco: 1
|
||||
Reedmace, height: 2=Tifeo, alteco: 2
|
||||
Reedmace, height: 3=Tifeo, alteco: 3
|
||||
Reedmace, height: 3 & Spikes=Tifeo, alteco: 3 & Pikiloj
|
|
@ -0,0 +1,21 @@
|
|||
# textdomain: dryplants
|
||||
Sickle=Faucille
|
||||
Cut Grass=Herbe coupée
|
||||
Hay=Foin
|
||||
Short Grass=Herbes courtes
|
||||
Juncus=Joncs
|
||||
Wet Reed=Bloc de roseau humide
|
||||
Wet Reed Slab=Dalle en roseau humide
|
||||
Wet Reed Roof=Toit en roseau humide
|
||||
Wet Reed Roof Corner 1=Angle de toit en roseau humide 1
|
||||
Wet Reed Roof Corner 2=Angle de toit en roseau humide 2
|
||||
Reed=Roseau
|
||||
Reed Slab=Dalle en roseau
|
||||
Reed Roof=Toit en roseau
|
||||
Reed Roof Corner 1=Angle de toit en roseau 1
|
||||
Reed Roof Corner 2=Angle de toit en roseau 2
|
||||
Reedmace=Roseau
|
||||
Reedmace, height: 1=Roseau, 1 de hauteur
|
||||
Reedmace, height: 2=Roseau, 2 de hauteur
|
||||
Reedmace, height: 3=Roseau, 3 de hauteur
|
||||
Reedmace, height: 3 & Spikes=Roseau, 3 de hauteur avec panicules
|
|
@ -0,0 +1,21 @@
|
|||
# textdomain: dryplants
|
||||
Sickle=
|
||||
Cut Grass=
|
||||
Hay=
|
||||
Short Grass=
|
||||
Juncus=
|
||||
Wet Reed=
|
||||
Wet Reed Slab=
|
||||
Wet Reed Roof=
|
||||
Wet Reed Roof Corner 1=
|
||||
Wet Reed Roof Corner 2=
|
||||
Reed=
|
||||
Reed Slab=
|
||||
Reed Roof=
|
||||
Reed Roof Corner 1=
|
||||
Reed Roof Corner 2=
|
||||
Reedmace=
|
||||
Reedmace, height: 1=
|
||||
Reedmace, height: 2=
|
||||
Reedmace, height: 3=
|
||||
Reedmace, height: 3 & Spikes=
|
|
@ -1,25 +1,12 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- Grasses - Meadow Variation 0.0.1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: default
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_dryplants.grow_grass_variation = function(pos)
|
||||
local right_here = {x=pos.x, y=pos.y, z=pos.z}
|
||||
minetest.swap_node(right_here, {name="dryplants:grass_short"})
|
||||
end
|
||||
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
-- @reviewer: couldn't even find using biome_lib
|
||||
minetest.register_decoration({
|
||||
decoration = {"dryplants:grass_short"},
|
||||
fill_ratio = 0.8,
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
},
|
||||
max_count = 4800,
|
||||
rarity = 25,
|
||||
min_elevation = 1, -- above sea level
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_dryplants.grow_grass_variation
|
||||
)
|
||||
deco_type = "simple",
|
||||
flags = "all_floors"
|
||||
})
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
name = dryplants
|
||||
depends = default
|
||||
optional_depends = farming, ebiomes
|
|
@ -1,32 +1,20 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- Grasses - More Tall Grass 0.0.2
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: default
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_dryplants.grow_grass = function(pos)
|
||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local grass_size = math.random(1,5)
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||
minetest.swap_node(right_here, {name="default:grass_"..grass_size})
|
||||
end
|
||||
end
|
||||
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
minetest.register_decoration({
|
||||
decoration = {
|
||||
"default:grass_1",
|
||||
"default:grass_2",
|
||||
"default:grass_3",
|
||||
"default:grass_4",
|
||||
"default:grass_5"
|
||||
},
|
||||
fill_ratio = 0.8,
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = TALL_GRASS_PER_MAPBLOCK,
|
||||
rarity = 101 - TALL_GRASS_RARITY,
|
||||
min_elevation = 1, -- above sea level
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_dryplants.grow_grass
|
||||
)
|
||||
deco_type = "simple",
|
||||
flags = "all_floors"
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-- Dependencies: default
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("dryplants")
|
||||
|
||||
minetest.register_alias("stairs:stair_wetreed", "dryplants:wetreed_roof")
|
||||
minetest.register_alias("stairs:slab_wetreed", "dryplants:wetreed_slab")
|
||||
|
@ -75,8 +75,6 @@ minetest.register_node("dryplants:wetreed_roof", {
|
|||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
if AUTO_ROOF_CORNER == true then
|
||||
|
||||
local CoRNeR = {
|
||||
-- MaTeRiaL
|
||||
{"wetreed"},
|
||||
|
@ -168,13 +166,12 @@ if AUTO_ROOF_CORNER == true then
|
|||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Wet Reed Roof Corner
|
||||
-- Wet Reed Roof Corner 1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:wetreed_roof_corner", {
|
||||
description = S("Wet Reed Roof Corner"),
|
||||
description = S("Wet Reed Roof Corner 1"),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
@ -233,8 +230,6 @@ minetest.register_node("dryplants:wetreed_roof_corner_2", {
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- Wet Reed becomes (dry) Reed over time
|
||||
-----------------------------------------------------------------------------------------------
|
||||
if REED_WILL_DRY == true then
|
||||
|
||||
local DRyiNG = {
|
||||
-- WeT DRy
|
||||
{"dryplants:wetreed", "dryplants:reed"},
|
||||
|
@ -250,7 +245,7 @@ if REED_WILL_DRY == true then
|
|||
|
||||
minetest.register_abm({
|
||||
nodenames = {WeT},
|
||||
interval = REED_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
|
||||
interval = 3600, --1200, -- 20 minutes: a minetest-day/night-cycle
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
local direction = minetest.get_node(pos).param2
|
||||
|
@ -258,7 +253,6 @@ if REED_WILL_DRY == true then
|
|||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Reed
|
||||
|
@ -322,10 +316,10 @@ minetest.register_node("dryplants:reed_roof", {
|
|||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Reed Roof Corner
|
||||
-- Reed Roof Corner 1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reed_roof_corner", {
|
||||
description = S("Reed Roof Corner"),
|
||||
description = S("Reed Roof Corner 1"),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
|
|
@ -1,13 +1,3 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- Grasses - Reedmace 0.1.1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- textures & ideas partly by Neuromancer
|
||||
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: default, trees
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- NOTES (from wikipedia, some of this might get implemented)
|
||||
-- rhizomes are edible
|
||||
-- outer portion of young plants can be peeled and the heart can be eaten raw or boiled and eaten like asparagus
|
||||
|
@ -18,20 +8,22 @@
|
|||
-- The seed hairs were used by some Native American groups as tinder for starting fires
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("dryplants")
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE SHAPES
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_dryplants.grow_reedmace = function(pos)
|
||||
local function grow_reedmace(pos)
|
||||
local size = math.random(1,3)
|
||||
local spikes = math.random(1,3)
|
||||
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||
local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||
if minetest.get_node(pos_01).name == "air" -- bug fix
|
||||
or minetest.get_node(pos_01).name == "dryplants:reedmace_sapling" then
|
||||
|
||||
local nodename = minetest.get_node(pos_01).name
|
||||
if nodename == "air" -- bug fix
|
||||
or nodename == "dryplants:reedmace_sapling" then
|
||||
if minetest.get_node(pos_02).name ~= "air" then
|
||||
minetest.swap_node(pos_01, {name="dryplants:reedmace_top"})
|
||||
elseif minetest.get_node(pos_03).name ~= "air" then
|
||||
|
@ -50,14 +42,16 @@ abstract_dryplants.grow_reedmace = function(pos)
|
|||
end
|
||||
end
|
||||
|
||||
abstract_dryplants.grow_reedmace_water = function(pos)
|
||||
local function grow_reedmace_water(pos)
|
||||
local size = math.random(1,3)
|
||||
local spikes = math.random(1,3)
|
||||
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||
local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||
local pos_04 = {x = pos.x, y = pos.y + 4, z = pos.z}
|
||||
|
||||
minetest.add_entity(pos_01, "dryplants:reedmace_water_entity")
|
||||
|
||||
if minetest.get_node(pos_02).name == "air" then -- bug fix
|
||||
if minetest.get_node(pos_03).name ~= "air" then
|
||||
minetest.swap_node(pos_02, {name="dryplants:reedmace_top"})
|
||||
|
@ -77,6 +71,8 @@ abstract_dryplants.grow_reedmace_water = function(pos)
|
|||
end
|
||||
end
|
||||
|
||||
abstract_dryplants.grow_reedmace = grow_reedmace -- compatibility
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE SPIKES
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
@ -264,7 +260,8 @@ minetest.register_node("dryplants:reedmace_sapling", {
|
|||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1
|
||||
attached_node=1,
|
||||
sapling=1,
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
|
@ -275,19 +272,19 @@ minetest.register_node("dryplants:reedmace_sapling", {
|
|||
-- abm
|
||||
minetest.register_abm({
|
||||
nodenames = "dryplants:reedmace_sapling",
|
||||
interval = REEDMACE_GROWING_TIME,
|
||||
chance = 100/REEDMACE_GROWING_CHANCE,
|
||||
interval = 600,
|
||||
chance = 100/5,
|
||||
action = function(pos, node, _, _)
|
||||
if string.find(minetest.get_node({x = pos.x + 1, y = pos.y, z = pos.z }).name, "default:water")
|
||||
or string.find(minetest.get_node({x = pos.x, y = pos.y, z = pos.z + 1}).name, "default:water")
|
||||
or string.find(minetest.get_node({x = pos.x - 1, y = pos.y, z = pos.z }).name, "default:water")
|
||||
or string.find(minetest.get_node({x = pos.x, y = pos.y, z = pos.z - 1}).name, "default:water") then
|
||||
if minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then
|
||||
abstract_dryplants.grow_reedmace_water({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||
grow_reedmace_water({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||
end
|
||||
minetest.swap_node({x=pos.x, y=pos.y, z=pos.z}, {name="default:water_source"})
|
||||
else
|
||||
abstract_dryplants.grow_reedmace({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||
grow_reedmace({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
@ -317,7 +314,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
|
|||
collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
|
||||
on_punch = function(self, puncher)
|
||||
if puncher:is_player() and puncher:get_inventory() then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.is_creative_enabled(puncher:get_player_name()) then
|
||||
puncher:get_inventory():add_item("main", "dryplants:reedmace_sapling")
|
||||
end
|
||||
self.object:remove()
|
||||
|
@ -325,89 +322,120 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
|
|||
end,
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- SPAWN REEDMACE
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--[[biome_lib:spawn_on_surfaces({
|
||||
spawn_delay = 1200,
|
||||
spawn_plants = {"dryplants:reedmace_sapling"},
|
||||
spawn_chance = 400,
|
||||
spawn_surfaces = {
|
||||
"default:dirt_with_grass",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"dryplants:grass_short",
|
||||
"stoneage:grass_with_silex"
|
||||
},
|
||||
seed_diff = 329,
|
||||
near_nodes = {"default:water_source"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
})]]
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GENERATE REEDMACE
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- near water or swamp
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
minetest.register_decoration({
|
||||
name = "dryplants:reedmace_swamp",
|
||||
decoration = {"air"},
|
||||
fill_ratio = "0.05",
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:desert_sand",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = REEDMACE_NEAR_WATER_PER_MAPBLOCK,
|
||||
rarity = 101 - REEDMACE_NEAR_WATER_RARITY,
|
||||
--rarity = 60,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
spawn_by = {
|
||||
"default:water_source",
|
||||
"sumpf:dirtywater_source",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
abstract_dryplants.grow_reedmace
|
||||
)
|
||||
check_offset = -1,
|
||||
num_spawn_by = 1
|
||||
})
|
||||
|
||||
-- in water
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
minetest.register_decoration({
|
||||
name = "dryplants:reedmace_water",
|
||||
decoration = {"air"},
|
||||
fill_ratio = "0.01",
|
||||
y_min = 0,
|
||||
y_max = 0,
|
||||
place_on = {
|
||||
"default:dirt",
|
||||
"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
--"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = REEDMACE_IN_WATER_PER_MAPBLOCK,
|
||||
rarity = 101 - REEDMACE_IN_WATER_RARITY,
|
||||
--rarity = 35,
|
||||
min_elevation = 0, -- a bit below sea level
|
||||
max_elevation = 0, -- ""
|
||||
near_nodes = {"default:water_source","sumpf:dirtywater_source"},
|
||||
near_nodes_size = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
spawn_by = {
|
||||
"default:water_source",
|
||||
"sumpf:dirtywater_source"
|
||||
},
|
||||
abstract_dryplants.grow_reedmace_water
|
||||
)
|
||||
check_offset = -1,
|
||||
num_spawn_by = 1
|
||||
})
|
||||
|
||||
-- for oases & tropical beaches & tropical swamps
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {
|
||||
minetest.register_decoration({
|
||||
name = "dryplants:reedmace_beach",
|
||||
decoration = {"air"},
|
||||
fill_ratio = "0.05",
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:sand",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = REEDMACE_FOR_OASES_PER_MAPBLOCK,
|
||||
rarity = 101 - REEDMACE_FOR_OASES_RARITY,
|
||||
--rarity = 10,
|
||||
neighbors = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
||||
ncount = 1,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:desert_sand","sumpf:sumpf"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
spawn_by = {
|
||||
"default:water_source",
|
||||
"sumpf:dirtywater_source",
|
||||
"sumpf:sumpf",
|
||||
"default:desert_sand"
|
||||
},
|
||||
abstract_dryplants.grow_reedmace
|
||||
)
|
||||
check_offset = -1,
|
||||
num_spawn_by = 1
|
||||
})
|
||||
|
||||
local did, did2, did3
|
||||
minetest.register_on_mods_loaded(function()
|
||||
did = minetest.get_decoration_id("dryplants:reedmace_swamp")
|
||||
did2 = minetest.get_decoration_id("dryplants:reedmace_water")
|
||||
did3 = minetest.get_decoration_id("dryplants:reedmace_beach")
|
||||
minetest.set_gen_notify("decoration", {did, did2, did3})
|
||||
end)
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
local g = minetest.get_mapgen_object("gennotify")
|
||||
local locations = {}
|
||||
|
||||
local deco_locations_1 = g["decoration#" .. did] or {}
|
||||
local deco_locations_3 = g["decoration#" .. did3] or {}
|
||||
|
||||
for _, pos in pairs(deco_locations_1) do
|
||||
locations[#locations+1] = pos
|
||||
end
|
||||
for _, pos in pairs(deco_locations_3) do
|
||||
locations[#locations+1] = pos
|
||||
end
|
||||
|
||||
if #locations == 0 then return end
|
||||
for _, pos in ipairs(locations) do
|
||||
grow_reedmace(pos)
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
local g = minetest.get_mapgen_object("gennotify")
|
||||
local locations = {}
|
||||
|
||||
local deco_locations_2 = g["decoration#" .. did2] or {}
|
||||
|
||||
for _, pos in pairs(deco_locations_2) do
|
||||
locations[#locations+1] = pos
|
||||
end
|
||||
|
||||
if #locations == 0 then return end
|
||||
for _, pos in ipairs(locations) do
|
||||
grow_reedmace_water(pos)
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
-- Here you can enable/disable the different plants
|
||||
REEDMACE_GENERATES = true
|
||||
SMALL_JUNCUS_GENERATES = true
|
||||
EXTRA_TALL_GRASS_GENERATES = true
|
||||
|
||||
|
||||
|
||||
-- Amount of Reedmace near water or swamp
|
||||
REEDMACE_NEAR_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
|
||||
REEDMACE_NEAR_WATER_RARITY = 40 -- percent
|
||||
|
||||
-- Amount of Reedmace in water
|
||||
REEDMACE_IN_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
|
||||
REEDMACE_IN_WATER_RARITY = 65 -- percent
|
||||
|
||||
-- Amount of Reedmace for oases, tropical beaches and tropical swamps
|
||||
REEDMACE_FOR_OASES_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
|
||||
REEDMACE_FOR_OASES_RARITY = 90 -- percent
|
||||
|
||||
-- growing of reedmace sapling
|
||||
REEDMACE_GROWING_TIME = 600 -- seconds
|
||||
REEDMACE_GROWING_CHANCE = 5 -- percent
|
||||
|
||||
|
||||
|
||||
-- Amount of small Juncus near water or swamp
|
||||
JUNCUS_NEAR_WATER_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number)
|
||||
JUNCUS_NEAR_WATER_RARITY = 75 -- percent
|
||||
|
||||
-- Amount of small Juncus at dunes/beach
|
||||
JUNCUS_AT_BEACH_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number)
|
||||
JUNCUS_AT_BEACH_RARITY = 75 -- percent
|
||||
|
||||
|
||||
|
||||
-- Tall Grass on dirt with grass
|
||||
TALL_GRASS_PER_MAPBLOCK = 4800 -- plants per 80x80x80 nodes (absolute maximum number)
|
||||
TALL_GRASS_RARITY = 75 -- percent
|
||||
|
||||
|
||||
|
||||
-- short grass becomes dirt with grass again
|
||||
GRASS_REGROWING_TIME = 1200 -- seconds
|
||||
GRASS_REGROWING_CHANCE = 5 -- percent
|
||||
|
||||
HAY_DRYING_TIME = 3600 -- seconds
|
||||
|
||||
REED_WILL_DRY = false -- wet reed nodes will become dry reed nodes
|
||||
REED_DRYING_TIME = 3600 -- seconds
|
||||
|
||||
AUTO_ROOF_CORNER = true
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("ferns")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Ferns - Crafting 0.0.5
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
default
|
||||
biome_lib
|
||||
plantlife_i18n
|
|
@ -15,7 +15,7 @@
|
|||
assert(abstract_ferns.config.enable_lady_fern == true)
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("ferns")
|
||||
|
||||
-- Maintain backward compatibilty
|
||||
-- minetest-0.5: Begin
|
||||
|
@ -87,7 +87,7 @@ end
|
|||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
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 = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
|
@ -116,7 +116,7 @@ if abstract_ferns.config.lady_ferns_near_tree == true then
|
|||
end
|
||||
|
||||
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 = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
|
@ -143,7 +143,7 @@ if abstract_ferns.config.lady_ferns_near_rock == true then
|
|||
end
|
||||
|
||||
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 = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
|
@ -183,7 +183,7 @@ if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a
|
|||
end
|
||||
|
||||
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 = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
|
|
|
@ -10,9 +10,28 @@
|
|||
assert(abstract_ferns.config.enable_giant_treefern == true)
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("ferns")
|
||||
-- lot of code, lot to load
|
||||
|
||||
function abstract_ferns.can_grow_giant_tree_fern(pos)
|
||||
local node_name = minetest.get_node(pos).name
|
||||
if node_name ~= "air" and node_name ~= "ferns:sapling_giant_tree_fern" and node_name ~= "default:junglegrass" then
|
||||
return false
|
||||
end
|
||||
|
||||
local below_name = minetest.get_node(vector.new(pos.x, pos.y - 1, pos.z)).name
|
||||
if minetest.get_item_group(below_name, "soil") == 0 and minetest.get_item_group(below_name, "sand") == 0 then
|
||||
return false
|
||||
end
|
||||
|
||||
local light = minetest.get_node_light(pos, 0.5)
|
||||
if light <= 8 then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
abstract_ferns.grow_giant_tree_fern = function(pos)
|
||||
local pos_aux = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local name = minetest.get_node(pos_aux).name
|
||||
|
@ -65,8 +84,8 @@ abstract_ferns.grow_giant_tree_fern = function(pos)
|
|||
local brk = false
|
||||
for i = 1, size-3 do
|
||||
pos_aux.y = pos.y + i
|
||||
local name = minetest.get_node(pos_aux).name
|
||||
if not (name == "air" or (i == 1 and name == "ferns:sapling_giant_tree_fern")) then
|
||||
local nodename = minetest.get_node(pos_aux).name
|
||||
if not (nodename == "air" or (i == 1 and nodename == "ferns:sapling_giant_tree_fern")) then
|
||||
brk = true
|
||||
break
|
||||
end
|
||||
|
@ -162,6 +181,14 @@ minetest.register_node("ferns:tree_fern_leave_big", {
|
|||
},
|
||||
drop = "",
|
||||
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,
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
@ -173,6 +200,7 @@ minetest.register_node("ferns:tree_fern_leave_big_end", {
|
|||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = { "ferns_tree_fern_leave_big_end.png" },
|
||||
use_texture_alpha = "clip",
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
|
@ -205,6 +233,7 @@ minetest.register_node("ferns:fern_trunk_big_top", {
|
|||
"ferns_fern_trunk_big_top.png^ferns_tree_fern_leave_big_cross.png",
|
||||
"ferns_fern_trunk_big.png"
|
||||
},
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
-- {left, bottom, front, right, top, back }
|
||||
|
@ -242,6 +271,7 @@ minetest.register_node("ferns:fern_trunk_big", {
|
|||
"ferns_fern_trunk_big_top.png",
|
||||
"ferns_fern_trunk_big.png"
|
||||
},
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4},
|
||||
|
@ -274,7 +304,7 @@ minetest.register_node("ferns:sapling_giant_tree_fern", {
|
|||
tiles = {"ferns_sapling_tree_fern_giant.png"},
|
||||
inventory_image = "ferns_sapling_tree_fern_giant.png",
|
||||
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(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
|
@ -288,8 +318,10 @@ minetest.register_abm({
|
|||
interval = 1000,
|
||||
chance = 4,
|
||||
action = function(pos, node, _, _)
|
||||
if abstract_ferns.can_grow_giant_tree_fern(pos) then
|
||||
abstract_ferns.grow_giant_tree_fern({x = pos.x, y = pos.y-1, z = pos.z})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
@ -298,7 +330,7 @@ minetest.register_abm({
|
|||
|
||||
-- in jungles
|
||||
if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then
|
||||
biome_lib:register_generate_plant({
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
|
||||
|
@ -324,7 +356,7 @@ end
|
|||
|
||||
-- for oases & tropical beaches
|
||||
if abstract_ferns.config.enable_giant_treeferns_in_oases == true then
|
||||
biome_lib:register_generate_plant({
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:sand"--,
|
||||
--"default:desert_sand"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
assert(abstract_ferns.config.enable_horsetails == true)
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("ferns")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- HORSETAIL (EQUISETUM)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
@ -34,13 +34,13 @@ local function create_nodes()
|
|||
local node_drop = "ferns:horsetail_04"
|
||||
|
||||
if i == 1 then
|
||||
node_desc = S("Young Horsetail (Equisetum)")
|
||||
node_desc = S("Young Horsetail (Equisetum) @1", 1)
|
||||
node_on_use = minetest.item_eat(1) -- young ones edible https://en.wikipedia.org/wiki/Equisetum
|
||||
node_drop = node_name
|
||||
elseif i == 4 then
|
||||
node_desc = S("Horsetail (Equisetum)")
|
||||
else
|
||||
node_desc = S("Horsetail (Equisetum)").." ".. string.format("%02d", i)
|
||||
node_desc = S("Horsetail (Equisetum) @1", i)
|
||||
end
|
||||
|
||||
node_names[i] = node_name
|
||||
|
@ -75,13 +75,10 @@ create_nodes()
|
|||
-- Spawning
|
||||
-----------------------------------------------------------------------------------------------
|
||||
if abstract_ferns.config.enable_horsetails_spawning == true then
|
||||
biome_lib:spawn_on_surfaces({
|
||||
spawn_delay = 1200,
|
||||
spawn_plants = node_names,
|
||||
spawn_chance = 400,
|
||||
spawn_surfaces = {
|
||||
minetest.register_abm({
|
||||
nodenames = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter", -- minetest >= 0.5
|
||||
"default:dirt_with_coniferous_litter",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"dryplants:grass_short",
|
||||
|
@ -89,13 +86,28 @@ if abstract_ferns.config.enable_horsetails_spawning == true then
|
|||
"default:mossycobble",
|
||||
"default:gravel"
|
||||
},
|
||||
seed_diff = 329,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:water_source","default:river_water_source","default:gravel"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
--random_facedir = { 0, 179 },
|
||||
interval = 1200,
|
||||
chance = 400,
|
||||
label = "[ferns] spawn horsetails",
|
||||
min_y = 1,
|
||||
max_y = 48,
|
||||
action = function(pos, node)
|
||||
local p_top = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local n_top = minetest.get_node_or_nil(p_top)
|
||||
if not n_top or n_top.name ~= "air" then return end
|
||||
|
||||
local NEAR_DST = 2
|
||||
if #minetest.find_nodes_in_area(
|
||||
{x=pos.x-NEAR_DST, y=pos.y-1, z=pos.z-NEAR_DST},
|
||||
{x=pos.x+NEAR_DST, y=pos.y+1, z=pos.z+NEAR_DST},
|
||||
{"default:water_source","default:river_water_source","default:gravel"}
|
||||
) < 1 then return
|
||||
end
|
||||
|
||||
local plant_to_spawn = node_names[math.random(1, #node_names)]
|
||||
|
||||
minetest.swap_node(p_top, {name = plant_to_spawn, param2 = 0})
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -104,7 +116,7 @@ end
|
|||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
if abstract_ferns.config.enable_horsetails_on_grass == true then
|
||||
biome_lib:register_generate_plant({
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter", -- minetest >= 0.5
|
||||
|
@ -137,7 +149,7 @@ if abstract_ferns.config.enable_horsetails_on_grass == true then
|
|||
end
|
||||
|
||||
if abstract_ferns.config.enable_horsetails_on_stones == true then
|
||||
biome_lib:register_generate_plant({
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:gravel", -- roots go deep
|
||||
"default:mossycobble",
|
||||
|
|
|
@ -1,16 +1,5 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Ferns" -- former "Archae Plantae"
|
||||
local version = "0.2.1"
|
||||
local mname = "ferns" -- former "archaeplantae"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- (by Mossmanikin)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_ferns = {}
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
|
||||
dofile(minetest.get_modpath("ferns").."/settings.lua")
|
||||
|
||||
if abstract_ferns.config.enable_lady_fern == true then
|
||||
|
@ -30,42 +19,3 @@ if abstract_ferns.config.enable_giant_treefern == true then
|
|||
end
|
||||
|
||||
dofile(minetest.get_modpath("ferns").."/crafting.lua")
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- TESTS
|
||||
-----------------------------------------------------------------------------
|
||||
local run_tests = true -- set to false to skip
|
||||
|
||||
if run_tests then
|
||||
|
||||
-- These are, essentially, unit tests to make sure that all required item
|
||||
-- strings are registered. The init sequence is not time critical so leaving
|
||||
-- them here won't affect performance.
|
||||
|
||||
-- Check node names
|
||||
if abstract_ferns.config.enable_horsetails then
|
||||
print("[Mod] " ..title.. " Checking horsetail item strings")
|
||||
assert(minetest.registered_items["ferns:horsetail_01"] ~= nil)
|
||||
assert(minetest.registered_items["ferns:horsetail_02"] ~= nil)
|
||||
assert(minetest.registered_items["ferns:horsetail_03"] ~= nil)
|
||||
assert(minetest.registered_items["ferns:horsetail_04"] ~= nil)
|
||||
end
|
||||
if abstract_ferns.config.enable_lady_fern then
|
||||
print("[Mod] ".. title .." Checking lady fern item strings")
|
||||
assert(minetest.registered_items["ferns:fern_01"] ~= nil)
|
||||
assert(minetest.registered_items["ferns:fern_02"] ~= nil)
|
||||
assert(minetest.registered_items["ferns:fern_03"] ~= nil)
|
||||
end
|
||||
if abstract_ferns.config.enable_treefern then
|
||||
print("[Mod] ".. title .." Checking tree fern item strings")
|
||||
assert(minetest.registered_items["ferns:tree_fern_leaves"] ~= nil)
|
||||
assert(minetest.registered_items["ferns:tree_fern_leaves_02"] ~= nil)
|
||||
assert(minetest.registered_items["ferns:fern_trunk"] ~= nil)
|
||||
assert(minetest.registered_items["ferns:sapling_tree_fern"] ~= nil)
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# textdomain: ferns
|
||||
Fiddlehead=Geigenkopf
|
||||
Roasted Fiddlehead=Gerösteter Geigenkopf
|
||||
Fern Tuber=Farnknolle
|
||||
Roasted Fern Tuber=Geröstete Farnknolle
|
||||
Lady-fern (Athyrium)=Frauenfarn (Athyrium)
|
||||
Giant Tree Fern Leaves=Riesige Baumfarnblätter
|
||||
Giant Tree Fern Leave End=Riesiges Baumfarnblattende
|
||||
Giant Fern Trunk=Riesiger Baumfarnstamm
|
||||
Giant Tree Fern Sapling=Riesiger Baumfarnsetzling
|
||||
Tree Fern Crown (Dicksonia)=Baumfarnkrone (Dicksonia)
|
||||
Young Horsetail (Equisetum) @1=Junger Schachtelhalm (Equisetum) @1
|
||||
Horsetail (Equisetum)=Schachtelhalm (Equisetum)
|
||||
Horsetail (Equisetum) @1= Schachtelhalm (Equisetum) @1
|
||||
Fern Trunk (Dicksonia)=Farnstamm (Dicksonia)
|
||||
Tree Fern Sapling (Dicksonia)=Baumfarnsetzling (Dicksonia)
|
|
@ -0,0 +1,16 @@
|
|||
# textdomain: ferns
|
||||
Fiddlehead=Filika Supro
|
||||
Roasted Fiddlehead=Rostita Filika Supro
|
||||
Fern Tuber=Filika Tubero
|
||||
Roasted Fern Tuber=Rostita Filika Tubero
|
||||
Lady-fern (Athyrium)=Afiriumo (Athyrium)
|
||||
Giant Tree Fern Leaves=Folioj de Giganta Arba Filiko
|
||||
Giant Tree Fern Leave End=Folifino de Giganta Arba Filiko
|
||||
Giant Fern Trunk=Trunko de Giganta Arba Filiko
|
||||
Giant Tree Fern Sapling=Arbido de Giganta Arba Filiko
|
||||
Tree Fern Crown (Dicksonia)=Krono de Arba Filiko
|
||||
Young Horsetail (Equisetum) @1=Juna Ekvizeto (Equisetum) @1
|
||||
Horsetail (Equisetum)=Ekvizeto (Equisetum)
|
||||
Horsetail (Equisetum) @1=Ekvizeto (Equisetum) @1
|
||||
Fern Trunk (Dicksonia)=Trunko de Arba Filiko (Dicksonia)
|
||||
Tree Fern Sapling (Dicksonia)=Arbido de Arba Filiko (Dicksonia)
|
|
@ -0,0 +1,16 @@
|
|||
# textdomain: ferns
|
||||
Fiddlehead=Crosse de fougère
|
||||
Roasted Fiddlehead=Crosse de fougère rôtie
|
||||
Fern Tuber=Tubercule de fougère
|
||||
Roasted Fern Tuber=Tubercule de fougère rôti
|
||||
Lady-fern (Athyrium)=Fougère (Athyrium)
|
||||
Giant Tree Fern Leaves=Feuilles de fougère géante
|
||||
Giant Tree Fern Leave End=Feuilles de fougère géante (extrémité)
|
||||
Giant Fern Trunk=Tronc de fougère géante
|
||||
Giant Tree Fern Sapling=Pousse de fougère géante
|
||||
Tree Fern Crown (Dicksonia)=Fougère en couronne (Dicksonia)
|
||||
Young Horsetail (Equisetum) @1=Pousse de prêle (Equisetum) @1
|
||||
Horsetail (Equisetum)=Prêle (Equisetum)
|
||||
Horsetail (Equisetum) @1=Prêle (Equisetum) @1
|
||||
Fern Trunk (Dicksonia)=Tronc de fougère en couronne (Dicksonia)
|
||||
Tree Fern Sapling (Dicksonia)=Pousse de fougère en couronne (Dicksonia)
|
|
@ -0,0 +1,16 @@
|
|||
# textdomain: ferns
|
||||
Fiddlehead=
|
||||
Roasted Fiddlehead=
|
||||
Fern Tuber=
|
||||
Roasted Fern Tuber=
|
||||
Lady-fern (Athyrium)=
|
||||
Giant Tree Fern Leaves=
|
||||
Giant Tree Fern Leave End=
|
||||
Giant Fern Trunk=
|
||||
Giant Tree Fern Sapling=
|
||||
Tree Fern Crown (Dicksonia)=
|
||||
Young Horsetail (Equisetum) @1=
|
||||
Horsetail (Equisetum)=
|
||||
Horsetail (Equisetum) @1=
|
||||
Fern Trunk (Dicksonia)=
|
||||
Tree Fern Sapling (Dicksonia)=
|
|
@ -0,0 +1,2 @@
|
|||
name = ferns
|
||||
depends = default, biome_lib
|
|
@ -7,10 +7,31 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("ferns")
|
||||
|
||||
assert(abstract_ferns.config.enable_treefern == true)
|
||||
|
||||
local random = math.random
|
||||
|
||||
function abstract_ferns.can_grow_tree_fern(pos)
|
||||
local node_name = minetest.get_node(pos).name
|
||||
if node_name ~= "air" and node_name ~= "ferns:sapling_tree_fern" and node_name ~= "default:junglegrass" then
|
||||
return false
|
||||
end
|
||||
|
||||
local below_name = minetest.get_node(vector.new(pos.x, pos.y - 1, pos.z)).name
|
||||
if minetest.get_item_group(below_name, "soil") == 0 and minetest.get_item_group(below_name, "sand") == 0 then
|
||||
return false
|
||||
end
|
||||
|
||||
local light = minetest.get_node_light(pos, 0.5)
|
||||
if light <= 8 then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
abstract_ferns.grow_tree_fern = function(pos)
|
||||
|
||||
local pos_aux = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
|
@ -20,12 +41,12 @@ abstract_ferns.grow_tree_fern = function(pos)
|
|||
return
|
||||
end
|
||||
|
||||
local size = math.random(1, 4) + math.random(1, 4)
|
||||
local size = random(1, 4) + random(1, 4)
|
||||
if (size > 5) then
|
||||
size = 10 - size
|
||||
end
|
||||
size = size + 1
|
||||
local crown = ({ "ferns:tree_fern_leaves", "ferns:tree_fern_leaves_02" })[math.random(1, 2)]
|
||||
local crown = ({ "ferns:tree_fern_leaves", "ferns:tree_fern_leaves_02" })[random(1, 2)]
|
||||
|
||||
local i = 1
|
||||
local brk = false
|
||||
|
@ -128,6 +149,7 @@ minetest.register_node("ferns:fern_trunk", {
|
|||
"ferns_fern_trunk_top.png",
|
||||
"ferns_fern_trunk.png"
|
||||
},
|
||||
use_texture_alpha = "clip",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8},
|
||||
|
@ -154,7 +176,7 @@ minetest.register_node("ferns:sapling_tree_fern", {
|
|||
tiles = {"ferns_sapling_tree_fern.png"},
|
||||
inventory_image = "ferns_sapling_tree_fern.png",
|
||||
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(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
|
@ -167,8 +189,10 @@ minetest.register_abm({
|
|||
interval = 1000,
|
||||
chance = 4,
|
||||
action = function(pos, node, _, _)
|
||||
if abstract_ferns.can_grow_tree_fern(pos) then
|
||||
abstract_ferns.grow_tree_fern({x = pos.x, y = pos.y-1, z = pos.z})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
@ -177,7 +201,7 @@ minetest.register_abm({
|
|||
|
||||
-- in jungles
|
||||
if abstract_ferns.config.enable_treeferns_in_jungle == true then
|
||||
biome_lib:register_generate_plant({
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
|
||||
|
@ -206,7 +230,7 @@ end
|
|||
|
||||
-- for oases & tropical beaches
|
||||
if abstract_ferns.config.enable_treeferns_in_oases == true then
|
||||
biome_lib:register_generate_plant({
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:sand"--,
|
||||
--"default:desert_sand"
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
biome_lib
|
||||
plantlife_i18n
|
||||
farming?
|
||||
flowers?
|
|
@ -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.
|
|
@ -1,481 +0,0 @@
|
|||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
|
||||
-- This file supplies a few additional plants and some related crafts
|
||||
-- for the plantlife modpack. Last revision: 2013-04-24
|
||||
|
||||
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 = 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
|
||||
|
||||
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 = 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
|
||||
|
||||
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 = 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_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_"..math.random(1,4), param2=math.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(S("[Flowers] Loaded."))
|
|
@ -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.")
|
|
@ -0,0 +1 @@
|
|||
min_minetest_version = 5.3.0
|
|
@ -1,3 +0,0 @@
|
|||
default
|
||||
plantlife_i18n
|
||||
biome_lib
|
|
@ -1,21 +1,12 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Mole Hills"
|
||||
local version = "0.0.3"
|
||||
local mname = "molehills"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Idea by Sokomine
|
||||
-- Code & textures by Mossmanikin
|
||||
|
||||
abstract_molehills = {}
|
||||
|
||||
dofile(minetest.get_modpath("molehills").."/molehills_settings.txt")
|
||||
|
||||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- NoDe
|
||||
-----------------------------------------------------------------------------------------------
|
||||
local S = minetest.get_translator("molehills")
|
||||
|
||||
local molehill_rarity = minetest.settings:get("molehills.molehill_rarity") or 0.002
|
||||
|
||||
-- Node
|
||||
local mh_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
|
@ -27,6 +18,7 @@ minetest.register_node("molehills:molehill",{
|
|||
description = S("Mole Hill"),
|
||||
inventory_image = "molehills_side.png",
|
||||
tiles = { "molehills_dirt.png" },
|
||||
use_texture_alpha = "clip",
|
||||
paramtype = "light",
|
||||
selection_box = mh_cbox,
|
||||
collision_box = mh_cbox,
|
||||
|
@ -34,9 +26,7 @@ minetest.register_node("molehills:molehill",{
|
|||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- CRaFTiNG
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Crafting
|
||||
minetest.register_craft({ -- molehills --> dirt
|
||||
output = "default:dirt",
|
||||
recipe = {
|
||||
|
@ -45,36 +35,19 @@ minetest.register_craft({ -- molehills --> dirt
|
|||
}
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GeNeRaTiNG
|
||||
-----------------------------------------------------------------------------------------------
|
||||
abstract_molehills.place_molehill = function(pos)
|
||||
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"
|
||||
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+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" then
|
||||
minetest.swap_node(right_here, {name="molehills:molehill"})
|
||||
end
|
||||
end
|
||||
|
||||
biome_lib:register_generate_plant({
|
||||
surface = {"default:dirt_with_grass"},
|
||||
max_count = Molehills_Max_Count,
|
||||
rarity = Molehills_Rarity,
|
||||
min_elevation = 1,
|
||||
max_elevation = 40,
|
||||
avoid_nodes = {"group:tree","group:liquid","group:stone","group:falling_node"--[[,"air"]]},
|
||||
avoid_radius = 4,
|
||||
plantlife_limit = -0.3,
|
||||
-- Generating
|
||||
minetest.register_decoration({
|
||||
decoration = {
|
||||
"molehills:molehill"
|
||||
},
|
||||
abstract_molehills.place_molehill
|
||||
)
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."]"..S("Loaded..."))
|
||||
-----------------------------------------------------------------------------------------------
|
||||
fill_ratio = molehill_rarity,
|
||||
y_min = 1,
|
||||
y_max = 40,
|
||||
place_on = {
|
||||
"default:dirt_with_grass"
|
||||
},
|
||||
spawn_by = "air",
|
||||
num_spawn_by = 3,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
})
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: molehills
|
||||
Mole Hill=Maulwurfshügel
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: molehills
|
||||
Mole Hill=Talpa Monteto
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: molehills
|
||||
Mole Hill=Taupinière
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: molehills
|
||||
Mole Hill=
|
|
@ -0,0 +1,2 @@
|
|||
name = molehills
|
||||
depends = default
|
|
@ -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 %)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# Molehill rarity (higher number -> higher probability)
|
||||
molehills.molehill_rarity (Molehill rarity) float 0.002 0.0001 1
|
|
@ -1,7 +1,9 @@
|
|||
-- support for i18n
|
||||
local S = plantlife_i18n.gettext
|
||||
local S = minetest.get_translator("nature_classic")
|
||||
-- Blossoms and such
|
||||
|
||||
local random = math.random
|
||||
|
||||
local function spawn_apple_under(pos)
|
||||
local below = {
|
||||
x = pos.x,
|
||||
|
@ -46,7 +48,7 @@ minetest.register_abm({
|
|||
chance = nature.leaves_blossom_chance,
|
||||
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if math.random(nature.leaves_blossom_chance) == 1 then
|
||||
if random(nature.leaves_blossom_chance) == 1 then
|
||||
nature.enqueue_node(pos, node, nature.blossom_node)
|
||||
end
|
||||
end
|
||||
|
@ -61,7 +63,7 @@ minetest.register_abm({
|
|||
chance = nature.blossom_leaves_chance,
|
||||
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if math.random(nature.blossom_leaves_chance) == 1 then
|
||||
if random(nature.blossom_leaves_chance) == 1 then
|
||||
nature.enqueue_node(pos, node, nature.blossom_leaves)
|
||||
end
|
||||
end
|
||||
|
@ -76,7 +78,7 @@ minetest.register_abm({
|
|||
chance = nature.apple_chance,
|
||||
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if math.random(4) == 1 and nature.dtime < 0.2 and not minetest.find_node_near(pos, nature.apple_spread, { "default:apple" }) then
|
||||
if random(4) == 1 and nature.dtime < 0.2 and not minetest.find_node_near(pos, nature.apple_spread, { "default:apple" }) then
|
||||
spawn_apple_under(pos)
|
||||
end
|
||||
end
|
||||
|
|