in skyblock player can only protect areas above his island ( if not admin)
This commit is contained in:
parent
4413ce64f6
commit
8f2cb95196
4
init.lua
4
init.lua
@ -155,14 +155,14 @@ basic_protect.protect_new = function(p,name)
|
||||
if skyblock and skyblock.players and skyblock.get_island_pos then
|
||||
local skyid = skyblock.players[name].id;
|
||||
local skypos = skyblock.get_island_pos(skyid);
|
||||
local dist = math.max(math.abs(p.x-skypos.x),math.abs(p.y-skypos.y),math.abs(p.z-skypos.z));
|
||||
local dist = math.max(math.abs(p.x-skypos.x),math.abs(p.z-skypos.z));
|
||||
if dist>skyblock.islands_gap then
|
||||
local privs = minetest.get_player_privs(name);
|
||||
if not privs.kick then
|
||||
local meta = minetest.get_meta(skypos);
|
||||
local mstring = meta:get_string("infotext");
|
||||
if string.find(mstring,"ISLAND") then -- tried to protect other island
|
||||
minetest.chat_send_player(name, "#PROTECTOR: you can only protect empty space or your island")
|
||||
minetest.chat_send_player(name, "#PROTECTOR: you can only protect empty space or your island or above it")
|
||||
minetest.set_node(p,{name = "air"}) -- clear protector
|
||||
return
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user