1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-28 04:40:22 +02:00

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

@ -1998,8 +1998,7 @@ minetest.register_node("default:sand_with_kelp", {
not minetest.is_protected(pos_top, player_name) then
minetest.set_node(pos, {name = "default:sand_with_kelp",
param2 = height * 16})
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name)) then
if not minetest.is_creative_enabled(player_name) then
itemstack:take_item()
end
else
@ -2054,7 +2053,7 @@ local function coral_on_place(itemstack, placer, pointed_thing)
node_under.name = itemstack:get_name()
minetest.set_node(pos_under, node_under)
if not (creative and creative.is_enabled_for(player_name)) then
if not minetest.is_creative_enabled(player_name) then
itemstack:take_item()
end

View File

@ -575,8 +575,7 @@ function default.sapling_on_place(itemstack, placer, pointed_thing,
minetest.log("action", player_name .. " places node "
.. sapling_name .. " at " .. minetest.pos_to_string(pos))
local take_item = not (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name))
local take_item = not minetest.is_creative_enabled(player_name)
local newnode = {name = sapling_name}
local ndef = minetest.registered_nodes[sapling_name]
minetest.set_node(pos, newnode)