forked from VoxeLibre/VoxeLibre
Add server privs restriction to mcl_villages build tool
This commit is contained in:
parent
4b63ff1c2a
commit
bc366f615c
|
@ -128,6 +128,12 @@ if minetest.is_creative_enabled("") then
|
|||
-- build ssettlement
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.under then return end
|
||||
local name = placer:get_player_name()
|
||||
local privs = minetest.get_player_privs(name)
|
||||
if not privs.server then
|
||||
minetest.chat_send_player(name, "Placement denied. You need the “server” privilege to place villages.")
|
||||
return itemstack
|
||||
end
|
||||
local minp = vector.subtract( pointed_thing.under, half_map_chunk_size)
|
||||
local maxp = vector.add( pointed_thing.under, half_map_chunk_size)
|
||||
build_a_settlement(minp, maxp, math.random(0,32767))
|
||||
|
|
Loading…
Reference in New Issue