aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2017-04-21 12:56:10 +0200
committerparamat <mat.gregory@virginmedia.com>2017-04-22 01:24:41 +0100
commitf6d1b682d3c3fa25e11d64d52c93b92760fe2612 (patch)
tree9bebc0de2f16561636c49d8d40bf28aa953bd805
parent57eaf62c697cec91890d9cb28d10385d293d2d3f (diff)
downloadminetest-f6d1b682d3c3fa25e11d64d52c93b92760fe2612.tar.gz
minetest-f6d1b682d3c3fa25e11d64d52c93b92760fe2612.tar.bz2
minetest-f6d1b682d3c3fa25e11d64d52c93b92760fe2612.zip
Add /fixlight chat command
-rw-r--r--builtin/game/chatcommands.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index 25cc06178..84f2c3fed 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -487,6 +487,25 @@ core.register_chatcommand("deleteblocks", {
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", {
params = "",
description = "List mods installed on the server",