diff --git a/.luacheckrc b/.luacheckrc index 9ad6553..27630b7 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -33,6 +33,7 @@ read_globals = { "describe", "bonemeal", "dofile", - "PerlinNoise" + "PerlinNoise", + "Settings" } std = "max" diff --git a/tests.sh b/tests.sh index 002c8ee..4672d13 100755 --- a/tests.sh +++ b/tests.sh @@ -31,7 +31,15 @@ check_command luarocks; luarocks_root="${PWD}/.luarocks"; # Setup the lua module path -eval "$(luarocks --tree "${luarocks_root}" path)"; +# eval "$(luarocks --tree "${luarocks_root}" path)"; + +PATH="$(luarocks --tree "${luarocks_root}" path --lr-bin):${PATH}"; +echo "PATH | ${PATH}"; +LUA_PATH="$(luarocks --tree "${luarocks_root}" path --lr-path);init.lua;./?.lua"; +LUA_CPATH="$(luarocks --tree "${luarocks_root}" path --lr-cpath);./?.so"; + + +export PATH LUA_PATH LUA_CPATH; mode="${1}"; if [[ "$#" -gt 0 ]]; then shift; fi diff --git a/worldeditadditions_commands/aliases.lua b/worldeditadditions_commands/aliases.lua index bf102f6..109f76f 100644 --- a/worldeditadditions_commands/aliases.lua +++ b/worldeditadditions_commands/aliases.lua @@ -1,5 +1,6 @@ local wea_c = worldeditadditions_core + wea_c.register_alias("smoothadv", "convolve") wea_c.register_alias("conv", "convolve") @@ -14,10 +15,13 @@ wea_c.register_alias("mfacing", "mface") --- Overrides to core WorldEdit commands --- These are commented out for now, as they could be potentially dangerous to stability --- Thorough testing is required of our replacement commands before these are uncommented --- TODO: Depend on worldeditadditions_core before uncommenting this --- BUG: //move+ seems to be leaving stuff behind for some strange reason --@sbrl 2021-12-26 --- worldeditadditions_core.alias_override("copy", "copy+") --- worldeditadditions_core.alias_override("move", "move+") -- MAY have issues where it doesn't overwrite the old region properly, but haven't been able to reliably reproduce this --- worldeditadditions_core.alias_override("replace", "replacemix") +-- These are disabled by default for now, as they could be potentially dangerous to stability +-- Thorough testing is required of our replacement commands before these are enabled by default +local worldmt_settings = Settings(minetest.get_worldpath().."/world.mt") +local should_override = worldmt_settings:get_bool("worldeditadditions_override_commands", false) +if should_override then + minetest.log("info", "[WorldEditAdditions] Enabling override aliases") + worldeditadditions_core.register_alias("copy", "copy+", true) + worldeditadditions_core.register_alias("move", "move+", true) + worldeditadditions_core.register_alias("replace", "replacemix", true) +end diff --git a/worldeditadditions_commands/commands/spiral2.lua b/worldeditadditions_commands/commands/spiral2.lua index 68f689e..9bcf40f 100644 --- a/worldeditadditions_commands/commands/spiral2.lua +++ b/worldeditadditions_commands/commands/spiral2.lua @@ -3,7 +3,7 @@ local wea = worldeditadditions local Vector3 = wea.Vector3 worldeditadditions_core.register_command("spiral2", { - params = "[] [ [ [] ] ]", + params = "[circle|square] [ [ [] ] ]", description = "Generates a spiral that fills the defined region using the specified replace node. The spiral is either square (default) or circular in shape. The interval specifies the distance between the walls of the spiral, and the acceleration specifies how quickly this value should increase.", privs = { worldedit = true }, require_pos = 2, diff --git a/worldeditadditions_core/core/register_alias.lua b/worldeditadditions_core/core/register_alias.lua index 0e448a7..70c7a1e 100644 --- a/worldeditadditions_core/core/register_alias.lua +++ b/worldeditadditions_core/core/register_alias.lua @@ -16,7 +16,7 @@ local function register_alias(cmdname_target, cmdname_source, override) return false end - print("DEBUG ALIAS source "..cmdname_source.." target "..cmdname_target) + -- print("DEBUG ALIAS source "..cmdname_source.." target "..cmdname_target) if minetest.chatcommands["/"..cmdname_target] then minetest.override_chatcommand(