From 77181cbc3b3f3de697715d7c78c3c0e13bc71276 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 19 Feb 2023 10:53:12 +0100 Subject: [PATCH] Fix electrolyzer formspec bug --- doc/manual_DE.lua | 4 ---- hydrogen/electrolyzer.lua | 10 ++++++++-- manuals/manual_ta1_DE.md | 6 ------ manuals/toc_DE.md | 1 - 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/doc/manual_DE.lua b/doc/manual_DE.lua index d9fb9da..fa66c04 100644 --- a/doc/manual_DE.lua +++ b/doc/manual_DE.lua @@ -21,7 +21,6 @@ techage.manual_DE.aTitel = { "3,TA1 Schleusengriff / TA1 Sluice Handle", "3,TA1 Apfelholzbrett / TA1 Apple Wood Board", "3,TA1 Apfel Mühlbachbrett / TA1 Apple Millrace Board", - "2, ", "2,Erze und Werkzeuge", "3,Hammer", "3,Kiessieb / Gravel Sieve", @@ -432,7 +431,6 @@ techage.manual_DE.aText = { "\n".. "\n".. "\n", - "", "TA1 hat seine eigenen Werkzeuge wie Hammer und Kiessieb\\, aber auch der Minecart Hopper kann genutzt werden.\n".. "\n".. "\n".. @@ -2189,7 +2187,6 @@ techage.manual_DE.aItemName = { "ta1_sluice_handle", "ta1_board1", "ta1_board2", - "", "ta1_gravelsieve", "hammer", "ta1_gravelsieve", @@ -2450,7 +2447,6 @@ techage.manual_DE.aPlanTable = { "", "", "", - "", "hoppersieve", "", "", diff --git a/hydrogen/electrolyzer.lua b/hydrogen/electrolyzer.lua index 599d489..9cab71f 100644 --- a/hydrogen/electrolyzer.lua +++ b/hydrogen/electrolyzer.lua @@ -26,6 +26,7 @@ local STANDBY_TICKS = 3 local PWR_NEEDED = 35 local PWR_UNITS_PER_HYDROGEN_ITEM = 80 local CAPACITY = 200 +local TURNOFF_THRESHOLD = "40%" local function evaluate_percent(s) return (tonumber(s:sub(1, -2)) or 0) / 100 @@ -124,11 +125,14 @@ local function node_timer(pos, elapsed) State:keep_running(pos, nvm, 1) end elseif curr_load == 0 then + nvm.taken = 0 State:nopower(pos, nvm) else + nvm.taken = 0 State:standby(pos, nvm, S("Turnoff point reached")) end else + nvm.taken = 0 State:blocked(pos, nvm, S("Storage full")) end if techage.is_activeformspec(pos) then @@ -161,6 +165,8 @@ local function after_place_node(pos) State:node_init(pos, nvm, number) local node = minetest.get_node(pos) M(pos):set_int("in_dir", techage.side_to_indir("R", node.param2)) + M(pos):set_string("reduction", "100%") + M(pos):set_string("turnoff", TURNOFF_THRESHOLD) Pipe:after_place_node(pos) Cable:after_place_node(pos) end @@ -201,7 +207,7 @@ local tool_config = { name = "turnoff", label = S("Turnoff point"), tooltip = S("If the charge of the storage\nsystem falls below the configured value,\nthe block switches off"), - default = "98%", + default = TURNOFF_THRESHOLD, }, } @@ -349,7 +355,7 @@ techage.register_node({"techage:ta4_electrolyzer", "techage:ta4_electrolyzer_on" local meta = M(pos) if not meta:contains("reduction") then meta:set_string("reduction", "100%") - meta:set_string("turnoff", "100%") + meta:set_string("turnoff", TURNOFF_THRESHOLD) end end, }) diff --git a/manuals/manual_ta1_DE.md b/manuals/manual_ta1_DE.md index 4811439..b0de021 100644 --- a/manuals/manual_ta1_DE.md +++ b/manuals/manual_ta1_DE.md @@ -110,12 +110,6 @@ Block in verschiedenen Holzsorten zum Bauen des Mühlbachkanals. Dieser Block ei - -## - - - - ## Erze und Werkzeuge TA1 hat seine eigenen Werkzeuge wie Hammer und Kiessieb, aber auch der Minecart Hopper kann genutzt werden. diff --git a/manuals/toc_DE.md b/manuals/toc_DE.md index 4ede925..8b41dac 100644 --- a/manuals/toc_DE.md +++ b/manuals/toc_DE.md @@ -20,7 +20,6 @@ - [TA1 Schleusengriff / TA1 Sluice Handle](./manual_ta1_DE.md#ta1-schleusengriff--ta1-sluice-handle) - [TA1 Apfelholzbrett / TA1 Apple Wood Board](./manual_ta1_DE.md#ta1-apfelholzbrett--ta1-apple-wood-board) - [TA1 Apfel Mühlbachbrett / TA1 Apple Millrace Board](./manual_ta1_DE.md#ta1-apfel-mühlbachbrett--ta1-apple-millrace-board) - - [ ](./manual_ta1_DE.md#-) - [Erze und Werkzeuge](./manual_ta1_DE.md#erze-und-werkzeuge) - [Hammer](./manual_ta1_DE.md#hammer) - [Kiessieb / Gravel Sieve](./manual_ta1_DE.md#kiessieb--gravel-sieve)