mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2025-07-15 22:30:43 +02:00
global i18n : add plantlife_i18n mod
idea taken from homedecor_modpack and its homedecor_i18n all translated mods have a new dependency : plantlife_i18n translations are stored in po/pot file : one file for all mods added french translation (almost complete) transfered de/es/tr/pt translations to corresponding .po file (only for some mods, unfortunately translations are incomplete)
This commit is contained in:
@ -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,
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user