many worldgen mods and gonna try technic now
No files matched your search
@@ -0,0 +1,81 @@
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("ferns")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Ferns - Crafting 0.0.5
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- (by Mossmanikin)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
local fern1 = minetest.registered_items["default:fern_1"] or false
|
||||
fern1 = (fern1 and fern1.name) or "ferns:fern_01"
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "ferns:fiddlehead 3",
|
||||
recipe = {"ferns:fern_01"},
|
||||
replacements = {
|
||||
{fern1, "ferns:ferntuber"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "ferns:fiddlehead 3",
|
||||
recipe = {"ferns:tree_fern_leaves"},
|
||||
replacements = {
|
||||
{"ferns:tree_fern_leaves", "ferns:sapling_tree_fern"}
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- FIDDLEHEAD
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_alias("archaeplantae:fiddlehead", "ferns:fiddlehead")
|
||||
|
||||
minetest.register_craftitem("ferns:fiddlehead", {
|
||||
description = S("Fiddlehead"),
|
||||
inventory_image = "ferns_fiddlehead.png",
|
||||
on_use = minetest.item_eat(-1), -- slightly poisonous when raw
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "ferns:fiddlehead_roasted",
|
||||
recipe = "ferns:fiddlehead",
|
||||
cooktime = 1,
|
||||
})
|
||||
minetest.register_craftitem("ferns:fiddlehead_roasted", {
|
||||
description = S("Roasted Fiddlehead"),
|
||||
inventory_image = "ferns_fiddlehead_roasted.png",
|
||||
on_use = minetest.item_eat(1), -- edible when cooked
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- FERN TUBER
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_alias("archaeplantae:ferntuber", "ferns:ferntuber")
|
||||
|
||||
minetest.register_craftitem("ferns:ferntuber", {
|
||||
description = S("Fern Tuber"),
|
||||
inventory_image = "ferns_ferntuber.png",
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "ferns:ferntuber_roasted",
|
||||
recipe = "ferns:ferntuber",
|
||||
cooktime = 3,
|
||||
})
|
||||
|
||||
minetest.register_alias("archaeplantae:ferntuber_roasted", "ferns:ferntuber_roasted")
|
||||
|
||||
minetest.register_craftitem("ferns:ferntuber_roasted", {
|
||||
description = S("Roasted Fern Tuber"),
|
||||
inventory_image = "ferns_ferntuber_roasted.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- HORSETAIL (EQUISETUM) --> GREEN DYE https://en.wikipedia.org/wiki/Equisetum
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:green",
|
||||
recipe = {"group:horsetail"},
|
||||
})
|
||||
@@ -0,0 +1,109 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Ferns - Fern 0.1.0
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: default, flowers, painting, trees
|
||||
-- Supports: dryplants, stoneage, sumpf
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- some inspiration from here
|
||||
-- https://en.wikipedia.org/wiki/Athyrium_yokoscense
|
||||
-- http://www.mygarden.net.au/gardening/athyrium-yokoscense/3900/1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
minetest.register_alias("ferns:fern_03", "default:fern_3")
|
||||
minetest.register_alias("ferns:fern_02", "default:fern_2")
|
||||
minetest.register_alias("ferns:fern_01", "default:fern_1")
|
||||
|
||||
-- minetest-0.5: End
|
||||
minetest.register_alias("archaeplantae:fern", "ferns:fern_03")
|
||||
minetest.register_alias("archaeplantae:fern_mid", "ferns:fern_02")
|
||||
minetest.register_alias("archaeplantae:fern_small", "ferns:fern_01")
|
||||
minetest.register_alias("ferns:fern_04", "ferns:fern_02") -- for placing
|
||||
|
||||
local nodenames = {}
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Init
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
for i = 1, 3 do
|
||||
nodenames[i] = "ferns:fern_"..string.format("%02d", i)
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Spawning
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
minetest.register_decoration({ -- near trees (woodlands)
|
||||
decoration = nodenames,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"default:jungletree",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
y_min = 1, -- above sea level
|
||||
param2 = 0,
|
||||
param2_max = 179,
|
||||
spawn_by = "group:tree",
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.1,
|
||||
})
|
||||
|
||||
minetest.register_decoration({ -- near stone (mountains)
|
||||
decoration = nodenames,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"group:falling_node",
|
||||
--"default:jungletree",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
y_min = 1, -- above sea level
|
||||
param2 = 0,
|
||||
param2_max = 179,
|
||||
spawn_by = "group:stone",
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.3,
|
||||
})
|
||||
|
||||
minetest.register_decoration({ -- near stone (mountains)
|
||||
decoration = nodenames,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:stone_with_coal",
|
||||
"default:stone_with_iron",
|
||||
"default:stone_with_tin",
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
y_min = 1, -- above sea level
|
||||
param2 = 0,
|
||||
param2_max = 179,
|
||||
spawn_by = {
|
||||
"default:stone_with_iron",
|
||||
--"default:stone_with_copper",
|
||||
--"default:stone_with_mese",
|
||||
--"default:stone_with_gold",
|
||||
--"default:stone_with_diamond",
|
||||
"default:stone_with_tin",
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver"
|
||||
--"moreores:mineral_mithril"
|
||||
},
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.8,
|
||||
})
|
||||
@@ -0,0 +1,353 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Ferns - Giant Tree Fern 0.1.1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: 4seasons, default
|
||||
-- Supports: vines
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- support for i18n
|
||||
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
|
||||
if name ~= "air" and name ~= "ferns:sapling_giant_tree_fern"
|
||||
and name ~= "default:junglegrass" then
|
||||
return
|
||||
end
|
||||
|
||||
local size = math.random(12,16) -- min of range must be >= 4
|
||||
|
||||
local leafchecks = {
|
||||
{
|
||||
direction = 3,
|
||||
positions = {
|
||||
{x = pos.x + 1, y = pos.y + size - 1, z = pos.z },
|
||||
{x = pos.x + 2, y = pos.y + size , z = pos.z },
|
||||
{x = pos.x + 3, y = pos.y + size - 1, z = pos.z },
|
||||
{x = pos.x + 4, y = pos.y + size - 2, z = pos.z }
|
||||
}
|
||||
},
|
||||
{
|
||||
direction = 1,
|
||||
positions = {
|
||||
{x = pos.x - 1, y = pos.y + size - 1, z = pos.z },
|
||||
{x = pos.x - 2, y = pos.y + size, z = pos.z },
|
||||
{x = pos.x - 3, y = pos.y + size - 1, z = pos.z },
|
||||
{x = pos.x - 4, y = pos.y + size - 2, z = pos.z }
|
||||
}
|
||||
},
|
||||
{
|
||||
direction = 2,
|
||||
positions = {
|
||||
{x = pos.x , y = pos.y + size - 1, z = pos.z + 1},
|
||||
{x = pos.x , y = pos.y + size , z = pos.z + 2},
|
||||
{x = pos.x , y = pos.y + size - 1, z = pos.z + 3},
|
||||
{x = pos.x , y = pos.y + size - 2, z = pos.z + 4}
|
||||
}
|
||||
},
|
||||
{
|
||||
direction = 0,
|
||||
positions = {
|
||||
{x = pos.x , y = pos.y + size - 1, z = pos.z - 1},
|
||||
{x = pos.x , y = pos.y + size , z = pos.z - 2},
|
||||
{x = pos.x , y = pos.y + size - 1, z = pos.z - 3},
|
||||
{x = pos.x , y = pos.y + size - 2, z = pos.z - 4}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local brk = false
|
||||
for i = 1, size-3 do
|
||||
pos_aux.y = pos.y + i
|
||||
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
|
||||
minetest.swap_node({x = pos.x, y = pos.y + i, z = pos.z}, {name="ferns:fern_trunk_big"})
|
||||
end
|
||||
if not brk then
|
||||
minetest.swap_node({x = pos.x, y = pos.y + size-2, z = pos.z}, {name="ferns:fern_trunk_big_top"})
|
||||
minetest.swap_node({x = pos.x, y = pos.y + size-1, z = pos.z}, {name="ferns:tree_fern_leaves_giant"})
|
||||
|
||||
-- all the checking for air below is to prevent some ugly bugs (incomplete trunks of neighbouring trees), it's a bit slower, but worth the result
|
||||
|
||||
-- assert(#leafchecks == 4)
|
||||
for i = 1, 4 do
|
||||
local positions = leafchecks[i].positions
|
||||
local rot = leafchecks[i].direction
|
||||
local endpos = 4 -- If the loop below adds all intermediate leaves then the "terminating" leaf will be at positions[4]
|
||||
-- assert(#positions == 4)
|
||||
-- add leaves so long as the destination nodes are air
|
||||
for j = 1, 3 do
|
||||
if minetest.get_node(positions[j]).name == "air" then
|
||||
minetest.swap_node(positions[j], {name="ferns:tree_fern_leave_big"})
|
||||
else
|
||||
endpos = j
|
||||
break
|
||||
end
|
||||
end
|
||||
-- add the terminating leaf if required and possible
|
||||
if endpos == 4 and minetest.get_node(positions[endpos]).name == "air" then
|
||||
minetest.swap_node(positions[endpos], {name="ferns:tree_fern_leave_big_end", param2=rot})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GIANT TREE FERN LEAVES
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("ferns:tree_fern_leaves_giant", {
|
||||
description = S("Tree Fern Crown (Dicksonia)"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = math.sqrt(11),
|
||||
wield_scale = {x=0.175, y=0.175, z=0.175},
|
||||
paramtype = "light",
|
||||
tiles = {"ferns_fern_tree_giant.png"},
|
||||
inventory_image = "ferns_fern_tree.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1,
|
||||
not_in_creative_inventory=1
|
||||
},
|
||||
is_ground_content = false,
|
||||
drop = {
|
||||
max_items = 2,
|
||||
items = {
|
||||
{
|
||||
-- occasionally, drop a second sapling instead of leaves
|
||||
-- (extra saplings can also be obtained by replanting and
|
||||
-- reharvesting leaves)
|
||||
items = {"ferns:sapling_giant_tree_fern"},
|
||||
rarity = 10,
|
||||
},
|
||||
{
|
||||
items = {"ferns:sapling_giant_tree_fern"},
|
||||
},
|
||||
{
|
||||
items = {"ferns:tree_fern_leaves_giant"},
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GIANT TREE FERN LEAVE PART
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("ferns:tree_fern_leave_big", {
|
||||
description = S("Giant Tree Fern Leaves"),
|
||||
drawtype = "raillike",
|
||||
paramtype = "light",
|
||||
tiles = {
|
||||
"ferns_tree_fern_leave_big.png",
|
||||
},
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1,
|
||||
not_in_creative_inventory=1
|
||||
},
|
||||
is_ground_content = false,
|
||||
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,
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GIANT TREE FERN LEAVE END
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("ferns:tree_fern_leave_big_end", {
|
||||
description = S("Giant Tree Fern Leave End"),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = { "ferns_tree_fern_leave_big_end.png" },
|
||||
use_texture_alpha = "clip",
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
-- {left, bottom, front, right, top, back }
|
||||
fixed = {-1/2, -1/2, 1/2, 1/2, 33/64, 1/2},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, 1/2, 1/2, 33/64, 1/2},
|
||||
},
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1,
|
||||
not_in_creative_inventory=1
|
||||
},
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GIANT TREE FERN TRUNK TOP
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("ferns:fern_trunk_big_top", {
|
||||
description = S("Giant Fern Trunk"),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
tiles = {
|
||||
"ferns_fern_trunk_big_top.png^ferns_tree_fern_leave_big_cross.png",
|
||||
"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 }
|
||||
fixed = {
|
||||
{-1/2, 33/64, -1/2, 1/2, 33/64, 1/2},
|
||||
{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4},
|
||||
},
|
||||
groups = {
|
||||
tree=1,
|
||||
choppy=2,
|
||||
oddly_breakable_by_hand=2,
|
||||
flammable=3,
|
||||
wood=1,
|
||||
not_in_creative_inventory=1,
|
||||
leafdecay=3 -- to support vines
|
||||
},
|
||||
is_ground_content = false,
|
||||
drop = "ferns:fern_trunk_big",
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GIANT TREE FERN TRUNK
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("ferns:fern_trunk_big", {
|
||||
description = S("Giant Fern Trunk"),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
tiles = {
|
||||
"ferns_fern_trunk_big_top.png",
|
||||
"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},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4},
|
||||
},
|
||||
groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "ferns:fern_trunk_big" or node.name == "ferns:fern_trunk_big_top" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"ferns:fern_trunk_big")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GIANT TREE FERN SAPLING
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("ferns:sapling_giant_tree_fern", {
|
||||
description = S("Giant Tree Fern Sapling"),
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
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,sapling=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
})
|
||||
|
||||
-- abm
|
||||
minetest.register_abm({
|
||||
nodenames = "ferns:sapling_giant_tree_fern",
|
||||
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
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GENERATE GIANT TREE FERN
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter", "default:sand", "default:desert_sand"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.012,
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
spawn_by = "default:jungletree",
|
||||
num_spawn_by = 1,
|
||||
decoration = "ferns:sapling_giant_tree_fern",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:sand"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.012,
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
spawn_by = "default:water_source,default:river_water_source",
|
||||
num_spawn_by = 1,
|
||||
decoration = "ferns:sapling_giant_tree_fern",
|
||||
})
|
||||
@@ -0,0 +1,113 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Archae Plantae - Horsetail 0.0.5
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: default, flowers, trees
|
||||
-- Dependencies: biome_lib
|
||||
-- Supports: dryplants, stoneage, sumpf
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("ferns")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- HORSETAIL (EQUISETUM)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
local node_names = {}
|
||||
|
||||
local function create_nodes()
|
||||
local selection_boxes = {
|
||||
{ -0.15, -1/2, -0.15, 0.15, -1/16, 0.15 },
|
||||
{ -0.15, -1/2, -0.15, 0.15, 1/16, 0.15 },
|
||||
{ -0.15, -1/2, -0.15, 0.15, 4/16, 0.15 },
|
||||
{ -0.15, -1/2, -0.15, 0.15, 7/16, 0.15 },
|
||||
}
|
||||
|
||||
for i = 1, 4 do
|
||||
local node_name = "ferns:horsetail_" .. string.format("%02d", i)
|
||||
local node_img = "ferns_horsetail_" .. string.format("%02d", i) .. ".png"
|
||||
local node_desc
|
||||
local node_on_use = nil
|
||||
local node_drop = "ferns:horsetail_04"
|
||||
|
||||
if i == 1 then
|
||||
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) @1", i)
|
||||
end
|
||||
|
||||
node_names[i] = node_name
|
||||
|
||||
minetest.register_node(node_name, {
|
||||
description = node_desc,
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = { node_img },
|
||||
inventory_image = node_img,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy=3,flammable=2,attached_node=1,horsetail=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = selection_boxes[i],
|
||||
},
|
||||
on_use = node_on_use,
|
||||
drop = node_drop,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Init
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
create_nodes()
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Generating
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
minetest.register_decoration({ -- near trees (woodlands)
|
||||
decoration = node_names,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
y_min = 1, -- above sea level
|
||||
spawn_by = {
|
||||
"group:water", -- likes water (of course)
|
||||
"default:gravel", -- near those on gravel
|
||||
"default:sand", -- some like sand
|
||||
"default:clay", -- some like clay
|
||||
"stoneage:grass_with_silex",
|
||||
"default:mossycobble",
|
||||
"default:cobble",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.1,
|
||||
})
|
||||
|
||||
minetest.register_decoration({ -- near trees (woodlands)
|
||||
decoration = node_names,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:gravel", -- roots go deep
|
||||
"default:mossycobble",
|
||||
"stoneage:dirt_with_silex",
|
||||
"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex", -- roots go deep
|
||||
},
|
||||
y_min = 1, -- above sea level
|
||||
fill_ratio = 0.1,
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
abstract_ferns = {}
|
||||
|
||||
dofile(minetest.get_modpath("ferns").."/fern.lua")
|
||||
dofile(minetest.get_modpath("ferns").."/horsetail.lua")
|
||||
dofile(minetest.get_modpath("ferns").."/treefern.lua")
|
||||
dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
|
||||
dofile(minetest.get_modpath("ferns").."/crafting.lua")
|
||||
@@ -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
|
||||
|
After Width: | Height: | Size: 550 B |
|
After Width: | Height: | Size: 666 B |
|
After Width: | Height: | Size: 669 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 362 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 699 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 391 B |
|
After Width: | Height: | Size: 264 B |
|
After Width: | Height: | Size: 256 B |
|
After Width: | Height: | Size: 671 B |
|
After Width: | Height: | Size: 684 B |
|
After Width: | Height: | Size: 398 B |
|
After Width: | Height: | Size: 233 B |
|
After Width: | Height: | Size: 438 B |
|
After Width: | Height: | Size: 428 B |
|
After Width: | Height: | Size: 327 B |
|
After Width: | Height: | Size: 521 B |
|
After Width: | Height: | Size: 150 B |
|
After Width: | Height: | Size: 166 B |
|
After Width: | Height: | Size: 199 B |
|
After Width: | Height: | Size: 224 B |
|
After Width: | Height: | Size: 168 B |
|
After Width: | Height: | Size: 224 B |
|
After Width: | Height: | Size: 560 B |
|
After Width: | Height: | Size: 724 B |
|
After Width: | Height: | Size: 456 B |
@@ -0,0 +1,237 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Ferns - Tree Fern 0.1.1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: default , trees
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("ferns")
|
||||
|
||||
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}
|
||||
local name = minetest.get_node(pos_aux).name
|
||||
if name ~= "air" and name ~= "ferns:sapling_tree_fern"
|
||||
and name ~= "default:junglegrass" then
|
||||
return
|
||||
end
|
||||
|
||||
local size = math.random(1, 4) + math.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 i = 1
|
||||
local brk = false
|
||||
while (i < size) do
|
||||
pos_aux.y = pos.y + i
|
||||
name = minetest.get_node(pos_aux).name
|
||||
if not (name == "air" or (i == 1 and name == "ferns:sapling_tree_fern")) then
|
||||
brk = true
|
||||
break
|
||||
end
|
||||
minetest.swap_node({x = pos.x, y = pos.y + i, z = pos.z}, { name = "ferns:fern_trunk" })
|
||||
i = i + 1
|
||||
end
|
||||
if not brk then
|
||||
minetest.swap_node({x = pos.x, y = pos.y + i - 1, z = pos.z}, { name = crown })
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- TREE FERN LEAVES
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- TODO: Both of these nodes look the same?
|
||||
|
||||
minetest.register_node("ferns:tree_fern_leaves", {
|
||||
description = S("Tree Fern Crown (Dicksonia)"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = math.sqrt(8),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
--tiles = {"[combine:32x32:0,0=top_left.png:0,16=bottom_left.png:16,0=top_right.png:16,16=bottom_right.png"},
|
||||
tiles = {"ferns_fern_tree.png"},
|
||||
inventory_image = "ferns_fern_tree_inv.png",
|
||||
walkable = false,
|
||||
groups = {snappy=3,flammable=2,attached_node=1},
|
||||
is_ground_content = false,
|
||||
drop = {
|
||||
max_items = 2,
|
||||
items = {
|
||||
{
|
||||
-- occasionally, drop a second sapling instead of leaves
|
||||
-- (extra saplings can also be obtained by replanting and
|
||||
-- reharvesting leaves)
|
||||
items = {"ferns:sapling_tree_fern"},
|
||||
rarity = 10,
|
||||
},
|
||||
{
|
||||
items = {"ferns:sapling_tree_fern"},
|
||||
},
|
||||
{
|
||||
items = {"ferns:tree_fern_leaves"},
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
})
|
||||
minetest.register_node("ferns:tree_fern_leaves_02", {
|
||||
drawtype = "plantlike",
|
||||
visual_scale = math.sqrt(8),
|
||||
paramtype = "light",
|
||||
tiles = {"ferns_fern_big.png"},
|
||||
walkable = false,
|
||||
groups = {snappy=3,flammable=2,attached_node=1,not_in_creative_inventory=1},
|
||||
is_ground_content = false,
|
||||
drop = {
|
||||
max_items = 2,
|
||||
items = {
|
||||
{
|
||||
-- occasionally, drop a second sapling instead of leaves
|
||||
-- (extra saplings can also be obtained by replanting and
|
||||
-- reharvesting leaves)
|
||||
items = {"ferns:sapling_tree_fern"},
|
||||
rarity = 10,
|
||||
},
|
||||
{
|
||||
items = {"ferns:sapling_tree_fern"},
|
||||
},
|
||||
{
|
||||
items = {"ferns:tree_fern_leaves"},
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- FERN TRUNK
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("ferns:fern_trunk", {
|
||||
description = S("Fern Trunk (Dicksonia)"),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
tiles = {
|
||||
"ferns_fern_trunk_top.png",
|
||||
"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},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
|
||||
},
|
||||
groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "ferns:fern_trunk" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"ferns:fern_trunk")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- TREE FERN SAPLING
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("ferns:sapling_tree_fern", {
|
||||
description = S("Tree Fern Sapling (Dicksonia)"),
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
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,sapling=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
})
|
||||
-- abm
|
||||
minetest.register_abm({
|
||||
nodenames = "ferns:sapling_tree_fern",
|
||||
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
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GENERATE TREE FERN
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- in jungles
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter",
|
||||
"default:sand",
|
||||
"default:desert_sand",
|
||||
},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.002,
|
||||
biomes = {"rainforest", "rainforest_swamp"},
|
||||
y_min = -10,
|
||||
y_max = 31000,
|
||||
spawn_by = "default:jungletree",
|
||||
num_spawn_by = 1,
|
||||
decoration = "ferns:sapling_tree_fern",
|
||||
flags = "force_placement",
|
||||
})
|
||||
|
||||
-- for oases & tropical beaches
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:sand"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.002,
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
spawn_by = {"default:water_source", "default:river_water_source"},
|
||||
num_spawn_by = 1,
|
||||
decoration = "ferns:sapling_tree_fern",
|
||||
flags = "force_placement",
|
||||
})
|
||||