Fixes and cleanup
parent
3be52a686d
commit
f519c0bb06
|
@ -1,4 +1,4 @@
|
||||||
unused_args = false
|
max_line_length = 100
|
||||||
|
|
||||||
read_globals = {
|
read_globals = {
|
||||||
"DIR_DELIM",
|
"DIR_DELIM",
|
||||||
|
@ -20,3 +20,5 @@ globals = {
|
||||||
-- mod namespace
|
-- mod namespace
|
||||||
"areas"
|
"areas"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ignore = {"212/self"}
|
||||||
|
|
4
api.lua
4
api.lua
|
@ -35,7 +35,7 @@ function areas:getAreasAtPos(pos)
|
||||||
|
|
||||||
if self.store then
|
if self.store then
|
||||||
local a = self.store:get_areas_for_pos(pos, false, true)
|
local a = self.store:get_areas_for_pos(pos, false, true)
|
||||||
for store_id, store_area in pairs(a) do
|
for _, store_area in pairs(a) do
|
||||||
local id = tonumber(store_area.data)
|
local id = tonumber(store_area.data)
|
||||||
res[id] = self.areas[id]
|
res[id] = self.areas[id]
|
||||||
end
|
end
|
||||||
|
@ -60,7 +60,7 @@ function areas:getAreasIntersectingArea(pos1, pos2)
|
||||||
if self.store then
|
if self.store then
|
||||||
local a = self.store:get_areas_in_area(pos1, pos2,
|
local a = self.store:get_areas_in_area(pos1, pos2,
|
||||||
true, false, true)
|
true, false, true)
|
||||||
for store_id, store_area in pairs(a) do
|
for _, store_area in pairs(a) do
|
||||||
local id = tonumber(store_area.data)
|
local id = tonumber(store_area.data)
|
||||||
res[id] = self.areas[id]
|
res[id] = self.areas[id]
|
||||||
end
|
end
|
||||||
|
|
|
@ -74,7 +74,7 @@ minetest.register_chatcommand("set_owner", {
|
||||||
|
|
||||||
minetest.register_chatcommand("add_owner", {
|
minetest.register_chatcommand("add_owner", {
|
||||||
params = S("<ParentID>").." "..S("<PlayerName>").." "..S("<AreaName>"),
|
params = S("<ParentID>").." "..S("<PlayerName>").." "..S("<AreaName>"),
|
||||||
description = S("Give a player access to a sub-area beetween two"
|
description = S("Give a player access to a sub-area between two"
|
||||||
.." positions that have already been protected,"
|
.." positions that have already been protected,"
|
||||||
.." Use set_owner if you don't want the parent to be set."),
|
.." Use set_owner if you don't want the parent to be set."),
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -146,7 +146,7 @@ minetest.register_chatcommand("find_areas", {
|
||||||
params = "<regexp>",
|
params = "<regexp>",
|
||||||
description = S("Find areas using a Lua regular expression"),
|
description = S("Find areas using a Lua regular expression"),
|
||||||
privs = areas.adminPrivs,
|
privs = areas.adminPrivs,
|
||||||
func = function(name, param)
|
func = function(_, param)
|
||||||
if param == "" then
|
if param == "" then
|
||||||
return false, S("A regular expression is required.")
|
return false, S("A regular expression is required.")
|
||||||
end
|
end
|
||||||
|
@ -160,7 +160,7 @@ minetest.register_chatcommand("find_areas", {
|
||||||
end
|
end
|
||||||
|
|
||||||
local matches = {}
|
local matches = {}
|
||||||
for id, area in pairs(areas.areas) do
|
for id in pairs(areas.areas) do
|
||||||
local str = areas:toString(id)
|
local str = areas:toString(id)
|
||||||
if str:find(param) then
|
if str:find(param) then
|
||||||
table.insert(matches, str)
|
table.insert(matches, str)
|
||||||
|
@ -181,22 +181,21 @@ minetest.register_chatcommand("find_areas", {
|
||||||
|
|
||||||
|
|
||||||
minetest.register_chatcommand("list_areas", {
|
minetest.register_chatcommand("list_areas", {
|
||||||
description = S("List your areas, or all areas if you are an admin."),
|
description = S("List your areas"),
|
||||||
func = function(name, param)
|
func = function(name)
|
||||||
minetest.log("warning", "/list_areas invoked, owner = " .. name ..
|
|
||||||
" AreaName = " .. param)
|
|
||||||
|
|
||||||
local admin = minetest.check_player_privs(name, areas.adminPrivs)
|
|
||||||
local areaStrings = {}
|
local areaStrings = {}
|
||||||
for id, area in pairs(areas.areas) do
|
for id in pairs(areas.areas) do
|
||||||
if admin or areas:isAreaOwner(id, name) then
|
if areas:isAreaOwner(id, name) then
|
||||||
table.insert(areaStrings, areas:toString(id))
|
table.insert(areaStrings, areas:toString(id))
|
||||||
|
if #areaStrings > 50 then
|
||||||
|
minetest.chat_send_player(name, S("Too many areas to list all."))
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if #areaStrings == 0 then
|
if #areaStrings == 0 then
|
||||||
return true, S("No visible areas.")
|
return false, S("No visible areas.")
|
||||||
elseif #areaStrings > 100 then
|
|
||||||
return true, S("Too many areas to list.")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return true, table.concat(areaStrings, "\n")
|
return true, table.concat(areaStrings, "\n")
|
||||||
|
@ -332,7 +331,7 @@ minetest.register_chatcommand("move_area", {
|
||||||
|
|
||||||
minetest.register_chatcommand("area_info", {
|
minetest.register_chatcommand("area_info", {
|
||||||
description = S("Get information about area configuration and usage."),
|
description = S("Get information about area configuration and usage."),
|
||||||
func = function(name, param)
|
func = function(name)
|
||||||
local lines = {}
|
local lines = {}
|
||||||
local privs = minetest.get_player_privs(name)
|
local privs = minetest.get_player_privs(name)
|
||||||
|
|
||||||
|
@ -373,7 +372,7 @@ minetest.register_chatcommand("area_info", {
|
||||||
|
|
||||||
-- Area count
|
-- Area count
|
||||||
local area_num = 0
|
local area_num = 0
|
||||||
for id, area in pairs(areas.areas) do
|
for _, area in pairs(areas.areas) do
|
||||||
if area.owner == name then
|
if area.owner == name then
|
||||||
area_num = area_num + 1
|
area_num = area_num + 1
|
||||||
end
|
end
|
||||||
|
@ -418,11 +417,8 @@ minetest.register_chatcommand("areas_cleanup", {
|
||||||
func = function()
|
func = function()
|
||||||
local total, count = 0, 0
|
local total, count = 0, 0
|
||||||
|
|
||||||
local aareas = areas.areas
|
for id, area in pairs(areas.areas) do
|
||||||
for id, _ in pairs(aareas) do
|
if not areas:player_exists(area.owner) then
|
||||||
local owner = aareas[id].owner
|
|
||||||
|
|
||||||
if not areas:player_exists(owner) then
|
|
||||||
areas:remove(id)
|
areas:remove(id)
|
||||||
count = count + 1
|
count = count + 1
|
||||||
end
|
end
|
||||||
|
@ -454,7 +450,7 @@ minetest.register_chatcommand("area_pvp", {
|
||||||
description = "Toggle PvP in an area",
|
description = "Toggle PvP in an area",
|
||||||
params = "<ID>",
|
params = "<ID>",
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local id = tonumber(param)
|
local id = tonumber(param)
|
||||||
if not id then
|
if not id then
|
||||||
return false, S("Invalid usage, see /help @1.", "area_pvp")
|
return false, S("Invalid usage, see /help @1.", "area_pvp")
|
||||||
end
|
end
|
||||||
|
@ -470,7 +466,7 @@ minetest.register_chatcommand("area_pvp", {
|
||||||
local players = {}
|
local players = {}
|
||||||
for _, info in pairs(player_list()) do
|
for _, info in pairs(player_list()) do
|
||||||
local inAreas = areas:getAreasAtPos(info.pos)
|
local inAreas = areas:getAreasAtPos(info.pos)
|
||||||
for areaid, area in pairs(inAreas) do
|
for areaid in pairs(inAreas) do
|
||||||
if name ~= info.name and id == areaid then
|
if name ~= info.name and id == areaid then
|
||||||
players[#players + 1] = info.name
|
players[#players + 1] = info.name
|
||||||
end
|
end
|
||||||
|
|
42
interact.lua
42
interact.lua
|
@ -3,38 +3,6 @@ local S = areas.S
|
||||||
local enable_damage = minetest.settings:get_bool("enable_damage")
|
local enable_damage = minetest.settings:get_bool("enable_damage")
|
||||||
|
|
||||||
local old_is_protected = minetest.is_protected
|
local old_is_protected = minetest.is_protected
|
||||||
|
|
||||||
local disallowed = {
|
|
||||||
["^[A-Za-z]+[0-9][0-9][0-9]"] = "You play using an unofficial client. Your actions are limited. "..
|
|
||||||
"Download \"MultiCraft ― Build and Mine!\" on Google Play / App Store to play ad-free!"
|
|
||||||
}
|
|
||||||
|
|
||||||
local function old_version(name)
|
|
||||||
local info = minetest.get_player_information(name)
|
|
||||||
if info and info.version_string and info.version_string < "0.4.16" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Disable some actions for Guests
|
|
||||||
function minetest.is_protected_action(pos, name)
|
|
||||||
for r, reason in pairs(disallowed) do
|
|
||||||
if name:lower():find(r) then
|
|
||||||
if old_version(name) then
|
|
||||||
minetest.chat_send_player(name, reason)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not areas:canInteract(pos, name) then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return old_is_protected(pos, name)
|
|
||||||
end
|
|
||||||
|
|
||||||
--==--
|
|
||||||
|
|
||||||
function minetest.is_protected(pos, name)
|
function minetest.is_protected(pos, name)
|
||||||
if not areas:canInteract(pos, name) then
|
if not areas:canInteract(pos, name) then
|
||||||
return true
|
return true
|
||||||
|
@ -81,9 +49,11 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local player_name = hitter:get_player_name()
|
||||||
|
|
||||||
-- It is possible to use cheats
|
-- It is possible to use cheats
|
||||||
if time_from_last_punch < 0.25 then
|
if time_from_last_punch < 0.25 then
|
||||||
minetest.chat_send_player(hitter:get_player_name(), S("Wow, wow, take it easy!"))
|
minetest.chat_send_player(player_name, S("Wow, wow, take it easy!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -95,7 +65,7 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
-- Do any of the areas have allowed PvP?
|
-- Do any of the areas have allowed PvP?
|
||||||
for id, area in pairs(hitterAreas) do
|
for _, area in pairs(hitterAreas) do
|
||||||
if area.canPvP then
|
if area.canPvP then
|
||||||
hitterInPvP = true
|
hitterInPvP = true
|
||||||
break
|
break
|
||||||
|
@ -110,7 +80,7 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
-- Do any of the areas have allowed PvP?
|
-- Do any of the areas have allowed PvP?
|
||||||
for id, area in pairs(victimAreas) do
|
for _, area in pairs(victimAreas) do
|
||||||
if area.canPvP then
|
if area.canPvP then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
@ -118,6 +88,6 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Otherwise, it doesn't do damage
|
-- Otherwise, it doesn't do damage
|
||||||
minetest.chat_send_player(hitter:get_player_name(), S("PvP is not allowed in this area!"))
|
minetest.chat_send_player(player_name, S("PvP is not allowed in this area!"))
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -24,15 +24,16 @@ Change the owner of an area using its ID=Сменить владельца зо
|
||||||
Find areas using a Lua regular expression=Найти области с помощью регулярного выражения Lua
|
Find areas using a Lua regular expression=Найти области с помощью регулярного выражения Lua
|
||||||
Get information about area configuration and usage.=Получите информацию о конфигурации и использовании зоны.
|
Get information about area configuration and usage.=Получите информацию о конфигурации и использовании зоны.
|
||||||
|
|
||||||
Give a player access to a sub-area beetween two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Предоставьте игроку доступ к подобласти между двумя позициями, которые уже были защищены, Используйте set_owner, если вы не хотите, чтобы родитель был установлен.
|
Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Предоставьте игроку доступ к подобласти между двумя позициями, которые уже были защищены, Используйте set_owner, если вы не хотите, чтобы родитель был установлен.
|
||||||
|
|
||||||
Invalid regular expression.=Неверное регулярное выражение.
|
Invalid regular expression.=Неверное регулярное выражение.
|
||||||
Limit: @1 areas=Лимит: @1 зон
|
Limit: @1 areas=Лимит: @1 зон
|
||||||
Limit: no area count limit=Лимит: нет ограничения по количеству зон
|
Limit: no area count limit=Лимит: нет ограничения по количеству зон
|
||||||
List your areas, or all areas if you are an admin.=Список ваших зон, или всех зон, если вы admin.
|
List your areas=Список ваших зон
|
||||||
Move (or resize) an area to the current positions.=Переместить (или изменить размер) зоны до текущего положения.
|
Move (or resize) an area to the current positions.=Переместить (или изменить размер) зоны до текущего положения.
|
||||||
No matches found.=Совпадения не найдены.
|
No matches found.=Совпадения не найдены.
|
||||||
No visible areas.=Нет видимых зон.
|
No visible areas.=Нет видимых зон.
|
||||||
|
Too many areas to list all!=Слишком много зон, чтобы показать все.
|
||||||
Owner changed.=Владелец изменён.
|
Owner changed.=Владелец изменён.
|
||||||
Players with the "@1" privilege can protect up to @2 areas=Игроки с привилегией "@1" могут защитить до @2 областей
|
Players with the "@1" privilege can protect up to @2 areas=Игроки с привилегией "@1" могут защитить до @2 областей
|
||||||
|
|
||||||
|
|
|
@ -24,15 +24,16 @@ Change the owner of an area using its ID=
|
||||||
Find areas using a Lua regular expression=
|
Find areas using a Lua regular expression=
|
||||||
Get information about area configuration and usage.=
|
Get information about area configuration and usage.=
|
||||||
|
|
||||||
Give a player access to a sub-area beetween two positions that have already been protected, Use set_owner if you don't want the parent to be set.=
|
Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=
|
||||||
|
|
||||||
Invalid regular expression.=
|
Invalid regular expression.=
|
||||||
Limit: @1 areas=
|
Limit: @1 areas=
|
||||||
Limit: no area count limit=
|
Limit: no area count limit=
|
||||||
List your areas, or all areas if you are an admin.=
|
List your areas=
|
||||||
Move (or resize) an area to the current positions.=
|
Move (or resize) an area to the current positions.=
|
||||||
No matches found.=
|
No matches found.=
|
||||||
No visible areas.=
|
No visible areas.=
|
||||||
|
Too many areas to list all!=
|
||||||
Owner changed.=
|
Owner changed.=
|
||||||
Players with the "@1" privilege can protect up to @2 areas=
|
Players with the "@1" privilege can protect up to @2 areas=
|
||||||
|
|
||||||
|
|
6
pos.lua
6
pos.lua
|
@ -151,7 +151,7 @@ function areas:setPos2(playerName, pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_punchnode(function(pos, node, puncher)
|
minetest.register_on_punchnode(function(pos, _, puncher)
|
||||||
local name = puncher:get_player_name()
|
local name = puncher:get_player_name()
|
||||||
-- Currently setting position
|
-- Currently setting position
|
||||||
if name ~= "" and areas.set_pos[name] then
|
if name ~= "" and areas.set_pos[name] then
|
||||||
|
@ -231,7 +231,7 @@ minetest.register_entity("areas:pos1", {
|
||||||
"areas_pos1.png", "areas_pos1.png"},
|
"areas_pos1.png", "areas_pos1.png"},
|
||||||
collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
|
collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
|
||||||
},
|
},
|
||||||
on_step = function(self, dtime)
|
on_step = function(self)
|
||||||
if self.active == nil then
|
if self.active == nil then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
@ -252,7 +252,7 @@ minetest.register_entity("areas:pos2", {
|
||||||
"areas_pos2.png", "areas_pos2.png"},
|
"areas_pos2.png", "areas_pos2.png"},
|
||||||
collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
|
collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
|
||||||
},
|
},
|
||||||
on_step = function(self, dtime)
|
on_step = function(self)
|
||||||
if self.active == nil then
|
if self.active == nil then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,19 +23,22 @@ minetest.register_node("areas:protector", {
|
||||||
groups = {cracky = 1, not_cuttable = 1},
|
groups = {cracky = 1, not_cuttable = 1},
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
|
|
||||||
on_place = function(itemstack, player, pointed)
|
on_place = function(itemstack, player, pointed_thing)
|
||||||
local pos = pointed.above
|
local pos = pointed_thing.above
|
||||||
local pos1 = vadd(pos, vnew(radius, radius, radius))
|
|
||||||
local pos2 = vadd(pos, vnew(-radius, -radius, -radius))
|
|
||||||
local name = player and player:get_player_name()
|
local name = player and player:get_player_name()
|
||||||
|
|
||||||
if name and not minetest.is_protected(pos, name) then
|
if not name or not minetest.is_protected(pos, name) then
|
||||||
|
local pos1 = vadd(pos, vnew(radius, radius, radius))
|
||||||
|
local pos2 = vadd(pos, vnew(-radius, -radius, -radius))
|
||||||
local perm, err = areas:canPlayerAddArea(pos1, pos2, name)
|
local perm, err = areas:canPlayerAddArea(pos1, pos2, name)
|
||||||
|
|
||||||
if not perm then
|
if not perm then
|
||||||
minetest.chat_send_player(name, red(S("You are not allowed to protect that area: @1", err)))
|
minetest.chat_send_player(name,
|
||||||
|
red(S("You are not allowed to protect that area: @1", err)))
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
if minetest.find_node_near(pos, 4, {"areas:protector"}) then
|
|
||||||
|
if minetest.find_node_near(pos, radius / 2, {"areas:protector"}) then
|
||||||
minetest.chat_send_player(name, red(S("You have already protected this area.")))
|
minetest.chat_send_player(name, red(S("You have already protected this area.")))
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
@ -43,16 +46,19 @@ minetest.register_node("areas:protector", {
|
||||||
local id = areas:add(name, S("Protector Block"), pos1, pos2)
|
local id = areas:add(name, S("Protector Block"), pos1, pos2)
|
||||||
areas:save()
|
areas:save()
|
||||||
minetest.chat_send_player(name,
|
minetest.chat_send_player(name,
|
||||||
(S("The area from @1 to @2 has been protected as ID @3",
|
S("The area from @1 to @2 has been protected as ID @3",
|
||||||
cyan(minetest.pos_to_string(pos1)), cyan(minetest.pos_to_string(pos2)), cyan(id))))
|
cyan(minetest.pos_to_string(pos1)), cyan(minetest.pos_to_string(pos2)), cyan(id))
|
||||||
|
)
|
||||||
|
|
||||||
minetest.set_node(pos, {name = "areas:protector"})
|
minetest.set_node(pos, {name = "areas:protector"})
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("infotext", S("Protected area @1, Owned by @2", id, name))
|
meta:set_string("infotext", S("Protected area @1, Owned by @2", id, name))
|
||||||
meta:set_int("area_id", id)
|
meta:set_int("area_id", id)
|
||||||
meta:set_string("owner", name)
|
meta:set_string("owner", name)
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return itemstack
|
||||||
end,
|
end,
|
||||||
|
|
||||||
after_dig_node = function(_, _, oldmetadata, digger)
|
after_dig_node = function(_, _, oldmetadata, digger)
|
||||||
|
@ -63,7 +69,7 @@ minetest.register_node("areas:protector", {
|
||||||
if areas.areas[id] and areas:isAreaOwner(id, owner) then
|
if areas.areas[id] and areas:isAreaOwner(id, owner) then
|
||||||
areas:remove(id)
|
areas:remove(id)
|
||||||
areas:save()
|
areas:save()
|
||||||
minetest.chat_send_player(name, (S("Removed area @1", cyan(id))))
|
minetest.chat_send_player(name, S("Removed area @1", cyan(id)))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -71,16 +77,14 @@ minetest.register_node("areas:protector", {
|
||||||
on_punch = function(pos)
|
on_punch = function(pos)
|
||||||
-- a radius of 0.5 since the entity serialization seems to be not that precise
|
-- a radius of 0.5 since the entity serialization seems to be not that precise
|
||||||
local objs = minetest.get_objects_inside_radius(pos, 0.5)
|
local objs = minetest.get_objects_inside_radius(pos, 0.5)
|
||||||
local displayed = false
|
for _, obj in pairs(objs) do
|
||||||
for _, o in pairs(objs) do
|
if not obj:is_player() and obj:get_luaentity().name == "areas:display" then
|
||||||
if not o:is_player() and o:get_luaentity().name == "areas:display" then
|
obj:remove()
|
||||||
o:remove()
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not displayed then -- nothing was removed: there wasn't the entity
|
|
||||||
minetest.add_entity(pos, "areas:display")
|
minetest.add_entity(pos, "areas:display")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -95,7 +99,8 @@ minetest.register_entity("areas:display", {
|
||||||
timer = 0,
|
timer = 0,
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
self.timer = self.timer + dtime
|
self.timer = self.timer + dtime
|
||||||
if self.timer > 4 or minetest.get_node(self.object:get_pos()).name ~= "areas:protector" then
|
if self.timer > 4 or
|
||||||
|
minetest.get_node(self.object:get_pos()).name ~= "areas:protector" then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -120,7 +125,7 @@ minetest.register_node("areas:display_node", {
|
||||||
-- bottom
|
-- bottom
|
||||||
{-nb_radius, -nb_radius, -nb_radius, nb_radius, -nb_radius, nb_radius},
|
{-nb_radius, -nb_radius, -nb_radius, nb_radius, -nb_radius, nb_radius},
|
||||||
-- middle (surround protector)
|
-- middle (surround protector)
|
||||||
{-.55, -.55, -.55, .55, .55, .55}
|
{-0.55, -0.55, -0.55, 0.55, 0.55, 0.55}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selection_box = {type = "regular"},
|
selection_box = {type = "regular"},
|
||||||
|
|
Loading…
Reference in New Issue