Infinite tools in creative mode

experimental
Lord89James 2013-03-11 13:36:04 +01:00 committed by PilzAdam
parent 4bbb78a99b
commit 90b095aa54
1 changed files with 6 additions and 4 deletions

View File

@ -330,10 +330,12 @@ function minetest.node_dig(pos, node, digger)
local drops = minetest.get_node_drops(node.name, wielded:get_name())
-- Wear out tool
if not minetest.setting_getbool("creative_mode") then
local tp = wielded:get_tool_capabilities()
local dp = minetest.get_dig_params(def.groups, tp)
wielded:add_wear(dp.wear)
digger:set_wielded_item(wielded)
end
-- Handle drops
minetest.handle_node_drops(pos, drops, digger)