diff --git a/README.md b/README.md index fa546ad..a8c314b 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ Copyright (C) 2019-2020 Joachim Stolberg Code: Licensed under the GNU GPL version 3 or later. See LICENSE.txt Textures: CC BY-SA 3.0 +Many thanks to Thomas-S for his contributions + ### Dependencies Required: default, doors, bucket, stairs, screwdriver, basic_materials, tubelib2, minecart, lcdlib, safer_lua @@ -75,6 +77,12 @@ Available worlds will be converted to 'lsqlite3', but there is no way back, so: ### History +**2020-07-31 V0.20** +- Pull request #21: Lua Controller: Allow to get itemstring and description of 8x2000 chest contents (from Thomas-S) +- Pull request #22: Trowel: Prevent hidden nodes from being dug (from Thomas-S) +- Improvement: TA3 Power Terminal: Outputs max needed power in addition +- Bugfix: Quarry: Shall not dig Techage Light Blocks + **2020-07-24 V0.19** - Pull request #19: Refactor ICTA to use functions instead of loadstring (from Thomas-S) - State command added for cart-, node-, and player detectors diff --git a/basic_machines/source.lua b/basic_machines/source.lua index 441c0eb..39bdc94 100644 --- a/basic_machines/source.lua +++ b/basic_machines/source.lua @@ -26,7 +26,7 @@ local networks = techage.networks local STANDBY_TICKS = 4 local COUNTDOWN_TICKS = 4 local CYCLE_TIME = 2 -local PWR_CAPA = 20 +local PWR_CAPA = 100 local function formspec(self, pos, nvm) return "size[4,4]".. diff --git a/basis/lib.lua b/basis/lib.lua index 1493fa6..4f50747 100644 --- a/basis/lib.lua +++ b/basis/lib.lua @@ -164,6 +164,7 @@ end function techage.dropped_node(node, ndef) if node.name == "air" then return end --if ndef.buildable_to == true then return end + if not ndef.diggable then return end if ndef.drop == "" then return end if type(ndef.drop) == "table" then return handle_drop(ndef.drop) diff --git a/lamps/lightblock.lua b/lamps/lightblock.lua index b4f089a..93a064b 100644 --- a/lamps/lightblock.lua +++ b/lamps/lightblock.lua @@ -39,6 +39,7 @@ minetest.register_node("techage:lightblock", { floodable = true, is_ground_content = false, groups = {not_in_creative_inventory=1}, + drop = "", }) function techage.light_ring(center_pos, on, large) diff --git a/power/distribution.lua b/power/distribution.lua index 0c624a5..610e7e0 100644 --- a/power/distribution.lua +++ b/power/distribution.lua @@ -147,3 +147,16 @@ function techage.power.power_distribution(network, tlib_type, netID, cycle_time) set_taken_values(network.con2, 0, tlib_type) end end + +-- determine the maxiumum needed power of all con1 consumers +function techage.power.get_con1_sum(network, tlib_type) + local sum = 0 + for _,v in ipairs(network.con1 or {}) do + local nvm = techage.get_nvm(v.pos) + local def = nvm[tlib_type] -- power related network data + if def and def["cstate"] ~= STOPPED then + sum = sum + v.nominal + end + end + return sum +end diff --git a/power/power_terminal2.lua b/power/power_terminal2.lua index 01fcb7e..6bb61cc 100644 --- a/power/power_terminal2.lua +++ b/power/power_terminal2.lua @@ -188,11 +188,14 @@ end local function get_state(netw) local state = "" + local needed = techage.power.get_con1_sum(netw, "ele1") or 0 if #(netw.gen1 or {}) + #(netw.gen2 or {}) == 0 then state = S("No power grid or running generator!") + elseif needed > (netw.available1 or 0) then + state = S("Probably too many consumers (")..needed..S(" ku is needed!)") elseif (netw.num_nodes or 0) < techage.networks.MAX_NUM_NODES then - state = S("Number of power grid blocks")..": "..(netw.num_nodes or 0) + state = S("Number of power grid blocks")..": "..(netw.num_nodes or 0)..", "..S("Max. needed power")..": "..needed.. " ku" else state = S("To many blocks in the power grid!") end