Add fixlight. Fix bucket of gold regression.

This commit is contained in:
Duane 2016-06-27 23:53:31 -05:00
parent 95c3acbe11
commit 09017179fc
2 changed files with 37 additions and 0 deletions

View file

@ -32,3 +32,31 @@ minetest.register_chatcommand("setspawn", {
minetest.chat_send_player(name, 'Your spawn position has been changed.')
end,
})
minetest.register_chatcommand("fixlight", {
params = "<radius>",
description = "attempt to fix light bugs",
privs = {},
func = function(name, param)
local privs = minetest.check_player_privs(name, {server=true})
if not privs then
return
end
print('Fun Caves: '..name..' used the fixlight command')
local player = minetest.get_player_by_name(name)
local pos = vector.round(player:getpos())
local radius = tonumber(param) or 50
radius = math.floor(radius)
local minp = vector.subtract(pos, radius)
local maxp = vector.add(pos, radius)
local vm = minetest.get_voxel_manip(minp, maxp)
--vm:set_lighting({day = 0, night = 0}, minp, maxp)
vm:calc_lighting(minp, maxp)
vm:update_liquids()
vm:write_to_map()
vm:update_map()
end,
})