summaryrefslogtreecommitdiff
path: root/ferns
diff options
context:
space:
mode:
Diffstat (limited to 'ferns')
-rw-r--r--ferns/crafting.lua13
-rw-r--r--ferns/depends.txt3
-rw-r--r--ferns/fern.lua25
-rw-r--r--ferns/gianttreefern.lua22
-rw-r--r--ferns/horsetail.lua18
-rw-r--r--ferns/init.lua5
-rw-r--r--ferns/treefern.lua19
7 files changed, 60 insertions, 45 deletions
diff --git a/ferns/crafting.lua b/ferns/crafting.lua
index 8d8b3ed..7a74579 100644
--- a/ferns/crafting.lua
+++ b/ferns/crafting.lua
@@ -1,8 +1,10 @@
+-- support for i18n
+local S = plantlife_i18n.gettext
-----------------------------------------------------------------------------------------------
-- Ferns - Crafting 0.0.5
-----------------------------------------------------------------------------------------------
-- (by Mossmanikin)
--- License (everything): WTFPL
+-- License (everything): WTFPL
-----------------------------------------------------------------------------------------------
minetest.register_craft({
type = "shapeless",
@@ -27,7 +29,7 @@ minetest.register_craft({
minetest.register_alias("archaeplantae:fiddlehead", "ferns:fiddlehead")
minetest.register_craftitem("ferns:fiddlehead", {
- description = "Fiddlehead",
+ description = S("Fiddlehead"),
inventory_image = "ferns_fiddlehead.png",
on_use = minetest.item_eat(-1), -- slightly poisonous when raw
})
@@ -38,7 +40,7 @@ minetest.register_craft({
cooktime = 1,
})
minetest.register_craftitem("ferns:fiddlehead_roasted", {
- description = "Roasted Fiddlehead",
+ description = S("Roasted Fiddlehead"),
inventory_image = "ferns_fiddlehead_roasted.png",
on_use = minetest.item_eat(1), -- edible when cooked
})
@@ -48,7 +50,7 @@ minetest.register_craftitem("ferns:fiddlehead_roasted", {
minetest.register_alias("archaeplantae:ferntuber", "ferns:ferntuber")
minetest.register_craftitem("ferns:ferntuber", {
- description = "Fern Tuber",
+ description = S("Fern Tuber"),
inventory_image = "ferns_ferntuber.png",
})
minetest.register_craft({
@@ -61,7 +63,7 @@ minetest.register_craft({
minetest.register_alias("archaeplantae:ferntuber_roasted", "ferns:ferntuber_roasted")
minetest.register_craftitem("ferns:ferntuber_roasted", {
- description = "Roasted Fern Tuber",
+ description = S("Roasted Fern Tuber"),
inventory_image = "ferns_ferntuber_roasted.png",
on_use = minetest.item_eat(3),
})
@@ -101,4 +103,3 @@ minetest.register_craft({
output = "farming:hoe_wood",
recipe = {"farming:hoe_wood","group:horsetail","farming:string","default:stick"},
})]]
-
diff --git a/ferns/depends.txt b/ferns/depends.txt
index 9d994c0..6790d9e 100644
--- a/ferns/depends.txt
+++ b/ferns/depends.txt
@@ -1,2 +1,3 @@
default
-biome_lib \ No newline at end of file
+biome_lib
+plantlife_i18n
diff --git a/ferns/fern.lua b/ferns/fern.lua
index 48f9db2..ed0bd71 100644
--- a/ferns/fern.lua
+++ b/ferns/fern.lua
@@ -6,7 +6,7 @@
-- Contains code from: biome_lib
-- Looked at code from: default, flowers, painting, trees
-- Dependencies: biome_lib
--- Supports: dryplants, stoneage, sumpf
+-- Supports: dryplants, stoneage, sumpf
-----------------------------------------------------------------------------------------------
-- some inspiration from here
-- https://en.wikipedia.org/wiki/Athyrium_yokoscense
@@ -15,6 +15,9 @@
assert(abstract_ferns.config.enable_lady_fern == true)
+-- support for i18n
+local S = plantlife_i18n.gettext
+
-- Maintain backward compatibilty
minetest.register_alias("archaeplantae:fern", "ferns:fern_03")
minetest.register_alias("archaeplantae:fern_mid", "ferns:fern_02")
@@ -26,7 +29,7 @@ local nodenames = {}
local function create_nodes()
local images = { "ferns_fern.png", "ferns_fern_mid.png", "ferns_fern_big.png" }
local vscales = { 1, math.sqrt(8), math.sqrt(11) }
- local descs = { "Lady-fern (Athyrium)", nil, nil }
+ local descs = { S("Lady-fern (Athyrium)"), nil, nil }
for i = 1, 3 do
local node_on_place = nil
@@ -40,7 +43,7 @@ local function create_nodes()
end
nodenames[i] = "ferns:fern_"..string.format("%02d", i)
minetest.register_node(nodenames[i], {
- description = descs[i] or ("Lady-fern (Athyrium) " .. string.format("%02d", i)),
+ description = descs[i] or (S("Lady-fern (Athyrium)").." " .. string.format("%02d", i)),
inventory_image = "ferns_fern.png",
drawtype = "plantlike",
visual_scale = vscales[i],
@@ -91,8 +94,8 @@ if abstract_ferns.config.lady_ferns_near_tree == true then
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
- temp_max = -0.5, -- 55 °C (too hot?)
- temp_min = 0.75, -- -12 °C
+ temp_max = -0.5, -- 55 °C (too hot?)
+ temp_min = 0.75, -- -12 °C
random_facedir = { 0, 179 },
},
nodenames
@@ -118,8 +121,8 @@ if abstract_ferns.config.lady_ferns_near_rock == true then
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
- temp_max = -0.5, -- 55 °C (too hot?)
- temp_min = 0.75, -- -12 °C
+ temp_max = -0.5, -- 55 °C (too hot?)
+ temp_min = 0.75, -- -12 °C
random_facedir = { 0, 179 },
},
nodenames
@@ -156,8 +159,8 @@ if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
- temp_max = -0.5, -- 55 °C (too hot?)
- temp_min = 0.75, -- -12 °C
+ temp_max = -0.5, -- 55 °C (too hot?)
+ temp_min = 0.75, -- -12 °C
random_facedir = { 0, 179 },
},
nodenames
@@ -187,8 +190,8 @@ if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
- temp_max = -0.5, -- 55 °C (too hot?)
- temp_min = 0.75, -- -12 °C
+ temp_max = -0.5, -- 55 °C (too hot?)
+ temp_min = 0.75, -- -12 °C
random_facedir = { 0, 179 },
},
nodenames
diff --git a/ferns/gianttreefern.lua b/ferns/gianttreefern.lua
index 512acf6..c746194 100644
--- a/ferns/gianttreefern.lua
+++ b/ferns/gianttreefern.lua
@@ -5,11 +5,13 @@
-- License (everything): WTFPL
-- Contains code from: biome_lib
-- Looked at code from: 4seasons, default
--- Supports: vines
+-- Supports: vines
-----------------------------------------------------------------------------------------------
assert(abstract_ferns.config.enable_giant_treefern == true)
+-- support for i18n
+local S = plantlife_i18n.gettext
-- lot of code, lot to load
abstract_ferns.grow_giant_tree_fern = function(pos)
@@ -21,7 +23,7 @@ abstract_ferns.grow_giant_tree_fern = function(pos)
end
local size = math.random(12,16) -- min of range must be >= 4
-
+
local leafchecks = {
{
direction = 3,
@@ -102,7 +104,7 @@ end
-- GIANT TREE FERN LEAVES
-----------------------------------------------------------------------------------------------
minetest.register_node("ferns:tree_fern_leaves_giant", {
- description = "Tree Fern Crown (Dicksonia)",
+ description = S("Tree Fern Crown (Dicksonia)"),
drawtype = "plantlike",
visual_scale = math.sqrt(11),
wield_scale = {x=0.175, y=0.175, z=0.175},
@@ -144,7 +146,7 @@ minetest.register_node("ferns:tree_fern_leaves_giant", {
-- GIANT TREE FERN LEAVE PART
-----------------------------------------------------------------------------------------------
minetest.register_node("ferns:tree_fern_leave_big", {
- description = "Giant Tree Fern Leaves",
+ description = S("Giant Tree Fern Leaves"),
drawtype = "raillike",
paramtype = "light",
tiles = {
@@ -165,7 +167,7 @@ minetest.register_node("ferns:tree_fern_leave_big", {
-- GIANT TREE FERN LEAVE END
-----------------------------------------------------------------------------------------------
minetest.register_node("ferns:tree_fern_leave_big_end", {
- description = "Giant Tree Fern Leave End",
+ description = S("Giant Tree Fern Leave End"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
@@ -194,7 +196,7 @@ minetest.register_node("ferns:tree_fern_leave_big_end", {
-- GIANT TREE FERN TRUNK TOP
-----------------------------------------------------------------------------------------------
minetest.register_node("ferns:fern_trunk_big_top", {
- description = "Giant Fern Trunk",
+ description = S("Giant Fern Trunk"),
drawtype = "nodebox",
paramtype = "light",
tiles = {
@@ -231,7 +233,7 @@ minetest.register_node("ferns:fern_trunk_big_top", {
-- GIANT TREE FERN TRUNK
-----------------------------------------------------------------------------------------------
minetest.register_node("ferns:fern_trunk_big", {
- description = "Giant Fern Trunk",
+ description = S("Giant Fern Trunk"),
drawtype = "nodebox",
paramtype = "light",
tiles = {
@@ -251,8 +253,8 @@ minetest.register_node("ferns:fern_trunk_big", {
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})
+ 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,
@@ -262,7 +264,7 @@ minetest.register_node("ferns:fern_trunk_big", {
-- GIANT TREE FERN SAPLING
-----------------------------------------------------------------------------------------------
minetest.register_node("ferns:sapling_giant_tree_fern", {
- description = "Giant Tree Fern Sapling",
+ description = S("Giant Tree Fern Sapling"),
drawtype = "plantlike",
paramtype = "light",
tiles = {"ferns_sapling_tree_fern_giant.png"},
diff --git a/ferns/horsetail.lua b/ferns/horsetail.lua
index b87f1f9..16d1c90 100644
--- a/ferns/horsetail.lua
+++ b/ferns/horsetail.lua
@@ -6,11 +6,13 @@
-- Contains code from: biome_lib
-- Looked at code from: default, flowers, trees
-- Dependencies: biome_lib
--- Supports: dryplants, stoneage, sumpf
+-- Supports: dryplants, stoneage, sumpf
-----------------------------------------------------------------------------------------------
assert(abstract_ferns.config.enable_horsetails == true)
+-- support for i18n
+local S = plantlife_i18n.gettext
-----------------------------------------------------------------------------------------------
-- HORSETAIL (EQUISETUM)
-----------------------------------------------------------------------------------------------
@@ -33,13 +35,13 @@ local function create_nodes()
local node_drop = "ferns:horsetail_04"
if i == 1 then
- node_desc = "Young Horsetail (Equisetum)"
+ node_desc = S("Young Horsetail (Equisetum)")
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 = "Horsetail (Equisetum)"
+ node_desc = S("Horsetail (Equisetum)")
else
- node_desc = "Horsetail (Equisetum) ".. string.format("%02d", i)
+ node_desc = S("Horsetail (Equisetum)").." ".. string.format("%02d", i)
end
node_names[i] = node_name
@@ -125,8 +127,8 @@ if abstract_ferns.config.enable_horsetails_on_grass == true then
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_min = 0.4,
- temp_max = -0.5, -- 55 °C
- temp_min = 0.53, -- 0 °C, dies back in winter
+ temp_max = -0.5, -- 55 °C
+ temp_min = 0.53, -- 0 °C, dies back in winter
--random_facedir = { 0, 179 },
},
node_names
@@ -147,8 +149,8 @@ if abstract_ferns.config.enable_horsetails_on_stones == true then
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
humidity_min = 0.4,
- temp_max = -0.5, -- 55 °C
- temp_min = 0.53, -- 0 °C, dies back in winter
+ temp_max = -0.5, -- 55 °C
+ temp_min = 0.53, -- 0 °C, dies back in winter
--random_facedir = { 0, 179 },
},
node_names
diff --git a/ferns/init.lua b/ferns/init.lua
index b629d5d..6e7dcac 100644
--- a/ferns/init.lua
+++ b/ferns/init.lua
@@ -4,11 +4,14 @@ local version = "0.2.0"
local mname = "ferns" -- former "archaeplantae"
-----------------------------------------------------------------------------------------------
-- (by Mossmanikin)
--- License (everything): WTFPL
+-- License (everything): WTFPL
-----------------------------------------------------------------------------------------------
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
diff --git a/ferns/treefern.lua b/ferns/treefern.lua
index 01d7318..db4bc37 100644
--- a/ferns/treefern.lua
+++ b/ferns/treefern.lua
@@ -4,9 +4,12 @@
-- by Mossmanikin
-- License (everything): WTFPL
-- Contains code from: biome_lib
--- Looked at code from: default , trees
+-- Looked at code from: default , trees
-----------------------------------------------------------------------------------------------
+-- support for i18n
+local S = plantlife_i18n.gettext
+
assert(abstract_ferns.config.enable_treefern == true)
abstract_ferns.grow_tree_fern = function(pos)
@@ -17,14 +20,14 @@ abstract_ferns.grow_tree_fern = function(pos)
and minetest.get_node(pos_01).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
@@ -53,7 +56,7 @@ end
-- TODO: Both of these nodes look the same?
minetest.register_node("ferns:tree_fern_leaves", {
- description = "Tree Fern Crown (Dicksonia)",
+ description = S("Tree Fern Crown (Dicksonia)"),
drawtype = "plantlike",
visual_scale = math.sqrt(8),
paramtype = "light",
@@ -122,7 +125,7 @@ minetest.register_node("ferns:tree_fern_leaves_02", {
-- FERN TRUNK
-----------------------------------------------------------------------------------------------
minetest.register_node("ferns:fern_trunk", {
- description = "Fern Trunk (Dicksonia)",
+ description = S("Fern Trunk (Dicksonia)"),
drawtype = "nodebox",
paramtype = "light",
tiles = {
@@ -142,8 +145,8 @@ minetest.register_node("ferns:fern_trunk", {
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})
+ 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,
@@ -153,7 +156,7 @@ minetest.register_node("ferns:fern_trunk", {
-- TREE FERN SAPLING
-----------------------------------------------------------------------------------------------
minetest.register_node("ferns:sapling_tree_fern", {
- description = "Tree Fern Sapling (Dicksonia)",
+ description = S("Tree Fern Sapling (Dicksonia)"),
drawtype = "plantlike",
paramtype = "light",
paramtype2 = "facedir",