aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-06-08 10:52:36 +0200
committerGitHub <noreply@github.com>2017-06-08 10:52:36 +0200
commitd78450bb7ca6e0a7c32bb5e8cadb60c9e99e860b (patch)
tree943f530bc97cfdba24b16c802d2cfca47553fd88
parentb0580176b47affaab7a43c6e7058b250b8f25784 (diff)
parent7db4a5f039648b7f06bd8c9598f1fe84a873f6e4 (diff)
downloadadvtrains-d78450bb7ca6e0a7c32bb5e8cadb60c9e99e860b.tar.gz
advtrains-d78450bb7ca6e0a7c32bb5e8cadb60c9e99e860b.tar.bz2
advtrains-d78450bb7ca6e0a7c32bb5e8cadb60c9e99e860b.zip
Merge pull request #67 from AntumDeluge/settings
Replace deprecated methods
-rw-r--r--advtrains/advtrains/trackplacer.lua2
-rw-r--r--advtrains/advtrains/tracks.lua4
-rw-r--r--advtrains/advtrains/trainlogic.lua4
-rw-r--r--advtrains/advtrains/wagons.lua4
4 files changed, 7 insertions, 7 deletions
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