Merge pull request #67 from AntumDeluge/settings

Replace deprecated methods
This commit is contained in:
orwell96 2017-06-08 10:52:36 +02:00 committed by GitHub
commit d78450bb7c
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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