2019-10-27 13:14:37 +03:00
|
|
|
--[[
|
|
|
|
|
|
|
|
TechAge
|
|
|
|
=======
|
|
|
|
|
2022-06-05 22:20:43 +03:00
|
|
|
Copyright (C) 2019-2022 Joachim Stolberg
|
2019-10-27 13:14:37 +03:00
|
|
|
|
2020-10-19 20:09:17 +03:00
|
|
|
AGPL v3
|
2019-10-27 13:14:37 +03:00
|
|
|
See LICENSE.txt for more information
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-10-27 13:14:37 +03:00
|
|
|
TA4 Doser
|
|
|
|
|
|
|
|
]]--
|
|
|
|
|
2019-11-17 02:08:10 +03:00
|
|
|
local S2P = minetest.string_to_pos
|
|
|
|
local P2S = minetest.pos_to_string
|
2019-10-27 13:14:37 +03:00
|
|
|
local M = minetest.get_meta
|
2019-11-17 02:08:10 +03:00
|
|
|
local S = techage.S
|
|
|
|
local Pipe = techage.LiquidPipe
|
2021-06-20 23:21:56 +03:00
|
|
|
local liquid = networks.liquid
|
2019-11-10 23:08:37 +03:00
|
|
|
local recipes = techage.recipes
|
2019-10-27 13:14:37 +03:00
|
|
|
|
|
|
|
local Liquids = {} -- {hash(pos) = {name = outdir},...}
|
|
|
|
|
2020-04-05 13:36:32 +03:00
|
|
|
local STANDBY_TICKS = 2
|
|
|
|
local COUNTDOWN_TICKS = 3
|
2019-11-17 02:08:10 +03:00
|
|
|
local CYCLE_TIME = 10
|
|
|
|
|
2020-01-31 21:55:10 +03:00
|
|
|
local function formspec(self, pos, nvm)
|
2020-02-09 23:09:09 +03:00
|
|
|
return "size[6,3.6]"..
|
2019-10-27 13:14:37 +03:00
|
|
|
default.gui_bg..
|
|
|
|
default.gui_bg_img..
|
|
|
|
default.gui_slots..
|
2020-02-09 23:09:09 +03:00
|
|
|
"box[0,-0.1;5.8,0.5;#c6e8ff]"..
|
|
|
|
"label[2.5,-0.1;"..minetest.colorize( "#000000", S("Doser")).."]"..
|
|
|
|
recipes.formspec(0.1, 0.8, "ta4_doser", nvm)..
|
|
|
|
"image_button[5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]"..
|
|
|
|
"tooltip[5,2;1,1;"..self:get_state_tooltip(nvm).."]"
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
local function get_liquids(pos)
|
|
|
|
local hash = minetest.hash_node_position(pos)
|
|
|
|
if Liquids[hash] then
|
|
|
|
return Liquids[hash]
|
|
|
|
end
|
|
|
|
-- determine the available input liquids
|
|
|
|
local tbl = {}
|
|
|
|
for outdir = 1,4 do
|
2021-06-09 23:09:59 +03:00
|
|
|
local name, num = liquid.peek(pos, Pipe, outdir)
|
2019-10-27 13:14:37 +03:00
|
|
|
if name then
|
|
|
|
tbl[name] = outdir
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Liquids[hash] = tbl
|
|
|
|
return Liquids[hash]
|
|
|
|
end
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-10-27 13:14:37 +03:00
|
|
|
local function del_liquids(pos)
|
|
|
|
local hash = minetest.hash_node_position(pos)
|
|
|
|
Liquids[hash] = nil
|
|
|
|
end
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-04-07 23:19:36 +03:00
|
|
|
-- if liquids are missing, update the cached liquid table
|
2022-01-03 23:40:31 +03:00
|
|
|
local function reload_liquids(pos)
|
2020-04-07 23:19:36 +03:00
|
|
|
local hash = minetest.hash_node_position(pos)
|
|
|
|
-- determine the available input liquids
|
|
|
|
local tbl = {}
|
|
|
|
for outdir = 1,4 do
|
2021-06-09 23:09:59 +03:00
|
|
|
local name, num = liquid.peek(pos, Pipe, outdir)
|
2020-04-07 23:19:36 +03:00
|
|
|
if name then
|
|
|
|
tbl[name] = outdir
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Liquids[hash] = tbl
|
|
|
|
return Liquids[hash]
|
2022-01-03 23:40:31 +03:00
|
|
|
end
|
2020-04-07 23:19:36 +03:00
|
|
|
|
2019-10-27 13:14:37 +03:00
|
|
|
local function reactor_cmnd(pos, cmnd, payload)
|
|
|
|
return techage.transfer(
|
2022-01-03 23:40:31 +03:00
|
|
|
pos,
|
2019-10-27 13:14:37 +03:00
|
|
|
6, -- outdir
|
|
|
|
cmnd, -- topic
|
|
|
|
payload, -- payload
|
|
|
|
Pipe, -- network
|
|
|
|
{"techage:ta4_reactor_fillerpipe"})
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2020-01-31 21:55:10 +03:00
|
|
|
local function can_start(pos, nvm, state)
|
2019-10-27 13:14:37 +03:00
|
|
|
-- check reactor
|
2019-11-11 23:25:20 +03:00
|
|
|
local res = reactor_cmnd(pos, "check")
|
2019-10-27 13:14:37 +03:00
|
|
|
if not res then
|
|
|
|
return S("reactor defect")
|
|
|
|
end
|
2019-11-11 23:25:20 +03:00
|
|
|
res = reactor_cmnd(pos, "can_start")
|
|
|
|
if not res then
|
|
|
|
return S("reactor defect or no power")
|
|
|
|
end
|
2020-07-06 20:13:37 +03:00
|
|
|
local recipe = recipes.get(nvm, "ta4_doser")
|
|
|
|
if recipe.catalyst then
|
|
|
|
res = reactor_cmnd(pos, "catalyst")
|
|
|
|
if not res or res == "" then
|
|
|
|
return S("catalyst missing")
|
|
|
|
end
|
|
|
|
if res ~= recipe.catalyst then
|
|
|
|
return S("wrong catalyst")
|
|
|
|
end
|
|
|
|
end
|
2019-10-27 13:14:37 +03:00
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
2020-01-31 21:55:10 +03:00
|
|
|
local function start_node(pos, nvm, state)
|
2019-11-11 23:25:20 +03:00
|
|
|
reactor_cmnd(pos, "start")
|
2019-11-17 02:08:10 +03:00
|
|
|
del_liquids(pos)
|
2020-01-31 21:55:10 +03:00
|
|
|
nvm.running = true
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
|
|
|
|
2020-01-31 21:55:10 +03:00
|
|
|
local function stop_node(pos, nvm, state)
|
2019-11-11 23:25:20 +03:00
|
|
|
reactor_cmnd(pos, "stop")
|
2020-01-31 21:55:10 +03:00
|
|
|
nvm.running = false
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
local State = techage.NodeStates:new({
|
|
|
|
node_name_passive = "techage:ta4_doser",
|
|
|
|
node_name_active = "techage:ta4_doser_on",
|
|
|
|
cycle_time = CYCLE_TIME,
|
|
|
|
standby_ticks = STANDBY_TICKS,
|
|
|
|
formspec_func = formspec,
|
|
|
|
infotext_name = "TA4 Doser",
|
|
|
|
can_start = can_start,
|
|
|
|
start_node = start_node,
|
|
|
|
stop_node = stop_node,
|
|
|
|
})
|
|
|
|
|
2021-05-02 17:59:29 +03:00
|
|
|
local function untake(pos, taken)
|
|
|
|
for _,item in pairs(taken) do
|
2021-06-09 23:09:59 +03:00
|
|
|
liquid.untake(pos, Pipe, item.outdir, item.name, item.num)
|
2020-10-14 20:11:20 +03:00
|
|
|
end
|
2022-01-03 23:40:31 +03:00
|
|
|
end
|
2020-10-14 20:11:20 +03:00
|
|
|
|
2020-01-31 21:55:10 +03:00
|
|
|
local function dosing(pos, nvm, elapsed)
|
2019-10-27 13:14:37 +03:00
|
|
|
-- trigger reactor (power)
|
2019-11-11 23:25:20 +03:00
|
|
|
if not reactor_cmnd(pos, "power") then
|
2020-01-31 21:55:10 +03:00
|
|
|
if not nvm.techage_countdown or nvm.techage_countdown < 3 then
|
2019-11-17 02:08:10 +03:00
|
|
|
reactor_cmnd(pos, "stop")
|
2020-01-31 21:55:10 +03:00
|
|
|
State:nopower(pos, nvm, S("reactor has no power"))
|
2020-04-07 23:19:36 +03:00
|
|
|
return
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
2020-01-31 21:55:10 +03:00
|
|
|
State:idle(pos, nvm)
|
2019-11-11 23:25:20 +03:00
|
|
|
return
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
2020-07-06 20:13:37 +03:00
|
|
|
-- available liquids
|
|
|
|
local liquids = get_liquids(pos)
|
|
|
|
local recipe = recipes.get(nvm, "ta4_doser")
|
|
|
|
if not liquids or not recipe then return end
|
2019-11-17 02:08:10 +03:00
|
|
|
-- check from time to time
|
2020-01-31 21:55:10 +03:00
|
|
|
nvm.check_cnt = (nvm.check_cnt or 0) + 1
|
|
|
|
if nvm.check_cnt >= 4 then
|
|
|
|
nvm.check_cnt = 0
|
2019-11-17 02:08:10 +03:00
|
|
|
local res = reactor_cmnd(pos, "check")
|
|
|
|
if not res then
|
2020-01-31 21:55:10 +03:00
|
|
|
State:fault(pos, nvm, S("reactor defect"))
|
2019-11-17 02:08:10 +03:00
|
|
|
reactor_cmnd(pos, "stop")
|
|
|
|
return
|
|
|
|
end
|
2020-07-06 20:13:37 +03:00
|
|
|
if recipe.catalyst then
|
|
|
|
res = reactor_cmnd(pos, "catalyst")
|
|
|
|
if not res then
|
|
|
|
State:fault(pos, nvm, S("catalyst missing"))
|
|
|
|
reactor_cmnd(pos, "stop")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if res ~= recipe.catalyst then
|
|
|
|
State:fault(pos, nvm, S("wrong catalyst"))
|
|
|
|
reactor_cmnd(pos, "stop")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2019-11-17 02:08:10 +03:00
|
|
|
end
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2021-08-01 11:33:25 +03:00
|
|
|
-- check leftover
|
|
|
|
local leftover
|
|
|
|
local mem = techage.get_mem(pos)
|
|
|
|
if mem.waste_leftover then
|
|
|
|
leftover = reactor_cmnd(pos, "waste", {
|
2022-01-03 23:40:31 +03:00
|
|
|
name = mem.waste_leftover.name,
|
2021-08-01 11:33:25 +03:00
|
|
|
amount = mem.waste_leftover.num}) or mem.waste_leftover.num
|
|
|
|
if leftover > 0 then
|
|
|
|
mem.waste_leftover.num = leftover
|
|
|
|
State:blocked(pos, nvm)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
mem.waste_leftover = nil
|
|
|
|
end
|
|
|
|
if mem.output_leftover then
|
|
|
|
leftover = reactor_cmnd(pos, "output", {
|
2022-01-03 23:40:31 +03:00
|
|
|
name = mem.output_leftover.name,
|
2021-08-01 11:33:25 +03:00
|
|
|
amount = mem.output_leftover.num}) or mem.output_leftover.num
|
|
|
|
if leftover > 0 then
|
|
|
|
mem.output_leftover.num = leftover
|
|
|
|
State:blocked(pos, nvm)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
mem.output_leftover = nil
|
|
|
|
end
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-11-12 00:05:59 +03:00
|
|
|
-- inputs
|
2021-05-02 17:59:29 +03:00
|
|
|
local taken = {}
|
2021-06-20 23:21:56 +03:00
|
|
|
mem.dbg_cycles = (mem.dbg_cycles or 0) - 1
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-11-12 00:05:59 +03:00
|
|
|
for _,item in pairs(recipe.input) do
|
|
|
|
if item.name ~= "" then
|
2020-04-07 23:19:36 +03:00
|
|
|
local outdir = liquids[item.name] or reload_liquids(pos)[item.name]
|
2019-11-12 00:05:59 +03:00
|
|
|
if not outdir then
|
2020-01-31 21:55:10 +03:00
|
|
|
State:standby(pos, nvm)
|
2019-11-17 02:08:10 +03:00
|
|
|
reactor_cmnd(pos, "stop")
|
2021-05-02 17:59:29 +03:00
|
|
|
untake(pos, taken)
|
2019-11-12 00:05:59 +03:00
|
|
|
return
|
|
|
|
end
|
2021-06-20 23:21:56 +03:00
|
|
|
local num = liquid.take(pos, Pipe, outdir, item.name, item.num, mem.dbg_cycles > 0)
|
2021-05-02 17:59:29 +03:00
|
|
|
if num < item.num then
|
|
|
|
taken[#taken + 1] = {outdir = outdir, name = item.name, num = num}
|
2020-01-31 21:55:10 +03:00
|
|
|
State:standby(pos, nvm)
|
2019-11-17 02:08:10 +03:00
|
|
|
reactor_cmnd(pos, "stop")
|
2021-05-02 17:59:29 +03:00
|
|
|
untake(pos, taken)
|
2019-11-12 00:05:59 +03:00
|
|
|
return
|
|
|
|
end
|
2021-05-02 17:59:29 +03:00
|
|
|
taken[#taken + 1] = {outdir = outdir, name = item.name, num = item.num}
|
2019-11-12 00:05:59 +03:00
|
|
|
end
|
|
|
|
end
|
2021-05-02 17:59:29 +03:00
|
|
|
-- waste
|
2019-11-12 00:05:59 +03:00
|
|
|
if recipe.waste.name ~= "" then
|
|
|
|
leftover = reactor_cmnd(pos, "waste", {
|
2022-01-03 23:40:31 +03:00
|
|
|
name = recipe.waste.name,
|
2021-08-01 11:33:25 +03:00
|
|
|
amount = recipe.waste.num}) or recipe.waste.num
|
|
|
|
if leftover > 0 then
|
|
|
|
mem.waste_leftover = {name = recipe.waste.name, num = leftover}
|
|
|
|
mem.output_leftover = {name = recipe.output.name, num = recipe.output.num}
|
2020-01-31 21:55:10 +03:00
|
|
|
State:blocked(pos, nvm)
|
2019-11-17 02:08:10 +03:00
|
|
|
reactor_cmnd(pos, "stop")
|
2019-11-12 00:05:59 +03:00
|
|
|
return
|
|
|
|
end
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
2021-05-02 17:59:29 +03:00
|
|
|
-- output
|
|
|
|
leftover = reactor_cmnd(pos, "output", {
|
2022-01-03 23:40:31 +03:00
|
|
|
name = recipe.output.name,
|
2021-08-01 11:33:25 +03:00
|
|
|
amount = recipe.output.num}) or recipe.output.num
|
|
|
|
if leftover > 0 then
|
|
|
|
mem.output_leftover = {name = recipe.output.name, num = leftover}
|
2021-05-02 17:59:29 +03:00
|
|
|
State:blocked(pos, nvm)
|
|
|
|
reactor_cmnd(pos, "stop")
|
|
|
|
return
|
|
|
|
end
|
2020-01-31 21:55:10 +03:00
|
|
|
State:keep_running(pos, nvm, COUNTDOWN_TICKS)
|
2022-01-03 23:40:31 +03:00
|
|
|
end
|
2019-10-27 13:14:37 +03:00
|
|
|
|
|
|
|
local function node_timer(pos, elapsed)
|
2020-01-31 21:55:10 +03:00
|
|
|
local nvm = techage.get_nvm(pos)
|
|
|
|
dosing(pos, nvm, elapsed)
|
|
|
|
return State:is_active(nvm)
|
2022-01-03 23:40:31 +03:00
|
|
|
end
|
2019-10-27 13:14:37 +03:00
|
|
|
|
|
|
|
local function on_rightclick(pos)
|
2020-01-31 21:55:10 +03:00
|
|
|
local nvm = techage.get_nvm(pos)
|
|
|
|
M(pos):set_string("formspec", formspec(State, pos, nvm))
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
local function on_receive_fields(pos, formname, fields, player)
|
|
|
|
if minetest.is_protected(pos, player:get_player_name()) then
|
|
|
|
return
|
|
|
|
end
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-01-31 21:55:10 +03:00
|
|
|
local nvm = techage.get_nvm(pos)
|
2022-01-03 23:40:31 +03:00
|
|
|
if not nvm.running then
|
2023-02-12 23:30:12 +03:00
|
|
|
if recipes.on_receive_fields(pos, formname, fields, player) then
|
|
|
|
local mem = techage.get_mem(pos)
|
|
|
|
mem.waste_leftover = nil
|
|
|
|
mem.output_leftover = nil
|
|
|
|
end
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
2021-06-20 23:21:56 +03:00
|
|
|
local mem = techage.get_mem(pos)
|
|
|
|
mem.dbg_cycles = 5
|
2020-01-31 21:55:10 +03:00
|
|
|
State:state_button_event(pos, nvm, fields)
|
|
|
|
M(pos):set_string("formspec", formspec(State, pos, nvm))
|
2019-10-27 13:14:37 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
minetest.register_node("techage:ta4_doser", {
|
|
|
|
description = S("TA4 Doser"),
|
|
|
|
tiles = {
|
|
|
|
-- up, down, right, left, back, front
|
2019-11-03 01:39:10 +03:00
|
|
|
"techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_hole_pipe.png",
|
2019-10-27 13:14:37 +03:00
|
|
|
"techage_filling_ta4.png^techage_frame_ta4.png",
|
2019-11-17 02:08:10 +03:00
|
|
|
"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_pump_up.png",
|
2019-10-27 13:14:37 +03:00
|
|
|
},
|
|
|
|
|
2019-11-17 02:08:10 +03:00
|
|
|
after_place_node = function(pos, placer)
|
|
|
|
local meta = M(pos)
|
2020-01-31 21:55:10 +03:00
|
|
|
local nvm = techage.get_nvm(pos)
|
2019-11-17 02:08:10 +03:00
|
|
|
local number = techage.add_node(pos, "techage:ta4_doser")
|
|
|
|
meta:set_string("node_number", number)
|
|
|
|
meta:set_string("owner", placer:get_player_name())
|
2020-01-31 21:55:10 +03:00
|
|
|
meta:set_string("formspec", formspec(State, pos, nvm))
|
2019-11-17 02:08:10 +03:00
|
|
|
meta:set_string("infotext", S("TA4 Doser").." "..number)
|
2020-01-31 21:55:10 +03:00
|
|
|
State:node_init(pos, nvm, number)
|
2019-11-17 02:08:10 +03:00
|
|
|
Pipe:after_place_node(pos)
|
|
|
|
end,
|
|
|
|
tubelib2_on_update2 = function(pos, dir, tlib2, node)
|
2021-06-20 23:21:56 +03:00
|
|
|
liquid.update_network(pos, dir, tlib2, node)
|
2019-11-17 02:08:10 +03:00
|
|
|
del_liquids(pos)
|
|
|
|
end,
|
|
|
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
2020-06-14 00:32:00 +03:00
|
|
|
techage.remove_node(pos, oldnode, oldmetadata)
|
2019-11-17 02:08:10 +03:00
|
|
|
Pipe:after_dig_node(pos)
|
2020-01-31 21:55:10 +03:00
|
|
|
techage.del_mem(pos)
|
2019-11-17 02:08:10 +03:00
|
|
|
end,
|
2019-10-27 13:14:37 +03:00
|
|
|
on_receive_fields = on_receive_fields,
|
|
|
|
on_rightclick = on_rightclick,
|
|
|
|
on_timer = node_timer,
|
|
|
|
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
on_rotate = screwdriver.disallow,
|
|
|
|
groups = {cracky=2},
|
|
|
|
is_ground_content = false,
|
|
|
|
sounds = default.node_sound_metal_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:ta4_doser_on", {
|
|
|
|
description = S("TA4 Doser"),
|
|
|
|
tiles = {
|
|
|
|
-- up, down, right, left, back, front
|
2019-11-03 01:39:10 +03:00
|
|
|
"techage_filling_ta4.png^techage_frame_ta4_top.png^techage_appl_hole_pipe.png",
|
2019-10-27 13:14:37 +03:00
|
|
|
"techage_filling_ta4.png^techage_frame_ta4.png",
|
|
|
|
{
|
2023-04-07 11:51:33 +03:00
|
|
|
name = "techage_filling8_ta4.png^techage_frame8_ta4.png^techage_appl_pump_up8.png",
|
2019-10-27 13:14:37 +03:00
|
|
|
backface_culling = false,
|
|
|
|
animation = {
|
|
|
|
type = "vertical_frames",
|
|
|
|
aspect_w = 32,
|
|
|
|
aspect_h = 32,
|
|
|
|
length = 2.0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2019-11-17 02:08:10 +03:00
|
|
|
tubelib2_on_update2 = function(pos, dir, tlib2, node)
|
2021-06-20 23:21:56 +03:00
|
|
|
liquid.update_network(pos, dir, tlib2, node)
|
2019-11-17 02:08:10 +03:00
|
|
|
del_liquids(pos)
|
|
|
|
end,
|
2019-10-27 13:14:37 +03:00
|
|
|
on_receive_fields = on_receive_fields,
|
|
|
|
on_rightclick = on_rightclick,
|
|
|
|
on_timer = node_timer,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-10-27 13:14:37 +03:00
|
|
|
paramtype2 = "facedir",
|
|
|
|
on_rotate = screwdriver.disallow,
|
2019-11-17 02:08:10 +03:00
|
|
|
diggable = false,
|
|
|
|
groups = {not_in_creative_inventory=1},
|
2019-10-27 13:14:37 +03:00
|
|
|
is_ground_content = false,
|
|
|
|
sounds = default.node_sound_metal_defaults(),
|
|
|
|
})
|
|
|
|
|
2021-06-20 23:21:56 +03:00
|
|
|
liquid.register_nodes({"techage:ta4_doser", "techage:ta4_doser_on"}, Pipe, "pump", nil, {})
|
|
|
|
|
2019-11-17 02:08:10 +03:00
|
|
|
techage.register_node({"techage:ta4_doser", "techage:ta4_doser_on"}, {
|
|
|
|
on_recv_message = function(pos, src, topic, payload)
|
2022-09-11 15:32:59 +03:00
|
|
|
if topic == "recipe" then
|
|
|
|
techage.recipes.set_recipe(pos, "ta4_doser", payload)
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return State:on_receive_message(pos, topic, payload)
|
|
|
|
end
|
2019-10-27 13:14:37 +03:00
|
|
|
end,
|
2022-06-05 22:20:43 +03:00
|
|
|
on_beduino_receive_cmnd = function(pos, src, topic, payload)
|
|
|
|
return State:on_beduino_receive_cmnd(pos, topic, payload)
|
|
|
|
end,
|
|
|
|
on_beduino_request_data = function(pos, src, topic, payload)
|
|
|
|
return State:on_beduino_request_data(pos, topic, payload)
|
|
|
|
end,
|
2019-10-27 13:14:37 +03:00
|
|
|
})
|
|
|
|
|
2021-12-25 19:18:34 +03:00
|
|
|
techage.recipes.register_craft_type("ta4_doser", {
|
|
|
|
description = S("TA4 Reactor"),
|
|
|
|
icon = 'techage_reactor_filler_plan.png',
|
|
|
|
width = 2,
|
|
|
|
height = 2,
|
|
|
|
})
|
2019-11-17 02:08:10 +03:00
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "techage:ta4_doser",
|
|
|
|
recipe = {
|
|
|
|
{"", "techage:ta3_pipeS", ""},
|
|
|
|
{"techage:ta3_pipeS", "techage:t4_pump", "techage:ta3_pipeS"},
|
|
|
|
{"", "techage:ta4_wlanchip", ""},
|
|
|
|
},
|
2022-01-04 21:40:27 +03:00
|
|
|
})
|