Use Minetest 5.3 'minetest.is_creative_enabled' API (#2795)

This commit is contained in:
Maksim
2020-12-13 18:59:19 +01:00
committed by GitHub
parent 9c29019301
commit e6aec880de
19 changed files with 34 additions and 65 deletions

View File

@ -191,7 +191,6 @@ local function is_all_empty(player_inv)
end
minetest.register_on_dieplayer(function(player)
local bones_mode = minetest.settings:get("bones_mode") or "bones"
if bones_mode ~= "bones" and bones_mode ~= "drop" and bones_mode ~= "keep" then
bones_mode = "bones"
@ -203,8 +202,7 @@ minetest.register_on_dieplayer(function(player)
local pos_string = minetest.pos_to_string(pos)
-- return if keep inventory set or in creative mode
if bones_mode == "keep" or (creative and creative.is_enabled_for
and creative.is_enabled_for(player:get_player_name())) then
if bones_mode == "keep" or minetest.is_creative_enabled(player_name) then
minetest.log("action", player_name .. " dies at " .. pos_string ..
". No bones placed")
if bones_position_message then