From 7db4a5f039648b7f06bd8c9598f1fe84a873f6e4 Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Wed, 7 Jun 2017 03:53:52 -0700 Subject: Replace deprecated methods: - 'setting_get' with 'settings:get' - 'setting_getbool' with 'settings:get_bool' --- advtrains/advtrains/trackplacer.lua | 2 +- advtrains/advtrains/tracks.lua | 4 ++-- advtrains/advtrains/trainlogic.lua | 4 ++-- advtrains/advtrains/wagons.lua | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'advtrains') diff --git a/advtrains/advtrains/trackplacer.lua b/advtrains/advtrains/trackplacer.lua index 4c82db8..e94b4ff 100644 --- a/advtrains/advtrains/trackplacer.lua +++ b/advtrains/advtrains/trackplacer.lua @@ -202,7 +202,7 @@ function tp.register_track_placer(nnprefix, imgprefix, dispname) if minetest.registered_nodes[minetest.get_node(pos).name] and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to and minetest.registered_nodes[minetest.get_node(upos).name] and minetest.registered_nodes[minetest.get_node(upos).name].walkable then tp.placetrack(pos, nnprefix, placer, itemstack, pointed_thing) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end end diff --git a/advtrains/advtrains/tracks.lua b/advtrains/advtrains/tracks.lua index 5738abb..d63e5c8 100644 --- a/advtrains/advtrains/tracks.lua +++ b/advtrains/advtrains/tracks.lua @@ -534,12 +534,12 @@ function sl.create_slopeplacer_on_place(def, preset) if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to or advtrains.is_protected(pos, player:get_player_name()) then --do slopes of this distance exist? if lookup[step] then - if minetest.setting_getbool("creative_mode") or istack:get_count()>=step then + if minetest.settings:get_bool("creative_mode") or istack:get_count()>=step then --start placing local placenodes=lookup[step] while step>0 do minetest.set_node(pos, {name=def.nodename_prefix.."_"..placenodes[step], param2=param2}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then istack:take_item() end step=step-1 diff --git a/advtrains/advtrains/trainlogic.lua b/advtrains/advtrains/trainlogic.lua index 26ee780..483ea52 100644 --- a/advtrains/advtrains/trainlogic.lua +++ b/advtrains/advtrains/trainlogic.lua @@ -463,7 +463,7 @@ function advtrains.train_step_a(id, train, dtime) --check for any trainpart entities if they have been unloaded. do this only if train is near a player, to not spawn entities into unloaded areas train.check_trainpartload=(train.check_trainpartload or 0)-dtime - local node_range=(math.max((minetest.setting_get("active_block_range") or 0),1)*16) + local node_range=(math.max((minetest.settings:get("active_block_range") or 0),1)*16) if train.check_trainpartload<=0 then local ori_pos=train_pos --see 3a. --atprint("[train "..id.."] at "..minetest.pos_to_string(vector.round(ori_pos))) @@ -576,7 +576,7 @@ function advtrains.train_step_b(id, train, dtime) advtrains.collide_and_spawn_couple(id, testpos, advtrains.detector.on_node[testpts], train.movedir==-1) end --- 8b damage players --- - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then local player=advtrains.playersbypts[testpts] if player and train.velocity>3 then --instantly kill player diff --git a/advtrains/advtrains/wagons.lua b/advtrains/advtrains/wagons.lua index 3cb34a7..f1964ef 100644 --- a/advtrains/advtrains/wagons.lua +++ b/advtrains/advtrains/wagons.lua @@ -159,7 +159,7 @@ function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direct return end - if minetest.setting_getbool("creative_mode") then + if minetest.settings:get_bool("creative_mode") then if not self:destroy() then return end local inv = puncher:get_inventory() @@ -882,7 +882,7 @@ function advtrains.register_wagon(sysname, prototype, desc, inv_img) local wagon_uid=le:init_new_instance(id, {}) advtrains.add_wagon_to_train(le, id) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end return itemstack -- cgit v1.2.3