Remove /fixlight (is now part of Minetest builtin)
This commit is contained in:
parent
11aaf85b7c
commit
d18d442d6e
@ -30,10 +30,6 @@ default_privs = interact, player_skin, shout, spawn, zoom
|
|||||||
give_initial_enable = false
|
give_initial_enable = false
|
||||||
give_initial_items = default:pick_stone,default:torch_weak 10
|
give_initial_items = default:pick_stone,default:torch_weak 10
|
||||||
|
|
||||||
# If players with interact can use the /fixlight chat command
|
|
||||||
|
|
||||||
fixlight_command_enable = false
|
|
||||||
|
|
||||||
# If you can name chests when the sign is below the chest; may cause problems
|
# If you can name chests when the sign is below the chest; may cause problems
|
||||||
|
|
||||||
signs_allow_name_above = false
|
signs_allow_name_above = false
|
||||||
|
@ -42,44 +42,6 @@ function util.fixlight(pos1, pos2)
|
|||||||
return #nodes
|
return #nodes
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.settings:get_bool("fixlight_command_enable") then
|
|
||||||
minetest.register_privilege(
|
|
||||||
"fixlight",
|
|
||||||
{
|
|
||||||
description = "Can use /fixlight command",
|
|
||||||
give_to_singleplayer = false
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_chatcommand(
|
|
||||||
"fixlight",
|
|
||||||
{
|
|
||||||
params = "[radius 1-20]",
|
|
||||||
description = "Fix light in a radius around you",
|
|
||||||
privs = {fixlight = true},
|
|
||||||
func = function(name, param)
|
|
||||||
local rad = tonumber(param)
|
|
||||||
|
|
||||||
if rad == nil or (rad < 1 or rad > 20) then
|
|
||||||
return false, "Bad param for /fixlight; type /help fixlight"
|
|
||||||
end
|
|
||||||
|
|
||||||
local player = minetest.get_player_by_name(name)
|
|
||||||
|
|
||||||
local pos = player:get_pos()
|
|
||||||
pos.x = math.floor(pos.x + 0.5)
|
|
||||||
pos.y = math.floor(pos.y + 0.5)
|
|
||||||
pos.z = math.floor(pos.z + 0.5)
|
|
||||||
|
|
||||||
local minp = {x = pos.x - rad, y = pos.y - rad, z = pos.z - rad}
|
|
||||||
local maxp = {x = pos.x + rad, y = pos.y + rad, z = pos.z + rad}
|
|
||||||
|
|
||||||
util.fixlight(minp, maxp)
|
|
||||||
|
|
||||||
minetest.chat_send_all("*** " .. name .. " has fixed light in a " .. rad .. "m radius at (" .. pos.x .. ", " .. pos.y .. ", " .. pos.z .. ")")
|
|
||||||
end
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
function util.nodefunc(pos1, pos2, name, func, nomanip)
|
function util.nodefunc(pos1, pos2, name, func, nomanip)
|
||||||
-- function based off fixlight
|
-- function based off fixlight
|
||||||
-- call a function for every node of a single type
|
-- call a function for every node of a single type
|
||||||
|
Loading…
Reference in New Issue
Block a user