From c33c1bb1fa459bdd455e60b43ed0f08598f4520e Mon Sep 17 00:00:00 2001
From: Peter Nerlich <peter.nerlich+dev@googlemail.com>
Date: Fri, 27 Nov 2020 13:40:41 +0100
Subject: [PATCH] improve salad pick to break on use without destroying any
 blocks

---
 additional_stuff/salad_pickaxe.lua | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/additional_stuff/salad_pickaxe.lua b/additional_stuff/salad_pickaxe.lua
index 928e515..c001b84 100644
--- a/additional_stuff/salad_pickaxe.lua
+++ b/additional_stuff/salad_pickaxe.lua
@@ -1,22 +1,19 @@
 
-local break_immediately = {times = {[3] = 0.01}, uses = 1, leveldiff = 0, maxlevel = 0}
-
 minetest.register_tool("kif_custom:pick_salad", {
-	description = "Pickaxe from questionable quality",
+	description = "Pickaxe of questionable quality",
 	inventory_image = "kif_custom_tool_picksalad.png",
-	tool_capabilities = {
-		max_drop_level = 0,
-		groupcaps = {
-			crumbly = break_immediately,
-			cracky = break_immediately,
-			snappy = break_immediately,
-			choppy = break_immediately,
-			fleshy = break_immediately,
-			explody = break_immediately,
-			oddly_breakable_by_hand = break_immediately,
-		},
-	},
+	stack_max = 1,
 	sound = {breaks = "kif_custom_salad_splotch"},
+	on_use = function(itemstack, user, pointed_thing)
+		if user ~= nil then
+			minetest.sound_play({
+				name = "kif_custom_salad_splotch",
+			}, {
+				object = user
+			})
+		end
+		return ItemStack()
+	end
 })
 
 minetest.register_craft({
-- 
GitLab