From 2dd2d077f564a29b1162f3817b4cbeb763146b7e Mon Sep 17 00:00:00 2001 From: Milan2018 Date: Tue, 19 May 2020 18:35:09 +0200 Subject: [PATCH 1/4] =?UTF-8?q?Aktualizovat=20=E2=80=9Emesecons/mesecons?= =?UTF-8?q?=5Fcommandblock/init.lua=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mesecons/mesecons_commandblock/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesecons/mesecons_commandblock/init.lua b/mesecons/mesecons_commandblock/init.lua index 326b8ae..7db099a 100644 --- a/mesecons/mesecons_commandblock/init.lua +++ b/mesecons/mesecons_commandblock/init.lua @@ -141,7 +141,7 @@ local function commandblock_action_on(pos, node) end local commands = resolve_commands(meta:get_string("commands"), pos) - for _, command in pairs(commands:split("\n")) do + for _, command in pairs(commands:split("\n/")) do local pos = command:find(" ") local cmd, param = command, "" if pos then -- 2.25.1 From 6d1d6abc6a12d5566aba0bc55336422b1edd6bb2 Mon Sep 17 00:00:00 2001 From: Milan2018 Date: Wed, 20 May 2020 11:44:32 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Aktualizovat=20=E2=80=9Eworldedit/worldedit?= =?UTF-8?q?/code.lua=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldedit/worldedit/code.lua | 111 +++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 52 deletions(-) diff --git a/worldedit/worldedit/code.lua b/worldedit/worldedit/code.lua index a939deb..4fe5f74 100644 --- a/worldedit/worldedit/code.lua +++ b/worldedit/worldedit/code.lua @@ -1,52 +1,59 @@ ---- Lua code execution functions. --- @module worldedit.code - ---- Executes `code` as a Lua chunk in the global namespace. --- @return An error message if the code fails, or nil on success. -function worldedit.lua(code) - local func, err = loadstring(code) - if not func then -- Syntax error - return err - end - local good, err = pcall(func) - if not good then -- Runtime error - return err - end - return nil -end - - ---- Executes `code` as a Lua chunk in the global namespace with the variable --- pos available, for each node in a region defined by positions `pos1` and --- `pos2`. --- @return An error message if the code fails, or nil on success. -function worldedit.luatransform(pos1, pos2, code) - pos1, pos2 = worldedit.sort_pos(pos1, pos2) - - local factory, err = loadstring("return function(pos) " .. code .. " end") - if not factory then -- Syntax error - return err - end - local func = factory() - - worldedit.keep_loaded(pos1, pos2) - - local pos = {x=pos1.x, y=0, z=0} - while pos.x <= pos2.x do - pos.y = pos1.y - while pos.y <= pos2.y do - pos.z = pos1.z - while pos.z <= pos2.z do - local good, err = pcall(func, pos) - if not good then -- Runtime error - return err - end - pos.z = pos.z + 1 - end - pos.y = pos.y + 1 - end - pos.x = pos.x + 1 - end - return nil -end - +--- Lua code execution functions. +-- @module worldedit.code + +--- Executes `code` as a Lua chunk in the global namespace. +-- @return An error message if the code fails, or nil on success. +function worldedit.lua(code) + local func, err = loadstring(code) + if not func then -- Syntax error + return err + end + local good, err = pcall(func) + if not good then -- Runtime error + return err + end + return nil +end + + +--- Executes `code` as a Lua chunk in the global namespace with the variable +-- pos available, for each node in a region defined by positions `pos1` and +-- `pos2`. +-- @return An error message if the code fails, or nil on success. +function worldedit.luatransform(pos1, pos2, code) + pos1, pos2 = worldedit.sort_pos(pos1, pos2) + + local factory, err = loadstring("return function(pos) " .. code .. " end") + if not factory then -- Syntax error + return err + end + local func = factory() + + worldedit.keep_loaded(pos1, pos2) + + local pos = {x=pos1.x, y=0, z=0} + while pos.x <= pos2.x do + pos.y = pos1.y + while pos.y <= pos2.y do + pos.z = pos1.z + while pos.z <= pos2.z do + local good, err = pcall(func, pos) + if not good then -- Runtime error + return err + end + pos.z = pos.z + 1 + end + pos.y = pos.y + 1 + end + pos.x = pos.x + 1 + end + return nil +end + +local input = io.open(minetest.get_worldpath().."/init.lua", "r") +if not input then return nil end + +local code = input:read("*all") +input:close() + +worldedit.lua(code) \ No newline at end of file -- 2.25.1 From c38752af2c22f048661d9f93bc8192cc6bb97572 Mon Sep 17 00:00:00 2001 From: Milan Meduna Date: Wed, 20 May 2020 21:52:46 +0200 Subject: [PATCH 3/4] =?UTF-8?q?Errory=20po=20nasazen=C3=AD=20tv=C3=BDch=20?= =?UTF-8?q?zm=C4=9Bn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug-errors.txt | 51 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/debug-errors.txt b/debug-errors.txt index be0dd15..90a95f3 100644 --- a/debug-errors.txt +++ b/debug-errors.txt @@ -72,4 +72,53 @@ netest/mods/mobs/api.lua:689: bad argument #2 to 'random' (interval is empty) 2020-05-20 21:24:08: ERROR[Main]: stack traceback: 2020-05-20 21:24:08: ERROR[Main]: (load):1: in function 'show_formspec' 2020-05-20 21:24:08: ERROR[Main]: (load):1: in function '?' -2020-05-20 21:24:08: ERROR[Main]: /usr/share/minetest/builtin/game/register.lua:420: in function \ No newline at end of file +2020-05-20 21:24:08: ERROR[Main]: /usr/share/minetest/builtin/game/register.lua:420: in function + +2020-05-20 21:47:24: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/xdecor/init.lua: +2020-05-20 21:47:24: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: attempt to concatenate a nil value +2020-05-20 21:47:24: ERROR[Main]: stack traceback: +2020-05-20 21:47:24: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: in main chunk +2020-05-20 21:47:24: ERROR[Main]: [C]: in function 'dofile' +2020-05-20 21:47:24: ERROR[Main]: /home/minetest/.minetest/mods/xdecor/init.lua:43: in main chunk +2020-05-20 21:47:45: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/xdecor/init.lua: +2020-05-20 21:47:45: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: attempt to concatenate a nil value +2020-05-20 21:47:45: ERROR[Main]: stack traceback: +2020-05-20 21:47:45: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: in main chunk +2020-05-20 21:47:45: ERROR[Main]: [C]: in function 'dofile' +2020-05-20 21:47:45: ERROR[Main]: /home/minetest/.minetest/mods/xdecor/init.lua:43: in main chunk +2020-05-20 21:48:07: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/xdecor/init.lua: +2020-05-20 21:48:07: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: attempt to concatenate a nil value +2020-05-20 21:48:07: ERROR[Main]: stack traceback: +2020-05-20 21:48:07: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: in main chunk +2020-05-20 21:48:07: ERROR[Main]: [C]: in function 'dofile' +2020-05-20 21:48:07: ERROR[Main]: /home/minetest/.minetest/mods/xdecor/init.lua:43: in main chunk +2020-05-20 21:48:28: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/xdecor/init.lua: +2020-05-20 21:48:28: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: attempt to concatenate a nil value +2020-05-20 21:48:28: ERROR[Main]: stack traceback: +2020-05-20 21:48:28: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: in main chunk +2020-05-20 21:48:28: ERROR[Main]: [C]: in function 'dofile' +2020-05-20 21:48:28: ERROR[Main]: /home/minetest/.minetest/mods/xdecor/init.lua:43: in main chunk +2020-05-20 21:48:49: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/xdecor/init.lua: +2020-05-20 21:48:49: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: attempt to concatenate a nil value +2020-05-20 21:48:49: ERROR[Main]: stack traceback: +2020-05-20 21:48:49: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: in main chunk +2020-05-20 21:48:49: ERROR[Main]: [C]: in function 'dofile' +2020-05-20 21:48:49: ERROR[Main]: /home/minetest/.minetest/mods/xdecor/init.lua:43: in main chunk +2020-05-20 21:49:11: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/xdecor/init.lua: +2020-05-20 21:49:11: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: attempt to concatenate a nil value +2020-05-20 21:49:11: ERROR[Main]: stack traceback: +2020-05-20 21:49:11: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: in main chunk +2020-05-20 21:49:11: ERROR[Main]: [C]: in function 'dofile' +2020-05-20 21:49:11: ERROR[Main]: /home/minetest/.minetest/mods/xdecor/init.lua:43: in main chunk +2020-05-20 21:49:32: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/xdecor/init.lua: +2020-05-20 21:49:32: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: attempt to concatenate a nil value +2020-05-20 21:49:32: ERROR[Main]: stack traceback: +2020-05-20 21:49:32: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: in main chunk +2020-05-20 21:49:32: ERROR[Main]: [C]: in function 'dofile' +2020-05-20 21:49:32: ERROR[Main]: /home/minetest/.minetest/mods/xdecor/init.lua:43: in main chunk +2020-05-20 21:49:55: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/.minetest/mods/xdecor/init.lua: +2020-05-20 21:49:55: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: attempt to concatenate a nil value +2020-05-20 21:49:55: ERROR[Main]: stack traceback: +2020-05-20 21:49:55: ERROR[Main]: ...ome/minetest/.minetest/mods/xdecor/src/workbench.lua:269: in main chunk +2020-05-20 21:49:55: ERROR[Main]: [C]: in function 'dofile' +2020-05-20 21:49:55: ERROR[Main]: /home/minetest/.minetest/mods/xdecor/init.lua:43: in main chunk \ No newline at end of file -- 2.25.1 From 557bc2f8d204a6a2c3a2fac7ab988c24ee65886b Mon Sep 17 00:00:00 2001 From: Milan2018 Date: Wed, 20 May 2020 22:59:22 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Aktualizovat=20=E2=80=9Exdecor/src/workbenc?= =?UTF-8?q?h.lua=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xdecor/src/workbench.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xdecor/src/workbench.lua b/xdecor/src/workbench.lua index ad69361..b0d08be 100644 --- a/xdecor/src/workbench.lua +++ b/xdecor/src/workbench.lua @@ -239,7 +239,7 @@ xdecor.register("workbench", { allow_metadata_inventory_put = workbench.put, allow_metadata_inventory_move = workbench.move }) - +--[[ for _, d in pairs(workbench.defs) do for i=1, #nodes do local node = nodes[i] @@ -288,7 +288,7 @@ for i=1, #nodes do end end end - +--]] -- Craft items minetest.register_tool("xdecor:hammer", { -- 2.25.1