mirror of
https://github.com/joe7575/techpack.git
synced 2024-11-26 00:53:44 +01:00
Node states modified, according to tueblib.states
This commit is contained in:
parent
299860158d
commit
7fd2fc66d5
@ -19,7 +19,7 @@ local CYCLE_TIME = 4
|
|||||||
local TICKS_TO_SLEEP = 5
|
local TICKS_TO_SLEEP = 5
|
||||||
local STOP_STATE = 0
|
local STOP_STATE = 0
|
||||||
local STANDBY_STATE = -1
|
local STANDBY_STATE = -1
|
||||||
local FAULT_STATE = -2
|
local FAULT_STATE = -3
|
||||||
|
|
||||||
|
|
||||||
local leaves = {
|
local leaves = {
|
||||||
@ -135,7 +135,7 @@ end
|
|||||||
local function goto_sleep(pos)
|
local function goto_sleep(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local number = meta:get_string("number")
|
local number = meta:get_string("number")
|
||||||
meta:set_int("running", STOP_STATE)
|
meta:set_int("running", STANDBY_STATE)
|
||||||
minetest.get_node_timer(pos):start(CYCLE_TIME * TICKS_TO_SLEEP)
|
minetest.get_node_timer(pos):start(CYCLE_TIME * TICKS_TO_SLEEP)
|
||||||
meta:set_string("infotext", "Tubelib Fermenter "..number..": standby")
|
meta:set_string("infotext", "Tubelib Fermenter "..number..": standby")
|
||||||
meta:set_string("formspec", formspec(tubelib.STANDBY))
|
meta:set_string("formspec", formspec(tubelib.STANDBY))
|
||||||
|
@ -18,7 +18,7 @@ local TICKS_TO_SLEEP = 10
|
|||||||
local CYCLE_TIME = 2
|
local CYCLE_TIME = 2
|
||||||
local STOP_STATE = 0
|
local STOP_STATE = 0
|
||||||
local STANDBY_STATE = -1
|
local STANDBY_STATE = -1
|
||||||
local FAULT_STATE = -2
|
local FAULT_STATE = -3
|
||||||
|
|
||||||
|
|
||||||
local function formspec(state)
|
local function formspec(state)
|
||||||
@ -285,7 +285,7 @@ tubelib.register_node("tubelib_addons1:grinder", {"tubelib_addons1:grinder_activ
|
|||||||
elseif topic == "state" then
|
elseif topic == "state" then
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local running = meta:get_int("running")
|
local running = meta:get_int("running")
|
||||||
return tubelib.statestring(runnnig)
|
return tubelib.statestring(running)
|
||||||
else
|
else
|
||||||
return "unsupported"
|
return "unsupported"
|
||||||
end
|
end
|
||||||
|
@ -28,7 +28,7 @@ local TICKS_TO_SLEEP = 10
|
|||||||
local STOP_STATE = 0
|
local STOP_STATE = 0
|
||||||
local RUNNING = 1
|
local RUNNING = 1
|
||||||
local STANDBY_STATE = -1
|
local STANDBY_STATE = -1
|
||||||
local FAULT_STATE = -2
|
local FAULT_STATE = -3
|
||||||
local OFFSET = 5
|
local OFFSET = 5
|
||||||
|
|
||||||
local Radius2Idx = {[4]=1 ,[6]=2, [8]=3, [10]=4, [12]=5, [14]=6, [16]=7}
|
local Radius2Idx = {[4]=1 ,[6]=2, [8]=3, [10]=4, [12]=5, [14]=6, [16]=7}
|
||||||
|
@ -24,7 +24,7 @@ local CYCLE_TIME = 4
|
|||||||
local BURNING_TIME = 16
|
local BURNING_TIME = 16
|
||||||
local TICKS_TO_SLEEP = 5
|
local TICKS_TO_SLEEP = 5
|
||||||
local STOP_STATE = 0
|
local STOP_STATE = 0
|
||||||
local FAULT_STATE = -2
|
local FAULT_STATE = -3
|
||||||
|
|
||||||
local Depth2Idx = {[1]=1 ,[2]=2, [3]=3, [5]=4, [10]=5, [15]=6, [20]=7, [25]=8}
|
local Depth2Idx = {[1]=1 ,[2]=2, [3]=3, [5]=4, [10]=5, [15]=6, [20]=7, [25]=8}
|
||||||
local Level2Idx = {[2]=1, [1]=2, [0]=3, [-1]=4, [-2]=5, [-3]=6,
|
local Level2Idx = {[2]=1, [1]=2, [0]=3, [-1]=4, [-2]=5, [-3]=6,
|
||||||
|
@ -19,7 +19,7 @@ local CYCLE_TIME = 6
|
|||||||
local TICKS_TO_SLEEP = 5
|
local TICKS_TO_SLEEP = 5
|
||||||
local STOP_STATE = 0
|
local STOP_STATE = 0
|
||||||
local STANDBY_STATE = -1
|
local STANDBY_STATE = -1
|
||||||
local FAULT_STATE = -2
|
local FAULT_STATE = -3
|
||||||
|
|
||||||
local function formspec(state)
|
local function formspec(state)
|
||||||
return "size[8,8]"..
|
return "size[8,8]"..
|
||||||
@ -124,7 +124,7 @@ end
|
|||||||
local function goto_sleep(pos)
|
local function goto_sleep(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local number = meta:get_string("number")
|
local number = meta:get_string("number")
|
||||||
meta:set_int("running", STOP_STATE)
|
meta:set_int("running", STANDBY_STATE)
|
||||||
minetest.get_node_timer(pos):start(CYCLE_TIME * TICKS_TO_SLEEP)
|
minetest.get_node_timer(pos):start(CYCLE_TIME * TICKS_TO_SLEEP)
|
||||||
meta:set_string("infotext", "Tubelib Reformer "..number..": standby")
|
meta:set_string("infotext", "Tubelib Reformer "..number..": standby")
|
||||||
meta:set_string("formspec", formspec(tubelib.STANDBY))
|
meta:set_string("formspec", formspec(tubelib.STANDBY))
|
||||||
|
Loading…
Reference in New Issue
Block a user