Add fixlight. Fix bucket of gold regression.
This commit is contained in:
parent
95c3acbe11
commit
09017179fc
2 changed files with 37 additions and 0 deletions
28
chat.lua
28
chat.lua
|
@ -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,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue