diff options
Diffstat (limited to 'dryplants/init.lua')
-rw-r--r-- | dryplants/init.lua | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/dryplants/init.lua b/dryplants/init.lua index e6baa7a..fac599c 100644 --- a/dryplants/init.lua +++ b/dryplants/init.lua @@ -7,13 +7,16 @@ local mname = "dryplants" -- textures & ideas partly by Neuromancer
-- License (everything): WTFPL
--- Contains code from: default, farming
+-- Contains code from: default, farming
-- Looked at code from: darkage, sickle, stairs
-- Dependencies: default, farming, biome_lib
--- Supports:
+-- 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")
@@ -111,7 +114,7 @@ local function sickle_on_use(itemstack, user, pointed_thing, uses) end
-- the tool
minetest.register_tool("dryplants:sickle", {
- description = "Sickle",
+ description = S("Sickle"),
inventory_image = "dryplants_sickle.png",
on_use = function(itemstack, user, pointed_thing)
return sickle_on_use(itemstack, user, pointed_thing, 220)
@@ -122,7 +125,7 @@ minetest.register_tool("dryplants:sickle", { -- Cut Grass
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:grass", {
- description = "Cut Grass",
+ description = S("Cut Grass"),
inventory_image = "dryplants_grass.png",
wield_image = "dryplants_grass.png",
paramtype = "light",
@@ -153,7 +156,7 @@ minetest.register_abm({ -- Hay
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:hay", {
- description = "Hay",
+ description = S("Hay"),
inventory_image = "dryplants_hay.png",
wield_image = "dryplants_hay.png",
paramtype = "light",
@@ -172,7 +175,7 @@ minetest.register_node("dryplants:hay", { -- Short Grass
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:grass_short", {
- description = "Short Grass",
+ description = S("Short Grass"),
tiles = {"default_grass.png^dryplants_grass_short.png", "default_dirt.png", "default_dirt.png^default_grass_side.png^dryplants_grass_short_side.png"},
is_ground_content = true,
groups = {crumbly=3,soil=1,not_in_creative_inventory=1},
@@ -190,11 +193,11 @@ minetest.register_abm({ interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
chance = 100/GRASS_REGROWING_CHANCE,
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}) - if above.name ~= "dryplants:grass" and above.name ~= "dryplants:hay" then + -- 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})
+ if above.name ~= "dryplants:grass" and above.name ~= "dryplants:hay" then
minetest.set_node(pos, {name="default:dirt_with_grass"})
- end + end
end,
})
|