-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec32f94
commit 449f12d
Showing
1 changed file
with
18 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,21 @@ | ||
local weac = worldeditadditions_core | ||
-- ██████ ███████ ███████ ███████ ████████ | ||
-- ██ ██ ██ ██ ██ ██ | ||
-- ██████ █████ ███████ █████ ██ | ||
-- ██ ██ ██ ██ ██ ██ | ||
-- ██ ██ ███████ ███████ ███████ ██ | ||
|
||
local wea_c = worldeditadditions_core | ||
|
||
local worldedit_reset | ||
if minetest.registered_chatcommands["/reset"] then | ||
worldedit_reset = minetest.registered_chatcommands["/reset"].func | ||
end | ||
|
||
local function do_reset(name, params_text) | ||
-- Hide the WorldEdit marker, if appropriate | ||
if type(worldedit_reset) == "function" then | ||
worldedit_reset(name, params_text) | ||
worldeditadditions_core.register_command("reset", { | ||
params = "", | ||
description = "Clears all defined points and the currently defined region.", | ||
privs = {worldedit=true}, | ||
override = true, -- Override the WorldEdit command | ||
parse = function(params_text) | ||
return true, params_text | ||
end, | ||
func = function(name) | ||
wea_c.pos.clear(name) | ||
return true, "Selection reset for "..name | ||
end | ||
|
||
-- Hide the WorldEditAdditions marker | ||
weac.pos.clear(name) | ||
end | ||
|
||
if minetest.registered_chatcommands["/reset"] then | ||
minetest.override_chatcommand("/reset", { | ||
params = "", | ||
description = "Clears all defined points and the currently defined region.", | ||
func = do_reset | ||
}) | ||
else | ||
minetest.register_chatcommand("/reset", { | ||
params = "", | ||
description = "Clears all defined points and the currently defined region.", | ||
privs = { worldedit = true }, | ||
func = do_reset | ||
}) | ||
end | ||
}) |