summaryrefslogtreecommitdiff
path: root/areas/hud.lua
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2019-04-02 18:04:55 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2019-04-02 18:04:55 -0400
commit4ebefe20c921e5ec80f7e95c6f332bf550c92006 (patch)
tree648e84a224ccf1c0dadeb00ce5183db410949219 /areas/hud.lua
parent8555f75acc050f29508d88f1e57159f79cb948d1 (diff)
downloaddreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.tar
dreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.tar.gz
dreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.tar.bz2
dreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.tar.xz
dreambuilder_modpack-4ebefe20c921e5ec80f7e95c6f332bf550c92006.zip
updated areas (now using the minetest-mods repo), farming redo,
moreblocks, and moreores
Diffstat (limited to 'areas/hud.lua')
-rw-r--r--areas/hud.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/areas/hud.lua b/areas/hud.lua
index 0b7931f..b29152d 100644
--- a/areas/hud.lua
+++ b/areas/hud.lua
@@ -1,11 +1,23 @@
-- This is inspired by the landrush mod by Bremaweb
areas.hud = {}
+areas.hud.refresh = 0
minetest.register_globalstep(function(dtime)
+
+ areas.hud.refresh = areas.hud.refresh + dtime
+ if areas.hud.refresh > areas.config["tick"] then
+ areas.hud.refresh = 0
+ else
+ return
+ end
+
for _, player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local pos = vector.round(player:getpos())
+ pos = vector.apply(pos, function(p)
+ return math.max(math.min(p, 2147483), -2147483)
+ end)
local areaStrings = {}
for id, area in pairs(areas:getAreasAtPos(pos)) do