forked from VoxeLibre/VoxeLibre
Use minetest check priv api, add translation & remove itemstack from return
This commit is contained in:
parent
bc366f615c
commit
d61de5c59c
|
@ -128,11 +128,9 @@ if minetest.is_creative_enabled("") then
|
||||||
-- build ssettlement
|
-- build ssettlement
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
if not pointed_thing.under then return end
|
if not pointed_thing.under then return end
|
||||||
local name = placer:get_player_name()
|
if not minetest.check_player_privs(placer, "server") then
|
||||||
local privs = minetest.get_player_privs(name)
|
minetest.chat_send_player(placer:get_player_name(), S("Placement denied. You need the “server” privilege to place villages."))
|
||||||
if not privs.server then
|
return
|
||||||
minetest.chat_send_player(name, "Placement denied. You need the “server” privilege to place villages.")
|
|
||||||
return itemstack
|
|
||||||
end
|
end
|
||||||
local minp = vector.subtract( pointed_thing.under, half_map_chunk_size)
|
local minp = vector.subtract( pointed_thing.under, half_map_chunk_size)
|
||||||
local maxp = vector.add( pointed_thing.under, half_map_chunk_size)
|
local maxp = vector.add( pointed_thing.under, half_map_chunk_size)
|
||||||
|
|
Loading…
Reference in New Issue