mirror of
https://codeberg.org/tenplus1/teleport_potion.git
synced 2025-07-16 03:06:44 -04:00
updated to use 0.4.16 functions
This commit is contained in:
parent
8b624d57dd
commit
5877bed0de
2 changed files with 8 additions and 2 deletions
9
init.lua
9
init.lua
|
@ -11,8 +11,13 @@ local S, NS = dofile(MP.."/intllib.lua")
|
|||
|
||||
|
||||
-- max teleport distance
|
||||
local dist = tonumber(minetest.setting_get("map_generation_limit") or 31000)
|
||||
local dist = tonumber(minetest.settings:get("map_generation_limit") or 31000)
|
||||
|
||||
-- creative check
|
||||
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
||||
function is_creative(name)
|
||||
return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
|
||||
end
|
||||
|
||||
local check_coordinates = function(str)
|
||||
|
||||
|
@ -143,7 +148,7 @@ minetest.register_node("teleport_potion:potion", {
|
|||
|
||||
throw_potion(itemstack, user)
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not is_creative(user:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue