Fix override aliases

This commit is contained in:
Starbeamrainbowlabs 2022-05-24 02:24:43 +01:00
parent af7d39110b
commit 64ff61a4d2
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 9 additions and 5 deletions

View file

@ -33,6 +33,7 @@ read_globals = {
"describe", "describe",
"bonemeal", "bonemeal",
"dofile", "dofile",
"PerlinNoise" "PerlinNoise",
"Settings"
} }
std = "max" std = "max"

View file

@ -15,9 +15,12 @@ wea_c.register_alias("mfacing", "mface")
--- Overrides to core WorldEdit commands --- Overrides to core WorldEdit commands
-- These are commented out for now, as they could be potentially dangerous to stability -- 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 uncommented -- Thorough testing is required of our replacement commands before these are enabled by default
if minetest.settings:get_bool("worldeditadditions.override_commands", false) then 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("copy", "copy+", true)
worldeditadditions_core.register_alias("move", "move+", true) worldeditadditions_core.register_alias("move", "move+", true)
worldeditadditions_core.register_alias("replace", "replacemix", true) worldeditadditions_core.register_alias("replace", "replacemix", true)

View file

@ -16,7 +16,7 @@ local function register_alias(cmdname_target, cmdname_source, override)
return false return false
end 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 if minetest.chatcommands["/"..cmdname_target] then
minetest.override_chatcommand( minetest.override_chatcommand(