aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rudin <thomas@rudin.io>2018-12-07 10:21:00 +0100
committerorwell96 <mono96.mml@gmail.com>2018-12-10 17:16:23 +0100
commit8024f43e35ea169f1439decadd2c16bc51386a34 (patch)
treebbbda706da8dc83588bfb4b9822dd54610de6c99
parente7488abf583faee0cd458ef2b3e6a89a101a8acf (diff)
downloadposhud-8024f43e35ea169f1439decadd2c16bc51386a34.zip
poshud-8024f43e35ea169f1439decadd2c16bc51386a34.tar.gz
poshud-8024f43e35ea169f1439decadd2c16bc51386a34.tar.bz2
show mapblock coordinates
-rw-r--r--init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 6d64c7c..87f056b 100644
--- a/init.lua
+++ b/init.lua
@@ -172,6 +172,10 @@ minetest.register_globalstep(function (dtime)
for _,player in ipairs(minetest.get_connected_players()) do
local posi = player:get_pos()
local posistr = math.floor(posi.x+0.5).." "..math.floor(posi.y+0.5).." "..math.floor(posi.z+0.5)
- updatehud(player, h_text.."\nPos: "..posistr)
+ local mapblockstr = math.floor(posi.x / 16) .. " "
+ .. math.floor(posi.y / 16) .. " "
+ .. math.floor(posi.z / 16)
+
+ updatehud(player, h_text .. "\nPos: " .. posistr .. "\nMapblock: " .. mapblockstr)
end
end);