diff options
author | Lord89James <neftali_dtctv@hotmail.com> | 2013-03-11 13:36:04 +0100 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-07-02 00:33:31 +0000 |
commit | 90b095aa54b5a96b1100966adc0f083e9cb5409d (patch) | |
tree | 47f6abd8903ea60f75e480851836e6e2b0275186 /builtin | |
parent | 4bbb78a99b5d2a8446a1946eb44df01b618de4cc (diff) | |
download | minetest-90b095aa54b5a96b1100966adc0f083e9cb5409d.tar.gz minetest-90b095aa54b5a96b1100966adc0f083e9cb5409d.tar.bz2 minetest-90b095aa54b5a96b1100966adc0f083e9cb5409d.zip |
Infinite tools in creative mode
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/item.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/builtin/item.lua b/builtin/item.lua index 85b4cc0e4..799e46f73 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -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 - 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) + 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) |