mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 07:23:00 +00:00
Delete copied code
Given licence incompatibilities, we can't really copy code from WorldEdit
This commit is contained in:
parent
9d3a4ce263
commit
10f350c967
5 changed files with 12 additions and 79 deletions
|
@ -9,3 +9,13 @@ worldedit.alias_command("flora", "bonemeal")
|
|||
-- Measure Tools
|
||||
worldedit.alias_command("mcount", "count")
|
||||
worldedit.alias_command("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")
|
||||
|
|
|
@ -81,13 +81,3 @@ end
|
|||
|
||||
|
||||
dofile(we_c.modpath.."/aliases.lua")
|
||||
|
||||
|
||||
--- 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")
|
||||
|
|
|
@ -10,5 +10,5 @@ local we_cm = worldeditadditions_core.modpath .. "/register/"
|
|||
|
||||
dofile(we_cm.."check.lua")
|
||||
dofile(we_cm.."handler.lua")
|
||||
dofile(we_cm.."register.lua")
|
||||
dofile(we_cm.."override.lua")
|
||||
-- dofile(we_cm.."register.lua")
|
||||
-- dofile(we_cm.."override.lua")
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
local we_c = worldeditadditions_core
|
||||
function we_c.override_command(name, def)
|
||||
local def = table.copy(def)
|
||||
local success, err = we_c.check_command(name, def)
|
||||
|
||||
if not success then
|
||||
error(err)
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.override_chatcommand("/" .. name, {
|
||||
privs = def.privs,
|
||||
params = def.params,
|
||||
description = def.description,
|
||||
func = function(player_name, param)
|
||||
return we_c.chatcommand_handler(name, player_name, param)
|
||||
end,
|
||||
})
|
||||
worldedit.registered_commands[name] = def
|
||||
end
|
||||
|
||||
function we_c.alias_override(alias, original)
|
||||
if not worldedit.registered_commands[original] then
|
||||
minetest.log("error", "worldedit_shortcommands: original " .. original .. " does not exist")
|
||||
return
|
||||
end
|
||||
if minetest.chatcommands["/" .. alias] then
|
||||
minetest.override_chatcommand("/" .. alias, minetest.chatcommands["/" .. original])
|
||||
worldedit.registered_commands[alias] = worldedit.registered_commands[original]
|
||||
else
|
||||
minetest.register_chatcommand("/" .. alias, minetest.chatcommands["/" .. original])
|
||||
worldedit.registered_commands[alias] = worldedit.registered_commands[original]
|
||||
end
|
||||
|
||||
end
|
|
@ -1,32 +0,0 @@
|
|||
local we_c = worldeditadditions_core
|
||||
function we_c.register_command(name, def)
|
||||
local def = table.copy(def)
|
||||
local success, err = we_c.check_command(name, def)
|
||||
if not success then
|
||||
return false, err
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("/" .. name, {
|
||||
privs = def.privs,
|
||||
params = def.params,
|
||||
description = def.description,
|
||||
func = function(player_name, param)
|
||||
return we_c.chatcommand_handler(name, player_name, param)
|
||||
end,
|
||||
})
|
||||
worldedit.registered_commands[name] = def
|
||||
end
|
||||
|
||||
function we_c.alias_command(alias, original)
|
||||
if not worldedit.registered_commands[original] then
|
||||
minetest.log("error", "worldedit_shortcommands: original " .. original .. " does not exist")
|
||||
return
|
||||
end
|
||||
if minetest.chatcommands["/" .. alias] then
|
||||
minetest.log("error", "worldedit_shortcommands: alias " .. alias .. " already exists")
|
||||
return
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("/" .. alias, minetest.chatcommands["/" .. original])
|
||||
worldedit.registered_commands[alias] = worldedit.registered_commands[original]
|
||||
end
|
Loading…
Reference in a new issue