Created
April 16, 2017 18:31
-
-
Save juhdanad/8d52aed02fcfd9d59c0364dc786d45c4 to your computer and use it in GitHub Desktop.
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
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