Use new Minetest settings API syntax for most mods

This commit is contained in:
Wuzzy 2017-08-09 16:17:00 +02:00
parent 6fa426741e
commit e5a34367c9
41 changed files with 86 additions and 86 deletions

View file

@ -98,7 +98,7 @@ local function init(player)
local playername = player:get_player_name()
local inv = minetest.create_detached_inventory("creative_"..playername, {
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
else
return 0
@ -108,7 +108,7 @@ local function init(player)
return 0
end,
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
else
return 0
@ -121,7 +121,7 @@ end
-- Create the trash field
local trash = minetest.create_detached_inventory("trash", {
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()
else
return 0
@ -363,7 +363,7 @@ end
minetest.register_on_player_receive_fields(function(player, formname, fields)
local page = nil
if not minetest.setting_getbool("creative_mode") then
if not minetest.settings:get_bool("creative_mode") then
return
end
if formname ~= "" or fields.quit == "true" then
@ -479,7 +479,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end)
if minetest.setting_getbool("creative_mode") then
if minetest.settings:get_bool("creative_mode") then
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
-- Place infinite nodes, except for shulker boxes
local group = minetest.get_item_group(itemstack:get_name(), "shulker_box")