aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorClobberXD <ClobberXD@gmail.com>2018-07-09 23:41:35 +0530
committerParamat <paramat@users.noreply.github.com>2018-07-09 19:11:35 +0100
commit498078bfa09c19d42390161bc1b8b8c03b7b2956 (patch)
tree4f7917a4d2824be084e0421e9aeeef24af38ed64 /builtin
parenta61e1a4dbce39ced7a1da599d87dfcb876613109 (diff)
downloadminetest-498078bfa09c19d42390161bc1b8b8c03b7b2956.tar.gz
minetest-498078bfa09c19d42390161bc1b8b8c03b7b2956.tar.bz2
minetest-498078bfa09c19d42390161bc1b8b8c03b7b2956.zip
Builtin/../misc.lua: Replace minetest. with core., improve codestyle (#7540)
Diffstat (limited to 'builtin')
-rw-r--r--builtin/game/misc.lua22
1 files changed, 12 insertions, 10 deletions
diff --git a/builtin/game/misc.lua b/builtin/game/misc.lua
index 1d60f1958..472cb2107 100644
--- a/builtin/game/misc.lua
+++ b/builtin/game/misc.lua
@@ -44,7 +44,7 @@ local player_list = {}
function core.send_join_message(player_name)
- if not minetest.is_singleplayer() then
+ if not core.is_singleplayer() then
core.chat_send_all("*** " .. player_name .. " joined the game.")
end
end
@@ -99,8 +99,8 @@ function core.is_player(player)
end
-function minetest.player_exists(name)
- return minetest.get_auth_handler().get_auth(name) ~= nil
+function core.player_exists(name)
+ return core.get_auth_handler().get_auth(name) ~= nil
end
@@ -126,17 +126,19 @@ end
function core.hash_node_position(pos)
- return (pos.z+32768)*65536*65536 + (pos.y+32768)*65536 + pos.x+32768
+ return (pos.z + 32768) * 65536 * 65536
+ + (pos.y + 32768) * 65536
+ + pos.x + 32768
end
function core.get_position_from_hash(hash)
local pos = {}
- pos.x = (hash%65536) - 32768
- hash = math.floor(hash/65536)
- pos.y = (hash%65536) - 32768
- hash = math.floor(hash/65536)
- pos.z = (hash%65536) - 32768
+ pos.x = (hash % 65536) - 32768
+ hash = math.floor(hash / 65536)
+ pos.y = (hash % 65536) - 32768
+ hash = math.floor(hash / 65536)
+ pos.z = (hash % 65536) - 32768
return pos
end
@@ -261,7 +263,7 @@ end
function core.close_formspec(player_name, formname)
- return minetest.show_formspec(player_name, formname, "")
+ return core.show_formspec(player_name, formname, "")
end