From 7f8758f17b3e671a1e06e56c32081454b466c24e Mon Sep 17 00:00:00 2001 From: Johannes Fritz Date: Sun, 18 Jun 2023 13:05:35 -0500 Subject: [PATCH 1/5] Pressure plates: check for entity contact (#632) --- mesecons_pressureplates/init.lua | 65 +++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/mesecons_pressureplates/init.lua b/mesecons_pressureplates/init.lua index 5c7346a..cc4b10c 100644 --- a/mesecons_pressureplates/init.lua +++ b/mesecons_pressureplates/init.lua @@ -10,6 +10,49 @@ local pp_box_on = { fixed = { -7/16, -8/16, -7/16, 7/16, -7.5/16, 7/16 }, } +local function obj_touching_plate_pos(obj_ref, plate_pos) + local obj_pos = obj_ref:get_pos() + local props = obj_ref:get_properties() + if not (props and obj_pos and not obj_ref:get_attach()) then + return false + end + + local collisionbox = props.collisionbox + local physical = props.physical + local is_player = obj_ref:is_player() + local luaentity = obj_ref:get_luaentity() + local is_item = luaentity and luaentity.name == "__builtin:item" + if not (collisionbox and physical or is_player or is_item) then + return false + end + + local plate_x_min = plate_pos.x - 7 / 16 + local plate_x_max = plate_pos.x + 7 / 16 + local plate_z_min = plate_pos.z - 7 / 16 + local plate_z_max = plate_pos.z + 7 / 16 + local plate_y_min = plate_pos.y - 8 / 16 + local plate_y_max = plate_pos.y - 6.5 / 16 + + local obj_x_min = obj_pos.x + collisionbox[1] + local obj_x_max = obj_pos.x + collisionbox[4] + local obj_z_min = obj_pos.z + collisionbox[3] + local obj_z_max = obj_pos.z + collisionbox[6] + local obj_y_min = obj_pos.y + collisionbox[2] + local obj_y_max = obj_pos.y + collisionbox[5] + + if + obj_y_min < plate_y_max and + obj_y_max > plate_y_min and + obj_x_min < plate_x_max and + obj_x_max > plate_x_min and + obj_z_min < plate_z_max and + obj_z_max > plate_z_min + then + return true + end + return false +end + local function pp_on_timer(pos) local node = minetest.get_node(pos) local basename = minetest.registered_nodes[node.name].pressureplate_basename @@ -18,19 +61,21 @@ local function pp_on_timer(pos) -- For some reason the first time on_timer is called, the pos is wrong if not basename then return end - local objs = minetest.get_objects_inside_radius(pos, 1) + local objs = minetest.get_objects_inside_radius(pos, 1) + local obj_touching = false + for k, obj in pairs(objs) do + if obj_touching_plate_pos(obj, pos) then + obj_touching = true + break + end + end - if objs[1] == nil and node.name == basename .. "_on" then + if not obj_touching and node.name == basename .. "_on" then minetest.set_node(pos, {name = basename .. "_off"}) mesecon.receptor_off(pos, mesecon.rules.pplate) - elseif node.name == basename .. "_off" then - for k, obj in pairs(objs) do - local objpos = obj:get_pos() - if objpos.y > pos.y-1 and objpos.y < pos.y then - minetest.set_node(pos, {name = basename .. "_on"}) - mesecon.receptor_on(pos, mesecon.rules.pplate ) - end - end + elseif obj_touching and node.name == basename .. "_off" then + minetest.set_node(pos, {name = basename .. "_on"}) + mesecon.receptor_on(pos, mesecon.rules.pplate ) end return true end From f98ea14023fa2d6107e02d6721857d38163c3854 Mon Sep 17 00:00:00 2001 From: DS Date: Sun, 18 Jun 2023 20:21:32 +0200 Subject: [PATCH 2/5] MVPS: make stoppers non-replaceable even if they are buildable_to (#545) --- mesecons_mvps/init.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index c047ed9..5cb9c8f 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -53,11 +53,16 @@ end -- tests if the node can be pushed into, e.g. air, water, grass local function node_replaceable(name) - if minetest.registered_nodes[name] then - return minetest.registered_nodes[name].buildable_to or false + local nodedef = minetest.registered_nodes[name] + + -- everything that can be an mvps stopper (unknown nodes and nodes in the + -- mvps_stoppers table) must not be replacable + -- Note: ignore (a stopper) is buildable_to, but we do not want to push into it + if not nodedef or mesecon.mvps_stoppers[name] then + return false end - return false + return nodedef.buildable_to or false end function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky) From fef402e88a97ce61b3cb742d562e3568d0733942 Mon Sep 17 00:00:00 2001 From: Lejo Date: Sun, 18 Jun 2023 20:43:53 +0200 Subject: [PATCH 3/5] Add string.split function (#500) --- mesecons_luacontroller/init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua index 72bee24..0ee2def 100644 --- a/mesecons_luacontroller/init.lua +++ b/mesecons_luacontroller/init.lua @@ -238,6 +238,16 @@ local function safe_string_find(...) return string.find(...) end +-- do not allow pattern matching in string.split (see string.find for details) +local function safe_string_split(...) + if select(5, ...) then + debug.sethook() -- Clear hook + error("string.split: 'sep_is_pattern' (fifth parameter) may not be used in a Luacontroller") + end + + return string.split(...) +end + local function remove_functions(x) local tp = type(x) if tp == "function" then @@ -507,6 +517,7 @@ local function create_environment(pos, mem, event, itbl, send_warning) reverse = string.reverse, sub = string.sub, find = safe_string_find, + split = safe_string_split, }, math = { abs = math.abs, From b318aadd0a899f40390eecc3088593d21fa7480d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 5 Aug 2023 12:57:46 +0200 Subject: [PATCH 4/5] Translate Mesecons to German (#636) --- mesecons/locale/mesecons.de.tr | 3 +++ .../locale/mesecons_blinkyplant.de.tr | 2 ++ mesecons_button/locale/mesecons_button.de.tr | 2 ++ .../locale/mesecons_commandblock.de.tr | 5 +++++ mesecons_delayer/locale/mesecons_delayer.de.tr | 3 +++ mesecons_detector/locale/mesecons_detector.de.tr | 3 +++ .../locale/mesecons_extrawires.de.tr | 8 ++++++++ mesecons_fpga/locale/mesecons_fpga.de.tr | 3 +++ .../locale/mesecons_hydroturbine.de.tr | 2 ++ mesecons_insulated/locale/mesecons_insulated.de.tr | 2 ++ mesecons_lamp/locale/mesecons_lamp.de.tr | 2 ++ .../locale/mesecons_lightstone.de.tr | 13 +++++++++++++ .../locale/mesecons_luacontroller.de.tr | 2 ++ mesecons_materials/locale/mesecons_materials.de.tr | 4 ++++ .../locale/mesecons_microcontroller.de.tr | 2 ++ .../locale/mesecons_movestones.de.tr | 5 +++++ mesecons_noteblock/locale/mesecons_noteblock.de.tr | 2 ++ mesecons_pistons/locale/mesecons_pistons.de.tr | 7 +++++++ .../locale/mesecons_powerplant.de.tr | 2 ++ .../locale/mesecons_pressureplates.de.tr | 3 +++ mesecons_random/locale/mesecons_random.de.tr | 3 +++ .../locale/mesecons_solarpanel.de.tr | 2 ++ .../locale/mesecons_stickyblocks.de.tr | 2 ++ mesecons_switch/locale/mesecons_switch.de.tr | 2 ++ mesecons_torch/locale/mesecons_torch.de.tr | 2 ++ mesecons_walllever/locale/mesecons_walllever.de.tr | 2 ++ mesecons_wires/locale/mesecons_wires.de.tr | 2 ++ 27 files changed, 90 insertions(+) create mode 100644 mesecons/locale/mesecons.de.tr create mode 100644 mesecons_blinkyplant/locale/mesecons_blinkyplant.de.tr create mode 100644 mesecons_button/locale/mesecons_button.de.tr create mode 100644 mesecons_commandblock/locale/mesecons_commandblock.de.tr create mode 100644 mesecons_delayer/locale/mesecons_delayer.de.tr create mode 100644 mesecons_detector/locale/mesecons_detector.de.tr create mode 100644 mesecons_extrawires/locale/mesecons_extrawires.de.tr create mode 100644 mesecons_fpga/locale/mesecons_fpga.de.tr create mode 100644 mesecons_hydroturbine/locale/mesecons_hydroturbine.de.tr create mode 100644 mesecons_insulated/locale/mesecons_insulated.de.tr create mode 100644 mesecons_lamp/locale/mesecons_lamp.de.tr create mode 100644 mesecons_lightstone/locale/mesecons_lightstone.de.tr create mode 100644 mesecons_luacontroller/locale/mesecons_luacontroller.de.tr create mode 100644 mesecons_materials/locale/mesecons_materials.de.tr create mode 100644 mesecons_microcontroller/locale/mesecons_microcontroller.de.tr create mode 100644 mesecons_movestones/locale/mesecons_movestones.de.tr create mode 100644 mesecons_noteblock/locale/mesecons_noteblock.de.tr create mode 100644 mesecons_pistons/locale/mesecons_pistons.de.tr create mode 100644 mesecons_powerplant/locale/mesecons_powerplant.de.tr create mode 100644 mesecons_pressureplates/locale/mesecons_pressureplates.de.tr create mode 100644 mesecons_random/locale/mesecons_random.de.tr create mode 100644 mesecons_solarpanel/locale/mesecons_solarpanel.de.tr create mode 100644 mesecons_stickyblocks/locale/mesecons_stickyblocks.de.tr create mode 100644 mesecons_switch/locale/mesecons_switch.de.tr create mode 100644 mesecons_torch/locale/mesecons_torch.de.tr create mode 100644 mesecons_walllever/locale/mesecons_walllever.de.tr create mode 100644 mesecons_wires/locale/mesecons_wires.de.tr diff --git a/mesecons/locale/mesecons.de.tr b/mesecons/locale/mesecons.de.tr new file mode 100644 index 0000000..520c5ae --- /dev/null +++ b/mesecons/locale/mesecons.de.tr @@ -0,0 +1,3 @@ +# textdomain: mesecons + +Mesecons=Mesecons diff --git a/mesecons_blinkyplant/locale/mesecons_blinkyplant.de.tr b/mesecons_blinkyplant/locale/mesecons_blinkyplant.de.tr new file mode 100644 index 0000000..1f1e3eb --- /dev/null +++ b/mesecons_blinkyplant/locale/mesecons_blinkyplant.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_blinkyplant +Blinky Plant=Blinkpflanze diff --git a/mesecons_button/locale/mesecons_button.de.tr b/mesecons_button/locale/mesecons_button.de.tr new file mode 100644 index 0000000..1881177 --- /dev/null +++ b/mesecons_button/locale/mesecons_button.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_button +Button=Taster diff --git a/mesecons_commandblock/locale/mesecons_commandblock.de.tr b/mesecons_commandblock/locale/mesecons_commandblock.de.tr new file mode 100644 index 0000000..592e7e5 --- /dev/null +++ b/mesecons_commandblock/locale/mesecons_commandblock.de.tr @@ -0,0 +1,5 @@ +# textdomain: mesecons_commandblock +Say as the server= als Server sagen +Say to privately= an privat senden +Set health of to hitpoints=Gesundheit von auf Trefferpunkte setzen +Command Block=Befehlsblock diff --git a/mesecons_delayer/locale/mesecons_delayer.de.tr b/mesecons_delayer/locale/mesecons_delayer.de.tr new file mode 100644 index 0000000..41ea526 --- /dev/null +++ b/mesecons_delayer/locale/mesecons_delayer.de.tr @@ -0,0 +1,3 @@ +# textdomain: mesecons_delayer +Delayer=Verzögerer +You hacker you=Sie Hacker diff --git a/mesecons_detector/locale/mesecons_detector.de.tr b/mesecons_detector/locale/mesecons_detector.de.tr new file mode 100644 index 0000000..d58625e --- /dev/null +++ b/mesecons_detector/locale/mesecons_detector.de.tr @@ -0,0 +1,3 @@ +# textdomain: mesecons_detector +Player Detector=Spielerdetektor +Node Detector=Blockdetektor diff --git a/mesecons_extrawires/locale/mesecons_extrawires.de.tr b/mesecons_extrawires/locale/mesecons_extrawires.de.tr new file mode 100644 index 0000000..5df510e --- /dev/null +++ b/mesecons_extrawires/locale/mesecons_extrawires.de.tr @@ -0,0 +1,8 @@ +# textdomain: mesecons_extrawires +Insulated Mesecon Corner=Isolierte Meseconecke +Insulated Mesecon Crossover=Isolierter Meseconübergang +You hacker you!=Sie Hacker! +Insulated Mesecon Double Corner=Isolierte Mesecondoppelecke +Mese Wire=Mesedraht +Insulated Mesecon T-junction=Isolierte Mesecongabelung +Vertical Mesecon=Vertikaler Mesecon diff --git a/mesecons_fpga/locale/mesecons_fpga.de.tr b/mesecons_fpga/locale/mesecons_fpga.de.tr new file mode 100644 index 0000000..b3f0dd2 --- /dev/null +++ b/mesecons_fpga/locale/mesecons_fpga.de.tr @@ -0,0 +1,3 @@ +# textdomain: mesecons_fpga +FPGA=FPGA +FPGA Programmer=FPGA-Programmierer diff --git a/mesecons_hydroturbine/locale/mesecons_hydroturbine.de.tr b/mesecons_hydroturbine/locale/mesecons_hydroturbine.de.tr new file mode 100644 index 0000000..6c5d8f9 --- /dev/null +++ b/mesecons_hydroturbine/locale/mesecons_hydroturbine.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_hydroturbine +Water Turbine=Wasserturbine diff --git a/mesecons_insulated/locale/mesecons_insulated.de.tr b/mesecons_insulated/locale/mesecons_insulated.de.tr new file mode 100644 index 0000000..550a121 --- /dev/null +++ b/mesecons_insulated/locale/mesecons_insulated.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_insulated +Straight Insulated Mesecon=Isolierte Mesecongerade diff --git a/mesecons_lamp/locale/mesecons_lamp.de.tr b/mesecons_lamp/locale/mesecons_lamp.de.tr new file mode 100644 index 0000000..488d534 --- /dev/null +++ b/mesecons_lamp/locale/mesecons_lamp.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_lamp +Mesecon Lamp=Meseconlampe diff --git a/mesecons_lightstone/locale/mesecons_lightstone.de.tr b/mesecons_lightstone/locale/mesecons_lightstone.de.tr new file mode 100644 index 0000000..18e8853 --- /dev/null +++ b/mesecons_lightstone/locale/mesecons_lightstone.de.tr @@ -0,0 +1,13 @@ +# textdomain: mesecons_lightstone +Red Lightstone=Roter Leuchtstein +Green Lightstone=Grüner Leuchtstein +Blue Lightstone=Blauer Leuchtstein +Grey Lightstone=Grauer Leuchtstein +Dark Grey Lightstone=Dunkelgrauer Leuchtstein +Yellow Lightstone=Gelber Leuchtstein +Orange Lightstone=Orange Leuchtstein +White Lightstone=Weißer Leuchtstein +Pink Lightstone=Rosa Leuchtstein +Magenta Lightstone=Magenta Leuchtstein +Cyan Lightstone=Türkiser Leuchtstein +Violet Lightstone=Violetter Leuchtstein diff --git a/mesecons_luacontroller/locale/mesecons_luacontroller.de.tr b/mesecons_luacontroller/locale/mesecons_luacontroller.de.tr new file mode 100644 index 0000000..3ae0244 --- /dev/null +++ b/mesecons_luacontroller/locale/mesecons_luacontroller.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_luacontroller +Luacontroller=Luacontroller diff --git a/mesecons_materials/locale/mesecons_materials.de.tr b/mesecons_materials/locale/mesecons_materials.de.tr new file mode 100644 index 0000000..56a350c --- /dev/null +++ b/mesecons_materials/locale/mesecons_materials.de.tr @@ -0,0 +1,4 @@ +# textdomain: mesecons_materials +Glue=Klebstoff +Fiber=Faser +Silicon=Silizium diff --git a/mesecons_microcontroller/locale/mesecons_microcontroller.de.tr b/mesecons_microcontroller/locale/mesecons_microcontroller.de.tr new file mode 100644 index 0000000..1348a6f --- /dev/null +++ b/mesecons_microcontroller/locale/mesecons_microcontroller.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_microcontroller +Microcontroller=Mikrocontroller diff --git a/mesecons_movestones/locale/mesecons_movestones.de.tr b/mesecons_movestones/locale/mesecons_movestones.de.tr new file mode 100644 index 0000000..3f11ea2 --- /dev/null +++ b/mesecons_movestones/locale/mesecons_movestones.de.tr @@ -0,0 +1,5 @@ +# textdomain: mesecons_movestones +Movestone=Laufstein +Sticky Movestone=Klebriger Laufstein +Vertical Movestone=Vertikaler Laufstein +Vertical Sticky Movestone=Vertikaler klebriger Laufstein diff --git a/mesecons_noteblock/locale/mesecons_noteblock.de.tr b/mesecons_noteblock/locale/mesecons_noteblock.de.tr new file mode 100644 index 0000000..88d82c3 --- /dev/null +++ b/mesecons_noteblock/locale/mesecons_noteblock.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_noteblock +Noteblock=Notenblock diff --git a/mesecons_pistons/locale/mesecons_pistons.de.tr b/mesecons_pistons/locale/mesecons_pistons.de.tr new file mode 100644 index 0000000..b85dd92 --- /dev/null +++ b/mesecons_pistons/locale/mesecons_pistons.de.tr @@ -0,0 +1,7 @@ +# textdomain: mesecons_pistons +Piston=Kolben +Activated Piston Base=Aktivierter Kolbenkörper +Piston Pusher=Kolbenschieber +Sticky Piston=Haftender Kolben +Activated Sticky Piston Base=Aktivierter haftender Kolbenkörper +Sticky Piston Pusher=Haftender Kolbenschieber diff --git a/mesecons_powerplant/locale/mesecons_powerplant.de.tr b/mesecons_powerplant/locale/mesecons_powerplant.de.tr new file mode 100644 index 0000000..8417c6a --- /dev/null +++ b/mesecons_powerplant/locale/mesecons_powerplant.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_powerplant +Power Plant=Energiepflanze diff --git a/mesecons_pressureplates/locale/mesecons_pressureplates.de.tr b/mesecons_pressureplates/locale/mesecons_pressureplates.de.tr new file mode 100644 index 0000000..fd54613 --- /dev/null +++ b/mesecons_pressureplates/locale/mesecons_pressureplates.de.tr @@ -0,0 +1,3 @@ +# textdomain: mesecons_pressureplates +Wooden Pressure Plate=Holzdruckplatte +Stone Pressure Plate=Steindruckplatte diff --git a/mesecons_random/locale/mesecons_random.de.tr b/mesecons_random/locale/mesecons_random.de.tr new file mode 100644 index 0000000..074b9e8 --- /dev/null +++ b/mesecons_random/locale/mesecons_random.de.tr @@ -0,0 +1,3 @@ +# textdomain: mesecons_random +Removestone=Verschwindestein +Ghoststone=Geisterstein diff --git a/mesecons_solarpanel/locale/mesecons_solarpanel.de.tr b/mesecons_solarpanel/locale/mesecons_solarpanel.de.tr new file mode 100644 index 0000000..d5c0c94 --- /dev/null +++ b/mesecons_solarpanel/locale/mesecons_solarpanel.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_solarpanel +Solar Panel=Solarmodul diff --git a/mesecons_stickyblocks/locale/mesecons_stickyblocks.de.tr b/mesecons_stickyblocks/locale/mesecons_stickyblocks.de.tr new file mode 100644 index 0000000..25cfd06 --- /dev/null +++ b/mesecons_stickyblocks/locale/mesecons_stickyblocks.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_stickyblocks +Sticky Block=Klebeblock diff --git a/mesecons_switch/locale/mesecons_switch.de.tr b/mesecons_switch/locale/mesecons_switch.de.tr new file mode 100644 index 0000000..a49a9ac --- /dev/null +++ b/mesecons_switch/locale/mesecons_switch.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_switch +Switch=Schalter diff --git a/mesecons_torch/locale/mesecons_torch.de.tr b/mesecons_torch/locale/mesecons_torch.de.tr new file mode 100644 index 0000000..a72a138 --- /dev/null +++ b/mesecons_torch/locale/mesecons_torch.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_torch +Mesecon Torch=Meseconfackel diff --git a/mesecons_walllever/locale/mesecons_walllever.de.tr b/mesecons_walllever/locale/mesecons_walllever.de.tr new file mode 100644 index 0000000..d854ff6 --- /dev/null +++ b/mesecons_walllever/locale/mesecons_walllever.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_walllever +Lever=Wandschalter diff --git a/mesecons_wires/locale/mesecons_wires.de.tr b/mesecons_wires/locale/mesecons_wires.de.tr new file mode 100644 index 0000000..0297099 --- /dev/null +++ b/mesecons_wires/locale/mesecons_wires.de.tr @@ -0,0 +1,2 @@ +# textdomain: mesecons_wires +Mesecon=Mesecon From 8e30ee411347e6552cb5a9f28ea3069805853ea3 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Sat, 26 Aug 2023 11:36:20 +0200 Subject: [PATCH 5/5] Update mesecons_delayer.de.tr (#649) This is a casual game, no need for formal voice. --- mesecons_delayer/locale/mesecons_delayer.de.tr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesecons_delayer/locale/mesecons_delayer.de.tr b/mesecons_delayer/locale/mesecons_delayer.de.tr index 41ea526..15db723 100644 --- a/mesecons_delayer/locale/mesecons_delayer.de.tr +++ b/mesecons_delayer/locale/mesecons_delayer.de.tr @@ -1,3 +1,3 @@ # textdomain: mesecons_delayer Delayer=Verzögerer -You hacker you=Sie Hacker +You hacker you=Du Hacker, Du