add setting to change how rapidly crafting happens

This commit is contained in:
FaceDeer 2017-02-28 21:12:46 -07:00
parent ad99186f3c
commit 319ddf9b21
3 changed files with 30 additions and 9 deletions

@ -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.") 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 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",{ minetest.register_node("crafting_bench:workbench",{
description = S("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, _doc_items_usagehelp = usage_help,
tiles = { tiles = {
"crafting_bench_workbench_top.png", "crafting_bench_workbench_top.png",
@ -115,7 +120,7 @@ end
minetest.register_abm( { minetest.register_abm( {
nodenames = { 'crafting_bench:workbench' }, nodenames = { 'crafting_bench:workbench' },
interval = 5, interval = crafting_rate,
chance = 1, chance = 1,
action = function ( pos, node ) action = function ( pos, node )
local meta = minetest.get_meta( pos ) local meta = minetest.get_meta( pos )

@ -8,10 +8,11 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
@ -30,24 +31,37 @@ msgid ""
"material inventory and remove items from the finished goods inventory." "material inventory and remove items from the finished goods inventory."
msgstr "" msgstr ""
#: init.lua:14 #: init.lua:19 init.lua:49
msgid "Workbench" msgid "Workbench"
msgstr "" msgstr ""
#: init.lua:15 #: init.lua:20
#, lua-format
msgid "" msgid ""
"A workbench that does work for you. Set a crafting recipe and provide raw " "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 "" 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" msgid "@1 moves stuff in workbench at @2"
msgstr "" msgstr ""
#: init.lua:59 #: init.lua:64
msgid "@1 moves stuff to workbench at @2" msgid "@1 moves stuff to workbench at @2"
msgstr "" msgstr ""
#: init.lua:62 #: init.lua:67
msgid "@1 takes stuff from workbench at @2" msgid "@1 takes stuff from workbench at @2"
msgstr "" msgstr ""

2
settingtypes.txt Normal file

@ -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