forked from Reload/techage_modpack
built on 17/08/2022 14:28:55
This commit is contained in:
parent
c29afcf14f
commit
641e79e084
@ -282,6 +282,9 @@ local tubing = {
|
||||
return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload)
|
||||
end
|
||||
end,
|
||||
on_beduino_request_data = function(pos, src, topic, payload)
|
||||
return CRD(pos).State:on_beduino_request_data(pos, topic, payload)
|
||||
end,
|
||||
}
|
||||
|
||||
local node_name_ta2, node_name_ta3, node_name_ta4 =
|
||||
|
@ -230,6 +230,7 @@ function techage.add_node(pos, name, is_ta2)
|
||||
local key = minetest.hash_node_position(pos)
|
||||
local num = NumbersToBeRecycled[key]
|
||||
if num then
|
||||
NodeInfoCache[num] = nil
|
||||
backend.set_nodepos(num, pos)
|
||||
NumbersToBeRecycled[key] = nil
|
||||
return num
|
||||
|
@ -82,7 +82,7 @@ minetest.register_entity(":techage:region_cube", {
|
||||
initial_properties = {
|
||||
visual = "upright_sprite",
|
||||
textures = {"techage_cube_mark.png"},
|
||||
use_texture_alpha = techage.BLEND,
|
||||
use_texture_alpha = true,
|
||||
physical = false,
|
||||
glow = 12,
|
||||
},
|
||||
|
@ -70,7 +70,7 @@ minetest.register_entity(":techage:position_cube", {
|
||||
"techage_cube_mark.png",
|
||||
"techage_cube_mark.png",
|
||||
},
|
||||
use_texture_alpha = techage.BLEND,
|
||||
use_texture_alpha = true,
|
||||
physical = false,
|
||||
visual_size = {x = 1.1, y = 1.1},
|
||||
collisionbox = {-0.55,-0.55,-0.55, 0.55,0.55,0.55},
|
||||
|
@ -62,6 +62,8 @@ local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
local N = techage.get_node_lvm
|
||||
|
||||
local MAX_CYCLE_TIME = 20
|
||||
|
||||
--
|
||||
-- TechAge machine states
|
||||
--
|
||||
@ -282,6 +284,7 @@ function NodeStates:start(pos, nvm)
|
||||
if self.quick_start and state == STOPPED then
|
||||
self.quick_start(pos, 0)
|
||||
end
|
||||
self:trigger_state(pos, nvm)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
@ -468,7 +471,7 @@ function NodeStates:on_receive_message(pos, topic, payload)
|
||||
if node.name == "ignore" then -- unloaded node?
|
||||
return "unloaded"
|
||||
elseif nvm.techage_state == RUNNING then
|
||||
local ttl = (nvm.last_active or 0) + 2 * (self.cycle_time or 0)
|
||||
local ttl = (nvm.last_active or 0) + MAX_CYCLE_TIME
|
||||
if ttl < minetest.get_gametime() then
|
||||
return "inactive"
|
||||
end
|
||||
@ -506,7 +509,7 @@ function NodeStates:on_beduino_request_data(pos, topic, payload)
|
||||
if node.name == "ignore" then -- unloaded node?
|
||||
return 0, {techage.UNLOADED}
|
||||
elseif nvm.techage_state == RUNNING then
|
||||
local ttl = (nvm.last_active or 0) + 2 * (self.cycle_time or 0)
|
||||
local ttl = (nvm.last_active or 0) + MAX_CYCLE_TIME
|
||||
if ttl < minetest.get_gametime() then
|
||||
return 0, {techage.INACTIVE}
|
||||
end
|
||||
|
@ -97,9 +97,9 @@ local function formspec_help(meta, manual)
|
||||
"tableoptions[opendepth=1]"..
|
||||
"table[0.1,0;9,5;page;"..table.concat(aTitel, ",")..";"..idx.."]"..
|
||||
bttn..
|
||||
"box[0,5.75;10.775,4.45;#000000]"..
|
||||
"style_type[textarea;textcolor=#FFFFFF]"..
|
||||
"textarea[0.3,5.7;11,5.3;;"..(aText[idx] or "")..";]"..
|
||||
"box[0,5.75;10.775,4.45;#000000]"
|
||||
"textarea[0.3,5.7;11,5.3;;"..(aText[idx] or "")..";]"
|
||||
end
|
||||
|
||||
local function formspec_plan(meta, manual)
|
||||
|
@ -153,7 +153,7 @@ techage.icta_register_condition("input", {
|
||||
return env.input[data.number]
|
||||
end
|
||||
local result = function(val)
|
||||
return techage.compare(val, tonumber(data.value) or 0, data.operand)
|
||||
return techage.compare(val, data.value or "invalid", data.operand)
|
||||
end
|
||||
return condition, result
|
||||
end,
|
||||
@ -196,7 +196,7 @@ techage.icta_register_condition("state", {
|
||||
return techage.send_single(environ.number, data.number, "state")
|
||||
end
|
||||
local result = function(val)
|
||||
return techage.compare(val, tonumber(data.value) or 0, data.operand)
|
||||
return techage.compare(val, data.value or "invalid", data.operand)
|
||||
end
|
||||
return condition, result
|
||||
end,
|
||||
@ -408,7 +408,7 @@ techage.icta_register_condition("chest", {
|
||||
return techage.send_single(environ.number, data.number, "state")
|
||||
end
|
||||
local result = function(val)
|
||||
return techage.compare(val, tonumber(data.value) or 0, data.operand)
|
||||
return techage.compare(val, data.value or "invalid", data.operand)
|
||||
end
|
||||
return condition, result
|
||||
end,
|
||||
@ -449,7 +449,7 @@ techage.icta_register_condition("signaltower", {
|
||||
return techage.send_single(environ.number, data.number, "state")
|
||||
end
|
||||
local result = function(val)
|
||||
return techage.compare(val, tonumber(data.value) or 0, data.operand)
|
||||
return techage.compare(val, data.value or "invalid", data.operand)
|
||||
end
|
||||
return condition, result
|
||||
end,
|
||||
@ -919,7 +919,7 @@ techage.icta_register_condition("get_filter", {
|
||||
return techage.send_single(environ.number, data.number, "port", data.color)
|
||||
end
|
||||
local result = function(val)
|
||||
return techage.compare(val, tonumber(data.value) or 0, data.operand)
|
||||
return techage.compare(val, data.value or "invalid", data.operand)
|
||||
end
|
||||
return condition, result
|
||||
end,
|
||||
|
Loading…
Reference in New Issue
Block a user