1
0
Fork 0

Add server privs restriction to mcl_villages build tool

This commit is contained in:
Eliy21 2023-12-02 14:14:15 +00:00
parent 4b63ff1c2a
commit bc366f615c
1 changed files with 6 additions and 0 deletions

View File

@ -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))