mirror of
https://codeberg.org/tenplus1/teleport_potion.git
synced 2025-03-15 06:01:24 +00: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
|
@ -7,6 +7,7 @@ https://forum.minetest.net/viewtopic.php?f=9&t=9234
|
|||
|
||||
Change log:
|
||||
|
||||
- 0.9 - Update to newer functions, requires Minetest 0.4.16 to work.
|
||||
- 0.8 - Teleport pads now have arrows showing direction player will face after use
|
||||
- 0.7 - Can now enter descriptions for teleport pads e.g. (0,12,0,Home)
|
||||
- 0.6 - Tweaked and tidied code, added map_generation_limit's
|
||||
|
|
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
Reference in a new issue