From b457f3011fa851ee01946ff59867e82e97a2574b Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Mon, 28 Jan 2019 21:51:38 +0100 Subject: [PATCH] V2.02, Logic Not added, output reduction on Harvester, Fermenter, and Gravel Sieve --- README.md | 4 +- gravelsieve/settingtypes.txt | 2 +- releasenotes.md | 17 +++ sl_controller/terminal.lua | 144 ++++++++++++------ .../textures/sl_controller_terminal2_back.png | Bin 0 -> 206 bytes .../sl_controller_terminal2_front.png | Bin 0 -> 646 bytes .../textures/sl_controller_terminal2_side.png | Bin 0 -> 197 bytes .../textures/sl_controller_terminal2_top.png | Bin 0 -> 371 bytes tubelib_addons1/fermenter.lua | 9 +- tubelib_addons1/harvester.lua | 4 +- tubelib_addons2/gateblock.lua | 2 +- tubelib_addons2/init.lua | 1 + 12 files changed, 127 insertions(+), 56 deletions(-) create mode 100644 sl_controller/textures/sl_controller_terminal2_back.png create mode 100644 sl_controller/textures/sl_controller_terminal2_front.png create mode 100644 sl_controller/textures/sl_controller_terminal2_side.png create mode 100644 sl_controller/textures/sl_controller_terminal2_top.png diff --git a/README.md b/README.md index 47a3b76..746a0cc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TechPack V2.01 +# TechPack V2.02 TechPack, a Mining, Crafting, & Farming Modpack for Minetest. @@ -43,6 +43,7 @@ TechPack provides: - two Sequencer nodes for a waiting time controlled sending of commands (on/off) - an item Detector node sending commands (on/off) - a Repeater node to distribute received commands to connected nodes +- a Logic Not node to invert on/off commands - Gate/Door nodes in different textures to be controlled via on/off commands - an Access Lock node with number key field - a Mesecon Converter node to translate tubelib commands in mesecon commands and vice versa @@ -145,6 +146,7 @@ tubelib_addons1 optional: unified_inventory - 2018-12-29 V2.00 * beta - 2019-01-12 V2.00 * release - 2019-01-27 V2.01 * SaferLua Controller Terminal added +- 2019-01-28 V2.02 * Logic Not added, output reduction on Harvester, Fermenter, and Gravel Sieve ## New in v2 (from players point of view) diff --git a/gravelsieve/settingtypes.txt b/gravelsieve/settingtypes.txt index 0b4e528..a5eb40e 100644 --- a/gravelsieve/settingtypes.txt +++ b/gravelsieve/settingtypes.txt @@ -2,4 +2,4 @@ # 1.0 is according to the mapgen generator # 2.0 means half as many ores as result # 0.5 means twice as many ores as result -gravelsieve_ore_rarity (Rarity factor to find ores) float 1 \ No newline at end of file +gravelsieve_ore_rarity (Rarity factor to find ores) float 1.5 \ No newline at end of file diff --git a/releasenotes.md b/releasenotes.md index eeadc69..895e24e 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -2,6 +2,23 @@ +## V2.02 (2019-01-28) + +### Additions +- Tubelib_addons2 "Logic Not" added +- second (classical) SaferLua Terminal added + +### Removals + +### Changes +- Output reduction on Harvester (cycle time from 4 to 6 s), + Fermenter (from 2 to 3 input items needed per bio gas), + and Gravel Sieve (rarity from 1 to 1.5) + +### Fixes +- removing the Gate block returns the original block + + ## V2.01 (2019-01-27) ### Additions diff --git a/sl_controller/terminal.lua b/sl_controller/terminal.lua index 145f3ea..e212b16 100644 --- a/sl_controller/terminal.lua +++ b/sl_controller/terminal.lua @@ -24,6 +24,8 @@ Local commands: - help = this message - pub = switch to public use - priv = switch to private use +Test commands: +- send on/off = send on/off event ]] local function formspec1() @@ -80,16 +82,65 @@ local function command(pos, cmnd, player) output(pos, player..":$ "..cmnd) output(pos, "Switched to private use!") elseif meta:get_int("public") == 1 or owner == player then - local number = meta:get_string("number") or "0000" - output(pos, player..":$ "..cmnd) - tubelib.send_message(number, owner, nil, "term", cmnd) + local num, topic = cmnd:match('^send%s+([0-9]+)%s+([onff]+)$') + if num and topic then + local own_number = meta:get_string("own_number") + output(pos, player..":$ send "..num.." "..topic) + tubelib.send_message(num, owner, nil, topic, own_number) + else + local number = meta:get_string("number") or "0000" + output(pos, player..":$ "..cmnd) + tubelib.send_message(number, owner, nil, "term", cmnd) + end end end end -minetest.register_node("sl_controller:terminal", { - description = "SaferLua Controller Terminal", - tiles = { +local function register_terminal(num, tiles, node_box, selection_box) + minetest.register_node("sl_controller:terminal"..num, { + description = "SaferLua Controller Terminal", + tiles = tiles, + drawtype = "nodebox", + node_box = node_box, + selection_box = selection_box, + + after_place_node = function(pos, placer) + local number = tubelib.add_node(pos, minetest.get_node(pos).name) + local meta = minetest.get_meta(pos) + meta:set_string("own_number", number) + meta:set_string("formspec", formspec1()) + meta:set_string("owner", placer:get_player_name()) + meta:set_string("infotext", "SaferLua Controller Terminal "..number..": not connected") + end, + + on_receive_fields = function(pos, formname, fields, player) + local meta = minetest.get_meta(pos) + if fields.number and fields.number ~= "" then + if tubelib.check_numbers(fields.number) then + meta:set_string("number", fields.number) + local own_number = meta:get_string("own_number") + meta:set_string("infotext", "SaferLua Controller Terminal "..own_number..": connected with "..fields.number) + meta:set_string("formspec", formspec2(meta)) + end + elseif (fields.key_enter == "true" or fields.ok == "Enter") and fields.cmnd ~= "" then + command(pos, fields.cmnd, player:get_player_name()) + end + end, + + after_dig_node = function(pos) + tubelib.remove_node(pos) + end, + + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + groups = {choppy=2, cracky=2, crumbly=2}, + is_ground_content = false, + sounds = default.node_sound_metal_defaults(), + }) +end + +register_terminal("", { -- up, down, right, left, back, front 'sl_controller_terminal_top.png', 'sl_controller_terminal_bottom.png', @@ -98,51 +149,13 @@ minetest.register_node("sl_controller:terminal", { 'sl_controller_terminal_bottom.png', "sl_controller_terminal_front.png", }, - - drawtype = "nodebox", - node_box = { + { type = "fixed", fixed = { {-12/32, -16/32, -8/32, 12/32, -14/32, 12/32}, {-12/32, -14/32, 12/32, 12/32, 6/32, 14/32}, }, - }, - - after_place_node = function(pos, placer) - local number = tubelib.add_node(pos, "sl_controller:terminal") - local meta = minetest.get_meta(pos) - meta:set_string("own_number", number) - meta:set_string("formspec", formspec1()) - meta:set_string("owner", placer:get_player_name()) - meta:set_string("infotext", "SaferLua Controller Terminal "..number..": not connected") - end, - - on_receive_fields = function(pos, formname, fields, player) - local meta = minetest.get_meta(pos) - if fields.number and fields.number ~= "" then - if tubelib.check_numbers(fields.number) then - meta:set_string("number", fields.number) - local own_number = meta:get_string("own_number") - meta:set_string("infotext", "SaferLua Controller Terminal "..own_number..": connected with "..fields.number) - meta:set_string("formspec", formspec2(meta)) - end - elseif (fields.key_enter == "true" or fields.ok == "Enter") and fields.cmnd ~= "" then - command(pos, fields.cmnd, player:get_player_name()) - end - end, - - after_dig_node = function(pos) - tubelib.remove_node(pos) - end, - - paramtype = "light", - sunlight_propagates = true, - paramtype2 = "facedir", - groups = {choppy=2, cracky=2, crumbly=2}, - is_ground_content = false, - sounds = default.node_sound_metal_defaults(), -}) - + }) minetest.register_craft({ output = "sl_controller:terminal", @@ -153,7 +166,44 @@ minetest.register_craft({ }, }) -tubelib.register_node("sl_controller:terminal", {}, { +register_terminal("2", { + -- up, down, right, left, back, front + 'sl_controller_terminal2_top.png', + 'sl_controller_terminal2_side.png', + 'sl_controller_terminal2_side.png^[transformFX', + 'sl_controller_terminal2_side.png', + 'sl_controller_terminal2_back.png', + "sl_controller_terminal2_front.png", + }, + { + type = "fixed", + fixed = { + {-12/32, -16/32, -16/32, 12/32, -14/32, 16/32}, + {-12/32, -14/32, -3/32, 12/32, 6/32, 16/32}, + {-10/32, -12/32, 14/32, 10/32, 4/32, 18/32}, + {-12/32, 4/32, -4/32, 12/32, 6/32, 16/32}, + {-12/32, -16/32, -4/32, -10/32, 6/32, 16/32}, + { 10/32, -16/32, -4/32, 12/32, 6/32, 16/32}, + {-12/32, -14/32, -4/32, 12/32, -12/32, 16/32}, + }, + }, + { + type = "fixed", + fixed = { + {-12/32, -16/32, -4/32, 12/32, 6/32, 16/32}, + }, + }) + +minetest.register_craft({ + output = "sl_controller:terminal2", + recipe = { + {"", "smartline:display", ""}, + {"", "", ""}, + {"dye:grey", "tubelib:wlanchip", "default:copper_ingot"}, + }, +}) + +tubelib.register_node("sl_controller:terminal", {"sl_controller:terminal2", "sl_controller:terminal3"}, { on_recv_message = function(pos, topic, payload) if topic == "term" then output(pos, payload) diff --git a/sl_controller/textures/sl_controller_terminal2_back.png b/sl_controller/textures/sl_controller_terminal2_back.png new file mode 100644 index 0000000000000000000000000000000000000000..c9632fa08f8e08ef999823e995f0b3ca764f990d GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@mUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIC?nIRD+&iT2ysd*(pE(3#eQEFmIYKlU6W=V#EyQgnJie4%^P@J>CBeIx* zfm;}a85w5HkpKw>_=LDFT0EzvwSLp)wc1WFU8GbZ8()Nlj2>E@cM*00HVrL_t(o!|j&6a??N* zg};?owj`TbM~>wminHqm)7jQ7T+YiBYQ&CK3K*#O066VsFvIweR!! z?R#Fmdjmkd-oP*nwATLwux$s!FbJcFo0~a75L5?<+Yt>nNoFSS)ULu5r1mNV~0Q)Ej_cHlL9saVdaStA$c+WUYqlx?Ejd zRR=ikba;6B2(2~K*_1rbO1CwNLXM7H9NXc<^$>{a0Nsv9(`phgBeFar&-2m%X_}H{ z84sK$o_kEZOsWIOn#3Rb#7WG2KCirtrqc;^(NS%G}U;vjb? zhIQv;UIIC?nIRD+&iT2ysd*(pE(3#eQEFmIYKlU6W=V#EyQgnJie4%^P@J>CBeIx* zfm;}a85w5HkpKw>_=LDFT0Cdd=C!r8m7?>y&jSTzJY5_^BrYc>ERf`AWnyDjXcuf@ gvuA$yEHr?D!7G=)z2|n0GEg0Zr>mdKI;Vst0PjIDi2wiq literal 0 HcmV?d00001 diff --git a/sl_controller/textures/sl_controller_terminal2_top.png b/sl_controller/textures/sl_controller_terminal2_top.png new file mode 100644 index 0000000000000000000000000000000000000000..760ce77b530f620e646168945830e4ee82b154be GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pI^QAR{g%t5f(5-22_84^+AoS&PUnpXnkGB7w7r6!i7 zrYMwWmSiZnd-?{X=%um)#jkt1IEF+VPEK)PUVUBX_jw0r0V$!Q9cR)HE_?C&d%nrW zIg=-IJNI-ZHXK~R>?UjQsv(fQ$133p<6=IEQU>mgy5hSmAH2N0oLQR5$*GBXKHIrD z`wj?*&vp{4efEWw4FvSI-Q_9VsHtHRm~iot<$p;D35`QL&NOrh^EH}kAC|nfh9^A% z2u_?ny->@x#Hm5%zMybXvmQ%Cfd$jNEayYvLM4Bfcm_*+`c(A5M8_ndYU0sOE=Dis z#zz7TtxT#75q~B41cXJ?e|&qZ?dxT$r@rs BeV_mU literal 0 HcmV?d00001 diff --git a/tubelib_addons1/fermenter.lua b/tubelib_addons1/fermenter.lua index d79e4e6..0ccfa8d 100644 --- a/tubelib_addons1/fermenter.lua +++ b/tubelib_addons1/fermenter.lua @@ -10,7 +10,7 @@ fermenter.lua - The Fermenter converts 2 leave items of any kind into one Bio Gas item, + The Fermenter converts 3 leave items of any kind into one Bio Gas item, needed by the Reformer to produce Bio Fuel. ]]-- @@ -23,6 +23,7 @@ local M = minetest.get_meta local STANDBY_TICKS = 4 local COUNTDOWN_TICKS = 4 local CYCLE_TIME = 2 +local NUM_LEAVES = 3 -- to produce on bio gas local function formspec(self, pos, meta) return "size[8,8]".. @@ -113,10 +114,10 @@ local function convert_leaves_to_biogas(pos, meta) return end - -- take 2 items + -- take NUM_LEAVES items local items = {} local fault = false - for i = 1, 2 do + for i = 1, NUM_LEAVES do items[i] = tubelib.get_num_items(meta, "src", 1) if items[i] then -- input available? if not is_leaves(items[i]:get_name()) then @@ -127,7 +128,7 @@ local function convert_leaves_to_biogas(pos, meta) end -- put result into dst inventory - if #items == 2 then + if #items == NUM_LEAVES then inv:add_item("dst", biogas) State:keep_running(pos, meta, COUNTDOWN_TICKS) return diff --git a/tubelib_addons1/harvester.lua b/tubelib_addons1/harvester.lua index 72c0daf..47ed578 100644 --- a/tubelib_addons1/harvester.lua +++ b/tubelib_addons1/harvester.lua @@ -14,7 +14,7 @@ The machine is able to harvest an square area of up to 33x33 blocks (radius = 16). The base node has to be placed in the middle of the harvesting area. - The Harvester processes one node every 4 seconds. + The Harvester processes one node every 6 seconds. It requires one item Bio Fuel per 20 nodes. ]]-- @@ -24,7 +24,7 @@ local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local P = minetest.string_to_pos local M = minetest.get_meta -local CYCLE_TIME = 4 +local CYCLE_TIME = 6 local MAX_HEIGHT = 18 -- harvesting altitude local MAX_DIAMETER = 33 local BURNING_TIME = 20 -- fuel diff --git a/tubelib_addons2/gateblock.lua b/tubelib_addons2/gateblock.lua index 1973309..27891e2 100644 --- a/tubelib_addons2/gateblock.lua +++ b/tubelib_addons2/gateblock.lua @@ -73,7 +73,7 @@ for idx,pgn in ipairs(tPgns) do sounds = default.node_sound_stone_defaults(), groups = {cracky=2, choppy=2, crumbly=2, not_in_creative_inventory = idx==NUM_TEXTURES and 0 or 1}, is_ground_content = false, - drop = "tubelib_addons2:gateblock15", + drop = "tubelib_addons2:gateblock1", }) not_in_inventory = 1 diff --git a/tubelib_addons2/init.lua b/tubelib_addons2/init.lua index 21e980c..fb37810 100644 --- a/tubelib_addons2/init.lua +++ b/tubelib_addons2/init.lua @@ -15,6 +15,7 @@ dofile(minetest.get_modpath("tubelib_addons2") .. "/sequencer.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/gateblock.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/doorblock.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/repeater.lua") +dofile(minetest.get_modpath("tubelib_addons2") .. "/logic_not.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/programmer.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/accesscontrol.lua") dofile(minetest.get_modpath("tubelib_addons2") .. "/streetlamp.lua")