add {no_silktouch=1} group for crystal shovel
This commit is contained in:
parent
0d4633babf
commit
9622f58f26
4
api.txt
4
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.
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user