1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2024-12-26 02:30:20 +01:00

Added intllib support (thanks Xanthin)

This commit is contained in:
TenPlus1 2016-05-30 12:30:00 +01:00
parent 3d59270aef
commit cbf7bee93a
25 changed files with 318 additions and 59 deletions

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- barley seeds -- barley seeds
minetest.register_node("farming:seed_barley", { minetest.register_node("farming:seed_barley", {
description = "Barley Seed", description = S("Barley Seed"),
tiles = {"farming_barley_seed.png"}, tiles = {"farming_barley_seed.png"},
inventory_image = "farming_barley_seed.png", inventory_image = "farming_barley_seed.png",
wield_image = "farming_barley_seed.png", wield_image = "farming_barley_seed.png",
@ -19,7 +21,7 @@ minetest.register_node("farming:seed_barley", {
-- harvested barley -- harvested barley
minetest.register_craftitem("farming:barley", { minetest.register_craftitem("farming:barley", {
description = "barley", description = S("Barley"),
inventory_image = "farming_barley.png", inventory_image = "farming_barley.png",
}) })

View File

@ -4,9 +4,11 @@
CC-BY-SA-3.0 CC-BY-SA-3.0
]] ]]
local S = farming.intllib
-- beans -- beans
minetest.register_craftitem("farming:beans", { minetest.register_craftitem("farming:beans", {
description = "Green Beans", description = S("Green Beans"),
inventory_image = "farming_beans.png", inventory_image = "farming_beans.png",
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
@ -56,7 +58,7 @@ minetest.register_craft({
-- beanpole -- beanpole
minetest.register_node("farming:beanpole", { minetest.register_node("farming:beanpole", {
description = "Bean Pole (place on soil before planting beans)", description = S("Bean Pole (place on soil before planting beans)"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"farming_beanpole.png"}, tiles = {"farming_beanpole.png"},
inventory_image = "farming_beanpole.png", inventory_image = "farming_beanpole.png",

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- blueberries -- blueberries
minetest.register_craftitem("farming:blueberries", { minetest.register_craftitem("farming:blueberries", {
description = "Blueberries", description = S("Blueberries"),
inventory_image = "farming_blueberries.png", inventory_image = "farming_blueberries.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1")
@ -12,7 +14,7 @@ minetest.register_craftitem("farming:blueberries", {
-- blueberry muffin (thanks to sosogirl123 @ deviantart.com for muffin image) -- blueberry muffin (thanks to sosogirl123 @ deviantart.com for muffin image)
minetest.register_craftitem("farming:muffin_blueberry", { minetest.register_craftitem("farming:muffin_blueberry", {
description = "Blueberry Muffin", description = S("Blueberry Muffin"),
inventory_image = "farming_blueberry_muffin.png", inventory_image = "farming_blueberry_muffin.png",
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
}) })

View File

@ -4,9 +4,11 @@
https://forum.minetest.net/viewtopic.php?id=4990 https://forum.minetest.net/viewtopic.php?id=4990
]] ]]
local S = farming.intllib
-- carrot -- carrot
minetest.register_craftitem("farming:carrot", { minetest.register_craftitem("farming:carrot", {
description = "Carrot", description = S("Carrot"),
inventory_image = "farming_carrot.png", inventory_image = "farming_carrot.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1")
@ -16,7 +18,7 @@ minetest.register_craftitem("farming:carrot", {
-- golden carrot -- golden carrot
minetest.register_craftitem("farming:carrot_gold", { minetest.register_craftitem("farming:carrot_gold", {
description = "Golden Carrot", description = S("Golden Carrot"),
inventory_image = "farming_carrot_gold.png", inventory_image = "farming_carrot_gold.png",
on_use = minetest.item_eat(6), on_use = minetest.item_eat(6),
}) })

View File

@ -1,4 +1,6 @@
local S = farming.intllib
-- place cocoa -- place cocoa
function place_cocoa(itemstack, placer, pointed_thing, plantname) function place_cocoa(itemstack, placer, pointed_thing, plantname)
@ -48,7 +50,7 @@ end
-- cocoa beans -- cocoa beans
minetest.register_craftitem("farming:cocoa_beans", { minetest.register_craftitem("farming:cocoa_beans", {
description = "Cocoa Beans", description = S("Cocoa Beans"),
inventory_image = "farming_cocoa_beans.png", inventory_image = "farming_cocoa_beans.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1") return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1")
@ -64,7 +66,7 @@ minetest.register_craft( {
-- chocolate cookie -- chocolate cookie
minetest.register_craftitem("farming:cookie", { minetest.register_craftitem("farming:cookie", {
description = "Cookie", description = S("Cookie"),
inventory_image = "farming_cookie.png", inventory_image = "farming_cookie.png",
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
}) })
@ -78,7 +80,7 @@ minetest.register_craft( {
-- bar of dark chocolate (thanks to Ice Pandora for her deviantart.com chocolate tutorial) -- bar of dark chocolate (thanks to Ice Pandora for her deviantart.com chocolate tutorial)
minetest.register_craftitem("farming:chocolate_dark", { minetest.register_craftitem("farming:chocolate_dark", {
description = "Bar of Dark Chocolate", description = S("Bar of Dark Chocolate"),
inventory_image = "farming_chocolate_dark.png", inventory_image = "farming_chocolate_dark.png",
on_use = minetest.item_eat(3), on_use = minetest.item_eat(3),
}) })

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- coffee -- coffee
minetest.register_craftitem("farming:coffee_beans", { minetest.register_craftitem("farming:coffee_beans", {
description = "Coffee Beans", description = S("Coffee Beans"),
inventory_image = "farming_coffee_beans.png", inventory_image = "farming_coffee_beans.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1")
@ -11,7 +13,7 @@ minetest.register_craftitem("farming:coffee_beans", {
-- drinking cup -- drinking cup
minetest.register_node("farming:drinking_cup", { minetest.register_node("farming:drinking_cup", {
description = "Drinking Cup (empty)", description = S("Drinking Cup (empty)"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"vessels_drinking_cup.png"}, tiles = {"vessels_drinking_cup.png"},
inventory_image = "vessels_drinking_cup.png", inventory_image = "vessels_drinking_cup.png",
@ -36,7 +38,7 @@ minetest.register_craft( {
-- cold cup of coffee -- cold cup of coffee
minetest.register_node("farming:coffee_cup", { minetest.register_node("farming:coffee_cup", {
description = "Cold Cup of Coffee", description = S("Cold Cup of Coffee"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"farming_coffee_cup.png"}, tiles = {"farming_coffee_cup.png"},
inventory_image = "farming_coffee_cup.png", inventory_image = "farming_coffee_cup.png",
@ -69,7 +71,7 @@ minetest.register_craft({
-- hot cup of coffee -- hot cup of coffee
minetest.register_node("farming:coffee_cup_hot", { minetest.register_node("farming:coffee_cup_hot", {
description = "Hot Cup of Coffee", description = S("Hot Cup of Coffee"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"farming_coffee_cup_hot.png"}, tiles = {"farming_coffee_cup_hot.png"},
inventory_image = "farming_coffee_cup_hot.png", inventory_image = "farming_coffee_cup_hot.png",

View File

@ -4,9 +4,11 @@
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1440575-1-2-5-generation-minecraft-beta-1-2-farming-and http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1440575-1-2-5-generation-minecraft-beta-1-2-farming-and
]] ]]
local S = farming.intllib
-- corn -- corn
minetest.register_craftitem("farming:corn", { minetest.register_craftitem("farming:corn", {
description = "Corn", description = S("Corn"),
inventory_image = "farming_corn.png", inventory_image = "farming_corn.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1")
@ -16,7 +18,7 @@ minetest.register_craftitem("farming:corn", {
-- corn on the cob (texture by TenPlus1) -- corn on the cob (texture by TenPlus1)
minetest.register_craftitem("farming:corn_cob", { minetest.register_craftitem("farming:corn_cob", {
description = "Corn on the Cob", description = S("Corn on the Cob"),
inventory_image = "farming_corn_cob.png", inventory_image = "farming_corn_cob.png",
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
}) })
@ -30,7 +32,7 @@ minetest.register_craft({
-- ethanol (thanks to JKMurray for this idea) -- ethanol (thanks to JKMurray for this idea)
minetest.register_craftitem("farming:bottle_ethanol", { minetest.register_craftitem("farming:bottle_ethanol", {
description = "Bottle of Ethanol", description = S("Bottle of Ethanol"),
inventory_image = "farming_bottle_ethanol.png", inventory_image = "farming_bottle_ethanol.png",
}) })

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- cotton seeds -- cotton seeds
minetest.register_node("farming:seed_cotton", { minetest.register_node("farming:seed_cotton", {
description = "Cotton Seed", description = S("Cotton Seed"),
tiles = {"farming_cotton_seed.png"}, tiles = {"farming_cotton_seed.png"},
inventory_image = "farming_cotton_seed.png", inventory_image = "farming_cotton_seed.png",
wield_image = "farming_cotton_seed.png", wield_image = "farming_cotton_seed.png",
@ -20,7 +22,7 @@ minetest.register_node("farming:seed_cotton", {
-- cotton / string -- cotton / string
minetest.register_craftitem("farming:cotton", { minetest.register_craftitem("farming:cotton", {
description = "Cotton", description = S("Cotton"),
inventory_image = "farming_cotton.png", inventory_image = "farming_cotton.png",
}) })

View File

@ -4,9 +4,11 @@
https://forum.minetest.net/viewtopic.php?id=3948 https://forum.minetest.net/viewtopic.php?id=3948
]] ]]
local S = farming.intllib
-- cucumber -- cucumber
minetest.register_craftitem("farming:cucumber", { minetest.register_craftitem("farming:cucumber", {
description = "Cucumber", description = S("Cucumber"),
inventory_image = "farming_cucumber.png", inventory_image = "farming_cucumber.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1")

View File

@ -1,2 +1,3 @@
default default
wool wool
intllib?

View File

@ -1,6 +1,9 @@
local S = farming.intllib
-- Donut (thanks to Bockwurst for making the donut images) -- Donut (thanks to Bockwurst for making the donut images)
minetest.register_craftitem("farming:donut", { minetest.register_craftitem("farming:donut", {
description = "Donut", description = S("Donut"),
inventory_image = "farming_donut.png", inventory_image = "farming_donut.png",
on_use = minetest.item_eat(4), on_use = minetest.item_eat(4),
}) })
@ -16,7 +19,7 @@ minetest.register_craft({
-- Chocolate Donut -- Chocolate Donut
minetest.register_craftitem("farming:donut_chocolate", { minetest.register_craftitem("farming:donut_chocolate", {
description = "Chocolate Donut", description = S("Chocolate Donut"),
inventory_image = "farming_donut_chocolate.png", inventory_image = "farming_donut_chocolate.png",
on_use = minetest.item_eat(6), on_use = minetest.item_eat(6),
}) })
@ -31,7 +34,7 @@ minetest.register_craft({
-- Apple Donut -- Apple Donut
minetest.register_craftitem("farming:donut_apple", { minetest.register_craftitem("farming:donut_apple", {
description = "Apple Donut", description = S("Apple Donut"),
inventory_image = "farming_donut_apple.png", inventory_image = "farming_donut_apple.png",
on_use = minetest.item_eat(6), on_use = minetest.item_eat(6),
}) })

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- grapes -- grapes
minetest.register_craftitem("farming:grapes", { minetest.register_craftitem("farming:grapes", {
description = "Grapes", description = S("Grapes"),
inventory_image = "farming_grapes.png", inventory_image = "farming_grapes.png",
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
@ -51,7 +53,7 @@ minetest.register_craft({
-- trellis -- trellis
minetest.register_node("farming:trellis", { minetest.register_node("farming:trellis", {
description = "Trellis (place on soil before planting grapes)", description = S("Trellis (place on soil before planting grapes)"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"farming_trellis.png"}, tiles = {"farming_trellis.png"},
inventory_image = "farming_trellis.png", inventory_image = "farming_trellis.png",

View File

@ -1,4 +1,6 @@
local S = farming.intllib
-- Hoe registration function -- Hoe registration function
farming.register_hoe = function(name, def) farming.register_hoe = function(name, def)
@ -109,42 +111,42 @@ end
-- Define Hoes -- Define Hoes
farming.register_hoe(":farming:hoe_wood", { farming.register_hoe(":farming:hoe_wood", {
description = "Wooden Hoe", description = S("Wooden Hoe"),
inventory_image = "farming_tool_woodhoe.png", inventory_image = "farming_tool_woodhoe.png",
max_uses = 30, max_uses = 30,
material = "group:wood" material = "group:wood"
}) })
farming.register_hoe(":farming:hoe_stone", { farming.register_hoe(":farming:hoe_stone", {
description = "Stone Hoe", description = S("Stone Hoe"),
inventory_image = "farming_tool_stonehoe.png", inventory_image = "farming_tool_stonehoe.png",
max_uses = 90, max_uses = 90,
material = "group:stone" material = "group:stone"
}) })
farming.register_hoe(":farming:hoe_steel", { farming.register_hoe(":farming:hoe_steel", {
description = "Steel Hoe", description = S("Steel Hoe"),
inventory_image = "farming_tool_steelhoe.png", inventory_image = "farming_tool_steelhoe.png",
max_uses = 200, max_uses = 200,
material = "default:steel_ingot" material = "default:steel_ingot"
}) })
farming.register_hoe(":farming:hoe_bronze", { farming.register_hoe(":farming:hoe_bronze", {
description = "Bronze Hoe", description = S("Bronze Hoe"),
inventory_image = "farming_tool_bronzehoe.png", inventory_image = "farming_tool_bronzehoe.png",
max_uses = 220, max_uses = 220,
material = "default:bronze_ingot" material = "default:bronze_ingot"
}) })
farming.register_hoe(":farming:hoe_mese", { farming.register_hoe(":farming:hoe_mese", {
description = "Mese Hoe", description = S("Mese Hoe"),
inventory_image = "farming_tool_mesehoe.png", inventory_image = "farming_tool_mesehoe.png",
max_uses = 350, max_uses = 350,
material = "default:mese_crystal" material = "default:mese_crystal"
}) })
farming.register_hoe(":farming:hoe_diamond", { farming.register_hoe(":farming:hoe_diamond", {
description = "Diamond Hoe", description = S("Diamond Hoe"),
inventory_image = "farming_tool_diamondhoe.png", inventory_image = "farming_tool_diamondhoe.png",
max_uses = 500, max_uses = 500,
material = "default:diamond" material = "default:diamond"

View File

@ -1,5 +1,5 @@
--[[ --[[
Minetest Farming Redo Mod 1.22 (26th May 2016) Minetest Farming Redo Mod 1.22 (30th May 2016)
by TenPlus1 by TenPlus1
NEW growing routine by prestidigitator NEW growing routine by prestidigitator
auto-refill by crabman77 auto-refill by crabman77
@ -49,6 +49,15 @@ end
local statistics = dofile(farming.path.."/statistics.lua") local statistics = dofile(farming.path.."/statistics.lua")
-- Intllib
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function(s) return s end
end
farming.intllib = S
dofile(farming.path.."/soil.lua") dofile(farming.path.."/soil.lua")
dofile(farming.path.."/hoes.lua") dofile(farming.path.."/hoes.lua")
dofile(farming.path.."/grass.lua") dofile(farming.path.."/grass.lua")
@ -611,7 +620,7 @@ farming.register_plant = function(name, def)
-- Check def table -- Check def table
if not def.description then if not def.description then
def.description = "Seed" def.description = S("Seed")
end end
if not def.inventory_image then if not def.inventory_image then

104
locale/de.txt Normal file
View File

@ -0,0 +1,104 @@
# German Translation for farming mod
# Deutsche Übersetzung der farming Mod
# last update: 2016/March/31
# Author: Xanthin
#init.lua
Seed = Saatgut
#barley.lua
Barley Seed = Gerstenkörner
Barley = Gerste
#beanpole.lua
Green Beans = Grüne Bohnen
Bean Pole (place on soil before planting beans) = Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen)
#blueberry.lua
Blueberries = Blaubeeren
Blueberry Muffin = Blaubeermuffin
#carrot.lua
Carrot = Möhre
Golden Carrot = Goldene Möhre
#cocoa.lua
Cocoa Beans = Kakaobohne
Cookie = Keks
Bar of Dark Chocolate = Tafel Zartbitterschokolade
#coffee.lua
Coffee Beans = Kaffeebohnen
Drinking Cup (empty) = Tasse (leer)
Cold Cup of Coffee = Kalte Tasse Kaffee
Hot Cup of Coffee = Heiße Tasse Kaffee
#corn.lua
Corn = Mais
Corn on the Cob = Maiskolben
Bottle of Ethanol = Flasche Ethanol
#cotton.lua
Cotton Seed = Baumwollsamen
Cotton = Baumwolle
#cucumber.lua
Cucumber = Gurke
#donut.lua
Donut = Donut
Chocolate Donut = Schokodonut
Apple Donut = Apfeldonut
#grapes.lua
Grapes = Weintrauben
Trellis (place on soil before planting grapes) = Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen)
#hoes.lua
Hoe = Hacke
Wooden Hoe = Holzhacke
Stone Hoe = Steinhacke
Steel Hoe = Stahlhacke
Bronze Hoe = Bronzehacke
Mese Hoe = Mesehacke
Diamond Hoe = Diamanthacke
#melon.lua
Melon Slice = Melonenscheibe
Melon = Melone
#potato.lua
Potato = Kartoffel
Baked Potato = Ofenkartoffel
#pumpkin.lua
Pumpkin = Kürbis
Pumpkin Slice = Kürbisscheibe
Jack 'O Lantern = Kürbislaterne
Pumpkin Bread = Kürbisbrot
Pumpkin Dough = Kürbisteig
#rasperry.lua
Raspberries = Himbeeren
Raspberry Smoothie = Himbeersmoothie
#rhubarb.lua
Rhubarb = Rhabarber
Rhubarb Pie = Rhabarberkuchen
#soil.lua
Soil = Ackerboden
Wet Soil = Bewässerter Ackerboden
#sugar.lua
Sugar = Zucker
#tomato.lua
Tomato = Tomate
#wheat.lua
Wheat Seed = Weizenkörner
Wheat = Weizen
Straw = Stroh
Flour = Mehl
Bread = Brot

102
locale/template.txt Normal file
View File

@ -0,0 +1,102 @@
# Template for translations of farming mod
# last update: 2016/March/31
#init.lua
Seed =
#barley.lua
Barley Seed =
Barley =
#beanpole.lua
Green Beans =
Bean Pole (place on soil before planting beans) =
#blueberry.lua
Blueberries =
Blueberry Muffin =
#carrot.lua
Carrot =
Golden Carrot =
#cocoa.lua
Cocoa Beans =
Cookie =
Bar of Dark Chocolate =
#coffee.lua
Coffee Beans =
Drinking Cup (empty) =
Cold Cup of Coffee =
Hot Cup of Coffee =
#corn.lua
Corn =
Corn on the Cob =
Bottle of Ethanol =
#cotton.lua
Cotton Seed =
Cotton =
#cucumber.lua
Cucumber =
#donut.lua
Donut =
Chocolate Donut =
Apple Donut =
#grapes.lua
Grapes =
Trellis (place on soil before planting grapes) =
#hoes.lua
Hoe =
Wooden Hoe =
Stone Hoe =
Steel Hoe =
Bronze Hoe =
Mese Hoe =
Diamond Hoe =
#melon.lua
Melon Slice =
Melon =
#potato.lua
Potato =
Baked Potato =
#pumpkin.lua
Pumpkin =
Pumpkin Slice =
Jack 'O Lantern =
Pumpkin Bread =
Pumpkin Dough =
#rasperry.lua
Raspberries =
Raspberry Smoothie =
#rhubarb.lua
Rhubarb =
Rhubarb Pie =
#soil.lua
Soil =
Wet Soil =
#sugar.lua
Sugar =
#tomato.lua
Tomato =
#wheat.lua
Wheat Seed =
Wheat =
Straw =
Flour =
Bread =

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- melon -- melon
minetest.register_craftitem("farming:melon_slice", { minetest.register_craftitem("farming:melon_slice", {
description = "Melon Slice", description = S("Melon Slice"),
inventory_image = "farming_melon_slice.png", inventory_image = "farming_melon_slice.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1")
@ -71,7 +73,7 @@ minetest.register_node("farming:melon_7", table.copy(crop_def))
-- stage 8 (final) -- stage 8 (final)
crop_def.drawtype = "nodebox" crop_def.drawtype = "nodebox"
crop_def.description = "Melon" crop_def.description = S("Melon")
crop_def.tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png"} crop_def.tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png"}
crop_def.selection_box = {-.5, -.5, -.5, .5, .5, .5} crop_def.selection_box = {-.5, -.5, -.5, .5, .5, .5}
crop_def.walkable = true crop_def.walkable = true

View File

@ -4,9 +4,11 @@
https://forum.minetest.net/viewtopic.php?id=3948 https://forum.minetest.net/viewtopic.php?id=3948
]] ]]
local S = farming.intllib
-- potato -- potato
minetest.register_craftitem("farming:potato", { minetest.register_craftitem("farming:potato", {
description = "Potato", description = S("Potato"),
inventory_image = "farming_potato.png", inventory_image = "farming_potato.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
@ -16,7 +18,7 @@ minetest.register_craftitem("farming:potato", {
-- baked potato -- baked potato
minetest.register_craftitem("farming:baked_potato", { minetest.register_craftitem("farming:baked_potato", {
description = "Baked Potato", description = S("Baked Potato"),
inventory_image = "farming_baked_potato.png", inventory_image = "farming_baked_potato.png",
on_use = minetest.item_eat(6), on_use = minetest.item_eat(6),
}) })

View File

@ -3,9 +3,11 @@
Big thanks to PainterlyPack.net for allowing me to use these textures Big thanks to PainterlyPack.net for allowing me to use these textures
]] ]]
local S = farming.intllib
-- pumpkin -- pumpkin
minetest.register_node("farming:pumpkin", { minetest.register_node("farming:pumpkin", {
description = "Pumpkin", description = S("Pumpkin"),
tiles = { tiles = {
"farming_pumpkin_top.png", "farming_pumpkin_top.png",
"farming_pumpkin_top.png", "farming_pumpkin_top.png",
@ -25,7 +27,7 @@ minetest.register_node("farming:pumpkin", {
-- pumpkin slice -- pumpkin slice
minetest.register_craftitem("farming:pumpkin_slice", { minetest.register_craftitem("farming:pumpkin_slice", {
description = "Pumpkin Slice", description = S("Pumpkin Slice"),
inventory_image = "farming_pumpkin_slice.png", inventory_image = "farming_pumpkin_slice.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1")
@ -51,7 +53,7 @@ minetest.register_craft({
-- jack 'o lantern -- jack 'o lantern
minetest.register_node("farming:jackolantern", { minetest.register_node("farming:jackolantern", {
description = "Jack 'O Lantern", description = S("Jack 'O Lantern"),
tiles = { tiles = {
"farming_pumpkin_top.png", "farming_pumpkin_top.png",
"farming_pumpkin_top.png", "farming_pumpkin_top.png",
@ -70,7 +72,6 @@ minetest.register_node("farming:jackolantern", {
}) })
minetest.register_node("farming:jackolantern_on", { minetest.register_node("farming:jackolantern_on", {
description = "Jack 'O Lantern",
tiles = { tiles = {
"farming_pumpkin_top.png", "farming_pumpkin_top.png",
"farming_pumpkin_top.png", "farming_pumpkin_top.png",
@ -101,13 +102,13 @@ minetest.register_craft({
-- pumpkin bread -- pumpkin bread
minetest.register_craftitem("farming:pumpkin_bread", { minetest.register_craftitem("farming:pumpkin_bread", {
description = ("Pumpkin Bread"), description = S("Pumpkin Bread"),
inventory_image = "farming_pumpkin_bread.png", inventory_image = "farming_pumpkin_bread.png",
on_use = minetest.item_eat(8) on_use = minetest.item_eat(8)
}) })
minetest.register_craftitem("farming:pumpkin_dough", { minetest.register_craftitem("farming:pumpkin_dough", {
description = "Pumpkin Dough", description = S("Pumpkin Dough"),
inventory_image = "farming_pumpkin_dough.png", inventory_image = "farming_pumpkin_dough.png",
}) })

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- raspberries -- raspberries
minetest.register_craftitem("farming:raspberries", { minetest.register_craftitem("farming:raspberries", {
description = "Raspberries", description = S("Raspberries"),
inventory_image = "farming_raspberries.png", inventory_image = "farming_raspberries.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1")
@ -11,7 +13,7 @@ minetest.register_craftitem("farming:raspberries", {
-- raspberry smoothie -- raspberry smoothie
minetest.register_craftitem("farming:smoothie_raspberry", { minetest.register_craftitem("farming:smoothie_raspberry", {
description = "Raspberry Smoothie", description = S("Raspberry Smoothie"),
inventory_image = "farming_raspberry_smoothie.png", inventory_image = "farming_raspberry_smoothie.png",
on_use = minetest.item_eat(2, "vessels:drinking_glass"), on_use = minetest.item_eat(2, "vessels:drinking_glass"),
}) })

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- rhubarb -- rhubarb
minetest.register_craftitem("farming:rhubarb", { minetest.register_craftitem("farming:rhubarb", {
description = "Rhubarb", description = S("Rhubarb"),
inventory_image = "farming_rhubarb.png", inventory_image = "farming_rhubarb.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1")
@ -11,7 +13,7 @@ minetest.register_craftitem("farming:rhubarb", {
-- rhubarb pie -- rhubarb pie
minetest.register_craftitem("farming:rhubarb_pie", { minetest.register_craftitem("farming:rhubarb_pie", {
description = "Rhubarb Pie", description = S("Rhubarb Pie"),
inventory_image = "farming_rhubarb_pie.png", inventory_image = "farming_rhubarb_pie.png",
on_use = minetest.item_eat(6), on_use = minetest.item_eat(6),
}) })

View File

@ -1,6 +1,9 @@
local S = farming.intllib
-- normal soil -- normal soil
minetest.register_node("farming:soil", { minetest.register_node("farming:soil", {
description = "Soil", description = S("Soil"),
tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"}, tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"},
drop = "default:dirt", drop = "default:dirt",
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 2}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 2},
@ -9,7 +12,7 @@ minetest.register_node("farming:soil", {
-- wet soil -- wet soil
minetest.register_node("farming:soil_wet", { minetest.register_node("farming:soil_wet", {
description = "Wet Soil", description = S("Wet Soil"),
tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"}, tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"},
drop = "default:dirt", drop = "default:dirt",
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 3}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 3},

View File

@ -1,8 +1,10 @@
local S = farming.intllib
--= Sugar --= Sugar
minetest.register_craftitem("farming:sugar", { minetest.register_craftitem("farming:sugar", {
description = "Sugar", description = S("Sugar"),
inventory_image = "farming_sugar.png", inventory_image = "farming_sugar.png",
}) })

View File

@ -4,9 +4,11 @@
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1288375-food-plus-mod-more-food-than-you-can-imagine-v2-9) http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1288375-food-plus-mod-more-food-than-you-can-imagine-v2-9)
]] ]]
local S = farming.intllib
-- tomato -- tomato
minetest.register_craftitem("farming:tomato", { minetest.register_craftitem("farming:tomato", {
description = "Tomato", description = S("Tomato"),
inventory_image = "farming_tomato.png", inventory_image = "farming_tomato.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1") return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1")

View File

@ -1,7 +1,9 @@
local S = farming.intllib
-- wheat seeds -- wheat seeds
minetest.register_node("farming:seed_wheat", { minetest.register_node("farming:seed_wheat", {
description = "Wheat Seed", description = S("Wheat Seed"),
tiles = {"farming_wheat_seed.png"}, tiles = {"farming_wheat_seed.png"},
inventory_image = "farming_wheat_seed.png", inventory_image = "farming_wheat_seed.png",
wield_image = "farming_wheat_seed.png", wield_image = "farming_wheat_seed.png",
@ -19,13 +21,13 @@ minetest.register_node("farming:seed_wheat", {
-- harvested wheat -- harvested wheat
minetest.register_craftitem("farming:wheat", { minetest.register_craftitem("farming:wheat", {
description = "Wheat", description = S("Wheat"),
inventory_image = "farming_wheat.png", inventory_image = "farming_wheat.png",
}) })
-- straw -- straw
minetest.register_node("farming:straw", { minetest.register_node("farming:straw", {
description = "Straw", description = S("Straw"),
tiles = {"farming_straw.png"}, tiles = {"farming_straw.png"},
is_ground_content = false, is_ground_content = false,
groups = {snappy = 3, flammable = 4}, groups = {snappy = 3, flammable = 4},
@ -50,7 +52,7 @@ minetest.register_craft({
-- flour -- flour
minetest.register_craftitem("farming:flour", { minetest.register_craftitem("farming:flour", {
description = "Flour", description = S("Flour"),
inventory_image = "farming_flour.png", inventory_image = "farming_flour.png",
}) })
@ -62,7 +64,7 @@ minetest.register_craft({
-- bread -- bread
minetest.register_craftitem("farming:bread", { minetest.register_craftitem("farming:bread", {
description = "Bread", description = S("Bread"),
inventory_image = "farming_bread.png", inventory_image = "farming_bread.png",
on_use = minetest.item_eat(5), on_use = minetest.item_eat(5),
}) })