Replace deprecated function calls
This commit is contained in:
parent
35b9535e87
commit
03e277e917
@ -11,7 +11,7 @@ areas.hud = {}
|
|||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
for _, player in pairs(minetest.get_connected_players()) do
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local pos = vector.round(player:getpos())
|
local pos = vector.round(player:get_pos())
|
||||||
local areaStrings = {}
|
local areaStrings = {}
|
||||||
for id, area in pairs(areas:getAreasAtPos(pos)) do
|
for id, area in pairs(areas:getAreasAtPos(pos)) do
|
||||||
table.insert(areaStrings, (S("You are here: %s"))
|
table.insert(areaStrings, (S("You are here: %s"))
|
||||||
|
@ -15,7 +15,7 @@ dofile(areas.modpath.."/hud.lua")
|
|||||||
|
|
||||||
areas:load()
|
areas:load()
|
||||||
|
|
||||||
if minetest.setting_getbool("log_mod") then
|
if minetest.settings:get_bool("log_mod") then
|
||||||
local diffTime = os.clock() - areas.startTime
|
local diffTime = os.clock() - areas.startTime
|
||||||
minetest.log("action", "Modified areas mod loaded in "..diffTime.."s.")
|
minetest.log("action", "Modified areas mod loaded in "..diffTime.."s.")
|
||||||
end
|
end
|
||||||
|
@ -24,7 +24,7 @@ creative.init_creative_inventory = function(player)
|
|||||||
|
|
||||||
local inv = minetest.create_detached_inventory("creative_" .. player_name, {
|
local inv = minetest.create_detached_inventory("creative_" .. player_name, {
|
||||||
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||||
if minetest.setting_getbool("creative_mode") then
|
if minetest.settings:get_bool("creative_mode") then
|
||||||
return count
|
return count
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@ -34,7 +34,7 @@ creative.init_creative_inventory = function(player)
|
|||||||
return 0
|
return 0
|
||||||
end,
|
end,
|
||||||
allow_take = function(inv, listname, index, stack, player)
|
allow_take = function(inv, listname, index, stack, player)
|
||||||
if minetest.setting_getbool("creative_mode") then
|
if minetest.settings:get_bool("creative_mode") then
|
||||||
return -1
|
return -1
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@ -94,7 +94,7 @@ local trash = minetest.create_detached_inventory("creative_trash", {
|
|||||||
-- Allow the stack to be placed and remove it in on_put()
|
-- Allow the stack to be placed and remove it in on_put()
|
||||||
-- This allows the creative inventory to restore the stack
|
-- This allows the creative inventory to restore the stack
|
||||||
allow_put = function(inv, listname, index, stack, player)
|
allow_put = function(inv, listname, index, stack, player)
|
||||||
if minetest.setting_getbool("creative_mode") then
|
if minetest.settings:get_bool("creative_mode") then
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@ -160,7 +160,7 @@ end
|
|||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
-- If in creative mode, modify player's inventory forms
|
-- If in creative mode, modify player's inventory forms
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
creative.init_creative_inventory(player)
|
creative.init_creative_inventory(player)
|
||||||
@ -168,7 +168,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
if formname ~= "" or not minetest.setting_getbool("creative_mode") then
|
if formname ~= "" or not minetest.settings:get_bool("creative_mode") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if minetest.setting_getbool("creative_mode") then
|
if minetest.settings:get_bool("creative_mode") then
|
||||||
local digtime1 = 0
|
local digtime1 = 0
|
||||||
local digtime2 = digtime1
|
local digtime2 = digtime1
|
||||||
local digtime3 = digtime1
|
local digtime3 = digtime1
|
||||||
|
@ -146,7 +146,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
|
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
|
||||||
|
|
||||||
-- set GUI
|
-- set GUI
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
player:set_inventory_formspec(default.gui_suvival_form)
|
player:set_inventory_formspec(default.gui_suvival_form)
|
||||||
end
|
end
|
||||||
player:hud_set_hotbar_image("gui_hotbar.png")
|
player:hud_set_hotbar_image("gui_hotbar.png")
|
||||||
|
@ -13,7 +13,7 @@ local MP = minetest.get_modpath("intllib")
|
|||||||
dofile(MP.."/lib.lua")
|
dofile(MP.."/lib.lua")
|
||||||
|
|
||||||
|
|
||||||
local LANG = minetest.setting_get("language")
|
local LANG = minetest.settings:get("language")
|
||||||
if not (LANG and (LANG ~= "")) then LANG = os.getenv("LANG") end
|
if not (LANG and (LANG ~= "")) then LANG = os.getenv("LANG") end
|
||||||
if not (LANG and (LANG ~= "")) then LANG = "en" end
|
if not (LANG and (LANG ~= "")) then LANG = "en" end
|
||||||
|
|
||||||
|
@ -1356,7 +1356,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
"]"..
|
"]"..
|
||||||
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue anyways")).."]"..
|
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue anyways")).."]"..
|
||||||
"button_exit[6.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"
|
"button_exit[6.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"
|
||||||
elseif(minetest.setting_getbool("creative_mode")) then
|
elseif(minetest.settings:get_bool("creative_mode")) then
|
||||||
formspec = "size[12,6]"..
|
formspec = "size[12,6]"..
|
||||||
"label[-0.15,-0.4;"..(minetest.formspec_escape(S("Warning: Creative mode is active"))).."]"..
|
"label[-0.15,-0.4;"..(minetest.formspec_escape(S("Warning: Creative mode is active"))).."]"..
|
||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
@ -1379,8 +1379,8 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
tutorial.state.intro_text = true
|
tutorial.state.intro_text = true
|
||||||
end
|
end
|
||||||
if tutorial.state.first_join==true and tutorial.first_spawn then
|
if tutorial.state.first_join==true and tutorial.first_spawn then
|
||||||
player:setpos(tutorial.first_spawn.pos)
|
player:set_pos(tutorial.first_spawn.pos)
|
||||||
player:set_look_yaw(tutorial.first_spawn.yaw)
|
player:set_look_horizontal(tutorial.first_spawn.yaw)
|
||||||
tutorial.state.first_join = false
|
tutorial.state.first_join = false
|
||||||
end
|
end
|
||||||
tutorial.save_state()
|
tutorial.save_state()
|
||||||
@ -1444,7 +1444,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
for p=1,#players do
|
for p=1,#players do
|
||||||
local player = players[p]
|
local player = players[p]
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if(player:getpos().y < -12 and (not minetest.setting_getbool("creative_mode"))) then
|
if(player:get_pos().y < -12 and (not minetest.settings:get_bool("creative_mode"))) then
|
||||||
-- teleport players back to the start when they fell away
|
-- teleport players back to the start when they fell away
|
||||||
tutorial.back_to_start(player)
|
tutorial.back_to_start(player)
|
||||||
tutorial.show_default_dialog(name, S("You fell from the castle!"), tutorial.texts.fallout)
|
tutorial.show_default_dialog(name, S("You fell from the castle!"), tutorial.texts.fallout)
|
||||||
@ -1529,7 +1529,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
function tutorial.teleport(player, pos, look_horizontal, look_vertical)
|
function tutorial.teleport(player, pos, look_horizontal, look_vertical)
|
||||||
player:setpos(pos)
|
player:set_pos(pos)
|
||||||
player:set_look_horizontal(look_horizontal)
|
player:set_look_horizontal(look_horizontal)
|
||||||
if not look_vertical then
|
if not look_vertical then
|
||||||
look_vertical = 0
|
look_vertical = 0
|
||||||
|
@ -386,9 +386,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_mapgen_init(function(mgparams)
|
minetest.set_mapgen_setting("mg_name", "singlenode")
|
||||||
minetest.set_mapgen_params({mgname="singlenode", water_level=-31000, chunksize=(tutorial.sector_size/16)})
|
minetest.set_mapgen_setting("water_level", "-31000")
|
||||||
end)
|
minetest.set_mapgen_setting("chunksize", tostring(tutorial.sector_size/16))
|
||||||
|
|
||||||
-- coordinates for the first time the player spawns
|
-- coordinates for the first time the player spawns
|
||||||
tutorial.first_spawn = { pos={x=42,y=0.5,z=28}, yaw=(math.pi * 0.5) }
|
tutorial.first_spawn = { pos={x=42,y=0.5,z=28}, yaw=(math.pi * 0.5) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user