diff --git a/init.lua b/init.lua index b365cf2..b723424 100644 --- a/init.lua +++ b/init.lua @@ -10,9 +10,14 @@ if minetest.get_modpath("hopper") and hopper ~= nil and hopper.add_container ~= usage_help = usage_help .. "\n\n" .. S("This workbench is compatible with hoppers. Hoppers will insert into the raw material inventory and remove items from the finished goods inventory.") end + +local crafting_rate = minetest.setting_get("crafting_bench_crafting_rate") +if crafting_rate == nil then crafting_rate = 5 end + + minetest.register_node("crafting_bench:workbench",{ description = S("Workbench"), - _doc_items_longdesc = S("A workbench that does work for you. Set a crafting recipe and provide raw materials and items will magically craft themselves once every five seconds."), + _doc_items_longdesc = string.format(S("A workbench that does work for you. Set a crafting recipe and provide raw materials and items will magically craft themselves once every %i seconds."), crafting_rate), _doc_items_usagehelp = usage_help, tiles = { "crafting_bench_workbench_top.png", @@ -115,7 +120,7 @@ end minetest.register_abm( { nodenames = { 'crafting_bench:workbench' }, - interval = 5, + interval = crafting_rate, chance = 1, action = function ( pos, node ) local meta = minetest.get_meta( pos ) diff --git a/locale/template.pot b/locale/template.pot index 4dc3633..7ac578e 100644 --- a/locale/template.pot +++ b/locale/template.pot @@ -8,10 +8,11 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-25 21:16-0700\n" +"POT-Creation-Date: 2017-02-28 21:08-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" @@ -30,24 +31,37 @@ msgid "" "material inventory and remove items from the finished goods inventory." msgstr "" -#: init.lua:14 +#: init.lua:19 init.lua:49 msgid "Workbench" msgstr "" -#: init.lua:15 +#: init.lua:20 +#, lua-format msgid "" "A workbench that does work for you. Set a crafting recipe and provide raw " -"materials and items will magically craft themselves once every five seconds." +"materials and items will magically craft themselves once every %i seconds." msgstr "" -#: init.lua:56 +#: init.lua:42 +msgid "Source Material" +msgstr "" + +#: init.lua:44 +msgid "Recipe to Use" +msgstr "" + +#: init.lua:46 +msgid "Craft Output" +msgstr "" + +#: init.lua:61 msgid "@1 moves stuff in workbench at @2" msgstr "" -#: init.lua:59 +#: init.lua:64 msgid "@1 moves stuff to workbench at @2" msgstr "" -#: init.lua:62 +#: init.lua:67 msgid "@1 takes stuff from workbench at @2" msgstr "" diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..9276289 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,2 @@ +# The number of seconds between each operation of the crafting bench. +crafting_bench_crafting_rate (Crafting rate) int 5 1 60 \ No newline at end of file