mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 15:12:23 +01:00
Add /fixlight chat command
This commit is contained in:
parent
57eaf62c69
commit
f6d1b682d3
@ -487,6 +487,25 @@ core.register_chatcommand("deleteblocks", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
core.register_chatcommand("fixlight", {
|
||||||
|
params = "(here [radius]) | (<pos1> <pos2>)",
|
||||||
|
description = "Resets lighting in the area between pos1 and pos2",
|
||||||
|
privs = {server = true},
|
||||||
|
func = function(name, param)
|
||||||
|
local p1, p2 = parse_range_str(name, param)
|
||||||
|
if p1 == false then
|
||||||
|
return false, p2
|
||||||
|
end
|
||||||
|
|
||||||
|
if core.fix_light(p1, p2) then
|
||||||
|
return true, "Successfully reset light in the area ranging from " ..
|
||||||
|
core.pos_to_string(p1, 1) .. " to " .. core.pos_to_string(p2, 1)
|
||||||
|
else
|
||||||
|
return false, "Failed to load one or more blocks in area"
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
core.register_chatcommand("mods", {
|
core.register_chatcommand("mods", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "List mods installed on the server",
|
description = "List mods installed on the server",
|
||||||
|
Loading…
Reference in New Issue
Block a user