Don't drop items when digging in Creative Mode

This commit is contained in:
Wuzzy 2017-05-23 19:32:20 +02:00
parent e36486f980
commit 5834224af5
1 changed files with 15 additions and 18 deletions

View File

@ -127,9 +127,8 @@ minetest.register_globalstep(function(dtime)
end)
function minetest.handle_node_drops(pos, drops, digger)
local inv
if minetest.setting_getbool("creative_mode") and digger and digger:is_player() then
inv = digger:get_inventory()
if minetest.setting_getbool("creative_mode") then
return
end
for _,item in ipairs(drops) do
local count, name
@ -140,7 +139,6 @@ function minetest.handle_node_drops(pos, drops, digger)
count = item:get_count()
name = item:get_name()
end
if not inv or not inv:contains_item("main", ItemStack(name)) then
for i=1,count do
local obj = minetest.add_item(pos, name)
if obj ~= nil then
@ -158,7 +156,6 @@ function minetest.handle_node_drops(pos, drops, digger)
end
end
end
end
end
if item_drop_settings.drop_single_item then