From 7d9855765298670197f802611d4a7b3aa577a6d7 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sat, 19 Jun 2021 22:12:00 +0100 Subject: [PATCH] add special pick drop --- blocks.lua | 53 +++++++++++++++++++++++++++++++++++ textures/lucky_void_pick.png | Bin 0 -> 153 bytes 2 files changed, 53 insertions(+) create mode 100644 textures/lucky_void_pick.png diff --git a/blocks.lua b/blocks.lua index eef0075..1f98ad2 100644 --- a/blocks.lua +++ b/blocks.lua @@ -812,3 +812,56 @@ lucky_block:add_blocks({ {"cus", fake_items, {tex = "default_gold_ingot.png", txt = "ingots"} }, {"cus", fake_items, {tex = "default_mese_crystal.png", txt = "crystals"} }, }) + +-- Void Pick +local old_handle_node_drops = minetest.handle_node_drops + +function minetest.handle_node_drops(pos, drops, digger) + + -- are we holding Crystal Shovel? + if not digger + or digger:get_wielded_item():get_name() ~= "lucky_block:pick_void" then + return old_handle_node_drops(pos, drops, digger) + end + + local nn = minetest.get_node(pos).name + + if minetest.get_item_group(nn, "cracky") == 0 then + return old_handle_node_drops(pos, drops, digger) + end + + return old_handle_node_drops(pos, {ItemStack(nn)}, digger) +end + + +minetest.register_tool("lucky_block:pick_void", { + description = "Void pick", + inventory_image = "lucky_void_pick.png", + wield_image = "lucky_void_pick.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.2, + max_drop_level = 3, + groupcaps = { + cracky = { + times = {[1] = 2.4, [2] = 1.2, [3] = 0.60}, + uses = 20, + maxlevel = 3 + } + }, + damage_groups = {fleshy = 5}, + }, + groups = {pickaxe = 1}, + sound = {breaks = "default_tool_breaks"} +}) + +lucky_block:add_blocks({ + {"nod", "default:chest", 0, { + {name = "lucky_block:pick_void", max = 1, chance = 7}, + {name = "default:stone_with_coal", max = 5}, + {name = "default:stone_with_iron", max = 5}, + {name = "default:stone_with_copper", max = 5}, + {name = "default:stone_with_mese", max = 5}, + {name = "default:stone_with_gold", max = 5}, + {name = "default:stone_with_diamond", max = 5}, + }} +}) diff --git a/textures/lucky_void_pick.png b/textures/lucky_void_pick.png new file mode 100644 index 0000000000000000000000000000000000000000..066c7a146c78a17dd8111f37ea20c40d578d1443 GIT binary patch literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|u0UE{T|FW+G;_`A{Xh<5 zNswPKgTu2MX+Vyhr;B3<$Mxg{hUQT2h9g&2u(7eNUCHUNOsj)o^D