summaryrefslogtreecommitdiff
path: root/trunks
diff options
context:
space:
mode:
Diffstat (limited to 'trunks')
-rw-r--r--trunks/depends.txt3
-rw-r--r--trunks/init.lua5
-rw-r--r--trunks/nodes.lua38
3 files changed, 26 insertions, 20 deletions
diff --git a/trunks/depends.txt b/trunks/depends.txt
index 99cfba1..dd4373b 100644
--- a/trunks/depends.txt
+++ b/trunks/depends.txt
@@ -1,6 +1,7 @@
default
biome_lib
+plantlife_i18n
bushes?
ferns?
moretrees?
-trees? \ No newline at end of file
+trees?
diff --git a/trunks/init.lua b/trunks/init.lua
index ee9427d..899f6a9 100644
--- a/trunks/init.lua
+++ b/trunks/init.lua
@@ -7,6 +7,9 @@ local mname = "trunks"
abstract_trunks = {}
+-- support for i18n
+local S = plantlife_i18n.gettext
+
dofile(minetest.get_modpath("trunks").."/trunks_settings.txt")
dofile(minetest.get_modpath("trunks").."/generating.lua")
dofile(minetest.get_modpath("trunks").."/nodes.lua")
@@ -14,4 +17,4 @@ dofile(minetest.get_modpath("trunks").."/crafting.lua")
-----------------------------------------------------------------------------------------------
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
------------------------------------------------------------------------------------------------ \ No newline at end of file
+-----------------------------------------------------------------------------------------------
diff --git a/trunks/nodes.lua b/trunks/nodes.lua
index f490871..38c2212 100644
--- a/trunks/nodes.lua
+++ b/trunks/nodes.lua
@@ -1,4 +1,6 @@
-- Code by Mossmanikin & Neuromancer
+-- support for i18n
+local S = plantlife_i18n.gettext
-----------------------------------------------------------------------------------------------
-- TWiGS
-----------------------------------------------------------------------------------------------
@@ -13,11 +15,11 @@ for i in pairs(NoDe) do
local NR = NoDe[i][1]
local iNV = NR - 1
minetest.register_node("trunks:twig_"..NR, {
- description = "Twig",
+ description = S("Twig"),
inventory_image = "trunks_twig_"..NR..".png",
wield_image = "trunks_twig_"..NR..".png",
drawtype = "nodebox",
- tiles = {
+ tiles = {
"trunks_twig_"..NR..".png",
"trunks_twig_"..NR..".png^[transformFY", -- mirror
"trunks_twig_6.png" -- empty
@@ -58,7 +60,7 @@ end
local flat_moss = {-1/2, -1/2, -1/2, 1/2, -15/32--[[<-flickers if smaller]], 1/2}
minetest.register_node("trunks:moss", {
- description = "Moss",
+ description = S("Moss"),
drawtype = "nodebox",--"signlike",
tiles = {"trunks_moss.png"},
inventory_image = "trunks_moss.png",
@@ -77,7 +79,7 @@ minetest.register_node("trunks:moss", {
-- MoSS & FuNGuS
-----------------------------------------------------------------------------------------------
minetest.register_node("trunks:moss_fungus", {
- description = "Moss with Fungus",
+ description = S("Moss with Fungus"),
drawtype = "nodebox",--"signlike",
tiles = {"trunks_moss_fungus.png"},
inventory_image = "trunks_moss_fungus.png",
@@ -98,7 +100,7 @@ minetest.register_node("trunks:moss_fungus", {
minetest.register_alias("woodstuff:twigs", "trunks:twigs")
minetest.register_node("trunks:twigs", {
- description = "Twigs Block",
+ description = S("Twigs Block"),
paramtype2 = "facedir",
tiles = {"trunks_twigs.png"},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
@@ -111,7 +113,7 @@ minetest.register_node("trunks:twigs", {
minetest.register_alias("woodstuff:twigs_slab", "trunks:twigs_slab")
minetest.register_node("trunks:twigs_slab", {
- description = "Twigs Slab",
+ description = S("Twigs Slab"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
@@ -130,7 +132,7 @@ minetest.register_node("trunks:twigs_slab", {
minetest.register_alias("woodstuff:twigs_roof", "trunks:twigs_roof")
minetest.register_node("trunks:twigs_roof", {
- description = "Twigs Roof",
+ description = S("Twigs Roof"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
@@ -153,7 +155,7 @@ minetest.register_node("trunks:twigs_roof", {
minetest.register_alias("woodstuff:twigs_roof_corner", "trunks:twigs_roof_corner")
minetest.register_node("trunks:twigs_roof_corner", {
- description = "Twigs Roof Corner 1",
+ description = S("Twigs Roof Corner 1"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
@@ -181,7 +183,7 @@ minetest.register_node("trunks:twigs_roof_corner", {
minetest.register_alias("woodstuff:twigs_roof_corner_2", "trunks:twigs_roof_corner_2")
minetest.register_node("trunks:twigs_roof_corner_2", {
- description = "Twigs Roof Corner 2",
+ description = S("Twigs Roof Corner 2"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
@@ -214,7 +216,7 @@ if Auto_Roof_Corner == true then
interval = 1,
chance = 1,
action = function(pos)
-
+
local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z })
local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z })
local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
@@ -227,7 +229,7 @@ if Auto_Roof_Corner == true then
then
minetest.set_node(pos, {name=corner, param2=0})
end
-
+
if ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 0)
@@ -235,7 +237,7 @@ if Auto_Roof_Corner == true then
then
minetest.set_node(pos, {name=corner, param2=1})
end
-
+
if ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 1)
@@ -243,7 +245,7 @@ if Auto_Roof_Corner == true then
then
minetest.set_node(pos, {name=corner, param2=2})
end
-
+
if ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 2)
@@ -259,7 +261,7 @@ if Auto_Roof_Corner == true then
then
minetest.set_node(pos, {name=corner_2, param2=0})
end
-
+
if ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner_2 and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 2)
@@ -267,7 +269,7 @@ if Auto_Roof_Corner == true then
then
minetest.set_node(pos, {name=corner_2, param2=1})
end
-
+
if ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner_2 and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 3)
@@ -275,7 +277,7 @@ if Auto_Roof_Corner == true then
then
minetest.set_node(pos, {name=corner_2, param2=2})
end
-
+
if ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner_2 and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 0)
@@ -291,7 +293,7 @@ end
-- MM: The following stuff is just for testing purposes for now; no generating of roots.
-- I'm not satisfied with this; they should be either bigger or a different drawtype.
-----------------------------------------------------------------------------------------------
--- RooTS
+-- RooTS
-----------------------------------------------------------------------------------------------
if Roots == true then -- see settings.txt
@@ -332,7 +334,7 @@ for i in pairs(TRuNKS) do
local des = node.description
minetest.register_node("trunks:"..TRuNK.."root", {
- description = des.." Root",
+ description = des.." "..S("Root"),
paramtype = "light",
paramtype2 = "facedir",
tiles = {