summaryrefslogtreecommitdiff
path: root/youngtrees
diff options
context:
space:
mode:
Diffstat (limited to 'youngtrees')
-rw-r--r--youngtrees/depends.txt3
-rw-r--r--youngtrees/init.lua41
2 files changed, 24 insertions, 20 deletions
diff --git a/youngtrees/depends.txt b/youngtrees/depends.txt
index 4e35179..d48236a 100644
--- a/youngtrees/depends.txt
+++ b/youngtrees/depends.txt
@@ -1,2 +1,3 @@
default
-biome_lib \ No newline at end of file
+biome_lib
+plantlife_i18n
diff --git a/youngtrees/init.lua b/youngtrees/init.lua
index 183e86e..ddd4637 100644
--- a/youngtrees/init.lua
+++ b/youngtrees/init.lua
@@ -1,7 +1,10 @@
-abstract_youngtrees = {}
+-- support for i18n
+local S = plantlife_i18n.gettext
+
+abstract_youngtrees = {}
minetest.register_node("youngtrees:bamboo", {
- description = "Young Bamboo Tree",
+ description = S("Young Bamboo Tree"),
drawtype="nodebox",
tiles = {"bamboo.png"},
paramtype = "light",
@@ -21,11 +24,11 @@ minetest.register_node("youngtrees:bamboo", {
})
minetest.register_node("youngtrees:youngtree2_middle",{
- description = "Young Tree 2 (middle)",
+ description = S("Young Tree 2 (middle)"),
drawtype="nodebox",
tiles = {"youngtree2branch.png"},
inventory_image = "youngtree2branch.png",
- wield_image = "youngtree2branch.png",
+ wield_image = "youngtree2branch.png",
paramtype = "light",
walkable = false,
is_ground_content = true,
@@ -43,7 +46,7 @@ minetest.register_node("youngtrees:youngtree2_middle",{
})
minetest.register_node("youngtrees:youngtree_top", {
- description = "Young Tree (top)",
+ description = S("Young Tree (top)"),
drawtype = "plantlike",
tiles = {"youngtree16xa.png"},
inventory_image = "youngtree16xa.png",
@@ -60,9 +63,9 @@ minetest.register_node("youngtrees:youngtree_top", {
drop = 'trunks:twig_1'
})
-
+
minetest.register_node("youngtrees:youngtree_middle", {
- description = "Young Tree (middle)",
+ description = S("Young Tree (middle)"),
drawtype = "plantlike",
tiles = {"youngtree16xb.png"},
inventory_image = "youngtree16xb.png",
@@ -80,9 +83,9 @@ minetest.register_node("youngtrees:youngtree_middle", {
})
-
+
minetest.register_node("youngtrees:youngtree_bottom", {
- description = "Young Tree (bottom)",
+ description = S("Young Tree (bottom)"),
drawtype = "plantlike",
tiles = {"youngtree16xc.png"},
inventory_image = "youngtree16xc.png",
@@ -98,19 +101,19 @@ minetest.register_node("youngtrees:youngtree_bottom", {
sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1'
})
-
-
+
+
abstract_youngtrees.grow_youngtree = function(pos)
- local height = math.random(1,3)
+ local height = math.random(1,3)
abstract_youngtrees.grow_youngtree_node(pos,height)
end
abstract_youngtrees.grow_youngtree_node = function(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}
-
+
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then
if height == 1 then
@@ -119,20 +122,20 @@ abstract_youngtrees.grow_youngtree_node = function(pos, height)
if height == 2 then
minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"})
minetest.set_node(above_right_here, {name="youngtrees:youngtree_top"})
- end
+ end
if height == 3 then
local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z}
minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"})
minetest.set_node(above_right_here, {name="youngtrees:youngtree_middle"})
minetest.set_node(two_above_right_here, {name="youngtrees:youngtree_top"})
- end
+ end
end
end
biome_lib:register_generate_plant({
surface = {
- "default:dirt_with_grass",
+ "default:dirt_with_grass",
"stoneage:grass_with_silex",
"sumpf:peat",
"sumpf:sumpf"
@@ -143,4 +146,4 @@ biome_lib:register_generate_plant({
plantlife_limit = -0.9,
},
abstract_youngtrees.grow_youngtree
-)
+)