summaryrefslogtreecommitdiff
path: root/nodes
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-09-12 00:20:52 -0600
committerFaceDeer <derksenmobile@gmail.com>2017-09-12 00:20:52 -0600
commit46bffd82d38ded68bcf102efd25da06a96e64a5d (patch)
treed9bc253c93583ca9087e890afa5f9309fe340126 /nodes
parent15b327c842ebe4189ceae16a419dce974c8b2451 (diff)
standardize config settings
Diffstat (limited to 'nodes')
-rw-r--r--nodes/node_axle.lua2
-rw-r--r--nodes/node_builders.lua8
-rw-r--r--nodes/node_controllers.lua8
3 files changed, 9 insertions, 9 deletions
diff --git a/nodes/node_axle.lua b/nodes/node_axle.lua
index 8726ab8..99dda4b 100644
--- a/nodes/node_axle.lua
+++ b/nodes/node_axle.lua
@@ -51,7 +51,7 @@ minetest.register_node("digtron:axle", {
meta = minetest.get_meta(pos)
meta:set_string("waiting", "true")
meta:set_string("infotext", nil)
- minetest.get_node_timer(pos):start(digtron.cycle_time*2)
+ minetest.get_node_timer(pos):start(digtron.config.cycle_time*2)
else
minetest.sound_play("buzzer", {gain=1.0, pos=pos})
meta:set_string("infotext", S("Digtron is obstructed."))
diff --git a/nodes/node_builders.lua b/nodes/node_builders.lua
index 424eb67..19bbe9f 100644
--- a/nodes/node_builders.lua
+++ b/nodes/node_builders.lua
@@ -14,7 +14,7 @@ if minetest.get_modpath("doc") then
"list[current_name;main;0,0;1,1;]" ..
"label[0,0.8;" .. S("Block to build") .. "]" ..
"field[1.3,0.8;1,0.1;extrusion;" .. S("Extrusion") .. ";${extrusion}]" ..
- "tooltip[extrusion;" .. S("Builder will extrude this many blocks in the direction it is facing.\nCan be set from 1 to @1.\nNote that Digtron won't build into unloaded map regions.", digtron.maximum_extrusion) .. "]" ..
+ "tooltip[extrusion;" .. S("Builder will extrude this many blocks in the direction it is facing.\nCan be set from 1 to @1.\nNote that Digtron won't build into unloaded map regions.", digtron.config.maximum_extrusion) .. "]" ..
"field[2.3,0.8;1,0.1;period;" .. S("Periodicity") .. ";${period}]" ..
"tooltip[period;" .. S("Builder will build once every n steps.\nThese steps are globally aligned, so all builders with the\nsame period and offset will build on the same location.") .. "]" ..
"field[3.3,0.8;1,0.1;offset;" .. S("Offset") .. ";${offset}]" ..
@@ -40,7 +40,7 @@ else
"list[current_name;main;0.5,0;1,1;]" ..
"label[0.5,0.8;" .. S("Block to build") .. "]" ..
"field[2.3,0.8;1,0.1;extrusion;" .. S("Extrusion") .. ";${extrusion}]" ..
- "tooltip[extrusion;" .. S("Builder will extrude this many blocks in the direction it is facing.\nCan be set from 1 to @1.\nNote that Digtron won't build into unloaded map regions.", digtron.maximum_extrusion) .. "]" ..
+ "tooltip[extrusion;" .. S("Builder will extrude this many blocks in the direction it is facing.\nCan be set from 1 to @1.\nNote that Digtron won't build into unloaded map regions.", digtron.config.maximum_extrusion) .. "]" ..
"field[3.3,0.8;1,0.1;period;" .. S("Periodicity") .. ";${period}]" ..
"tooltip[period;" .. S("Builder will build once every n steps.\nThese steps are globally aligned, so all builders with the\nsame period and offset will build on the same location.") .. "]" ..
"field[4.3,0.8;1,0.1;offset;" .. S("Offset") .. ";${offset}]" ..
@@ -133,7 +133,7 @@ minetest.register_node("digtron:builder", {
-- Should prevent that somehow. But not tonight.
meta:set_int("build_facing", math.floor(build_facing))
end
- if extrusion and extrusion > 0 and extrusion <= digtron.maximum_extrusion then
+ if extrusion and extrusion > 0 and extrusion <= digtron.config.maximum_extrusion then
meta:set_int("extrusion", math.floor(tonumber(fields.extrusion)))
else
extrusion = meta:get_int("extrusion")
@@ -296,7 +296,7 @@ minetest.register_node("digtron:builder", {
local oldnode = minetest.get_node(buildpos)
- if digtron.creative_mode then
+ if not digtron.config.uses_resources then
local returned_stack, success = digtron.item_place_node(item_stack, player, buildpos, build_facing)
if success == true then
minetest.log("action", string.format(S("%s uses Digtron to build %s at (%d, %d, %d), displacing %s"), player:get_player_name(), item_stack:get_name(), buildpos.x, buildpos.y, buildpos.z, oldnode.name))
diff --git a/nodes/node_controllers.lua b/nodes/node_controllers.lua
index a09cfbe..76bb40b 100644
--- a/nodes/node_controllers.lua
+++ b/nodes/node_controllers.lua
@@ -64,7 +64,7 @@ minetest.register_node("digtron:controller", {
-- Start the delay before digtron can run again.
minetest.get_meta(newpos):set_string("waiting", "true")
- minetest.get_node_timer(newpos):start(digtron.cycle_time)
+ minetest.get_node_timer(newpos):start(digtron.config.cycle_time)
end,
on_timer = function(pos, elapsed)
@@ -200,7 +200,7 @@ minetest.register_node("digtron:auto_controller", {
meta:set_string("infotext", string.format(S("Heat remaining in controller furnace: %d"), 0))
meta:set_string("formspec", auto_formspec)
-- Reusing offset and period to keep the digtron node-moving code simple, and the names still fit well
- meta:set_int("period", digtron.cycle_time)
+ meta:set_int("period", digtron.config.cycle_time)
meta:set_int("offset", 0)
meta:set_int("cycles", 0)
meta:set_int("slope", 0)
@@ -232,7 +232,7 @@ minetest.register_node("digtron:auto_controller", {
local cycles = tonumber(fields.cycles)
if period and period > 0 then
- meta:set_int("period", math.max(digtron.cycle_time, math.floor(period)))
+ meta:set_int("period", math.max(digtron.config.cycle_time, math.floor(period)))
end
if offset then
@@ -335,7 +335,7 @@ minetest.register_node("digtron:pusher", {
-- Start the delay before digtron can run again.
minetest.get_meta(newpos):set_string("waiting", "true")
- minetest.get_node_timer(newpos):start(digtron.cycle_time)
+ minetest.get_node_timer(newpos):start(digtron.config.cycle_time)
end,
on_timer = function(pos, elapsed)