change minetest. to core.
This commit is contained in:
parent
c923871739
commit
d294ddbda1
7 changed files with 234 additions and 234 deletions
16
hud.lua
16
hud.lua
|
|
@ -1,19 +1,19 @@
|
|||
|
||||
-- translation and protector radius
|
||||
|
||||
local S = minetest.get_translator("protector")
|
||||
local S = core.get_translator("protector")
|
||||
local radius = protector.radius
|
||||
|
||||
-- hud settings
|
||||
|
||||
local hud = {}
|
||||
local hud_timer = 0
|
||||
local hud_interval = (tonumber(minetest.settings:get("protector_hud_interval")) or 4)
|
||||
local hud_style = minetest.has_feature("hud_def_type_field")
|
||||
local hud_interval = (tonumber(core.settings:get("protector_hud_interval")) or 4)
|
||||
local hud_style = core.has_feature("hud_def_type_field")
|
||||
|
||||
if hud_interval > 0 then
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
core.register_globalstep(function(dtime)
|
||||
|
||||
hud_timer = hud_timer + dtime
|
||||
|
||||
|
|
@ -21,13 +21,13 @@ minetest.register_globalstep(function(dtime)
|
|||
|
||||
hud_timer = 0
|
||||
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
for _, player in pairs(core.get_connected_players()) do
|
||||
|
||||
local name = player:get_player_name()
|
||||
local pos = vector.round(player:get_pos())
|
||||
local hud_text = ""
|
||||
|
||||
local protectors = minetest.find_nodes_in_area(
|
||||
local protectors = core.find_nodes_in_area(
|
||||
{x = pos.x - radius , y = pos.y - radius , z = pos.z - radius},
|
||||
{x = pos.x + radius , y = pos.y + radius , z = pos.z + radius},
|
||||
{"protector:protect","protector:protect2", "protector:protect_hidden"})
|
||||
|
|
@ -35,7 +35,7 @@ minetest.register_globalstep(function(dtime)
|
|||
if #protectors > 0 then
|
||||
|
||||
local npos = protectors[1]
|
||||
local meta = minetest.get_meta(npos)
|
||||
local meta = core.get_meta(npos)
|
||||
local nodeowner = meta:get_string("owner")
|
||||
local members = meta:get_string("members"):split(" ")
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ minetest.register_globalstep(function(dtime)
|
|||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
core.register_on_leaveplayer(function(player)
|
||||
hud[player:get_player_name()] = nil
|
||||
end)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue