Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
local fix = function(name, param)
local x, y, z = string.match(param, "(%d+) (%d+) (%d+)")
local pos
if x==nil or y==nil or z==nil then
local player = minetest.get_player_by_name(name)
if not player then
return false, "Player not found"
end
pos = player:getpos()
else
pos = {["x"] = 16*x, ["y"] = 16*y, ["z"] = 16*z}
end
local px=math.floor(pos.x/16)
local py=math.floor(pos.y/16)
local pz=math.floor(pos.z/16)
minetest.chat_send_all("Fixing: " .. px .. " " .. py .. " " .. pz)
minetest.fix_light({["x"]=px, ["y"]=py, ["z"]=pz})
return true, "Done."
end
minetest.register_chatcommand("fixlight", {
params = "[<x> <y> <z>]",
description = "",
func = fix,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.