From 9622f58f261e966a870c55619c145ce07bda1b9e Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sat, 5 Nov 2022 15:24:02 +0000 Subject: [PATCH] add {no_silktouch=1} group for crystal shovel --- api.txt | 4 ++++ crystal.lua | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api.txt b/api.txt index 059da3c..5b1c96b 100644 --- a/api.txt +++ b/api.txt @@ -31,3 +31,7 @@ You may also use a table that not only adds an item but the biome it can be foun Please note that only Ethereal biome names can be used for specific finds, unless mod specifically adds ethereal as an optional dependency. + + +Crystal Shovel has silk touch ability for digging blocks and returning the actual block +intact. The {no_silktouch=1} group can be used to override this. diff --git a/crystal.lua b/crystal.lua index bb7cbeb..ee38867 100644 --- a/crystal.lua +++ b/crystal.lua @@ -225,7 +225,7 @@ minetest.register_craft({ }) --- dig override for crystal shovel's soft touch ability +-- dig override for crystal shovel's silk touch ability local old_handle_node_drops = minetest.handle_node_drops function minetest.handle_node_drops(pos, drops, digger) @@ -238,14 +238,14 @@ function minetest.handle_node_drops(pos, drops, digger) local nn = minetest.get_node(pos).name - if minetest.get_item_group(nn, "crumbly") == 0 then + if minetest.get_item_group(nn, "crumbly") == 0 + or minetest.get_item_group(nn, "no_silktouch") == 1 then return old_handle_node_drops(pos, drops, digger) end return old_handle_node_drops(pos, {ItemStack(nn)}, digger) end - minetest.register_tool("ethereal:shovel_crystal", { description = S("Crystal Shovel"), inventory_image = "ethereal_crystal_shovel.png",