From 8ef6ba3c0ffdeb47c20d7610680a1be152588827 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Wed, 4 Sep 2019 18:30:49 +0200 Subject: [PATCH] Do not drop items when a Node Breaker digs a node --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index d05726d..25145b1 100644 --- a/init.lua +++ b/init.lua @@ -373,7 +373,13 @@ and not minetest.settings:get_bool("creative_mode") then end end - function minetest.handle_node_drops(pos, drops) + local old_handle_node_drops = minetest.handle_node_drops + function minetest.handle_node_drops(pos, drops, player) + if player.is_fake_player then + -- Node Breaker or similar machines should receive items in the + -- inventory + return old_handle_node_drops(pos, drops, player) + end for i = 1,#drops do local item = drops[i] if type(item) == "string" then