From 0db7730c456c56549a4b88e1880cee7fe134f3f5 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Fri, 4 Mar 2016 16:41:47 +0000 Subject: [PATCH] Added lava pick --- README.txt | 1 + lava_flan.lua | 73 ++++++++++++++++++++++++++++++++++++ textures/mobs_pick_lava.png | Bin 0 -> 197 bytes 3 files changed, 74 insertions(+) create mode 100644 textures/mobs_pick_lava.png diff --git a/README.txt b/README.txt index 68bc5b5..a743783 100644 --- a/README.txt +++ b/README.txt @@ -28,6 +28,7 @@ This mod contains the following additions: Changelog: +1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function. 1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :) 1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak. 1.24- Added feature where certain animals run away when punched (runaway = true in mob definition) diff --git a/lava_flan.lua b/lava_flan.lua index 461af50..baa8504 100644 --- a/lava_flan.lua +++ b/lava_flan.lua @@ -63,3 +63,76 @@ minetest.register_craftitem("mobs:lava_orb", { }) minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb") + +minetest.register_craft({ + type = "fuel", + recipe = "mobs:lava_orb", + burntime = 80, +}) + +-- Lava Pick (digs and smelts at same time) + +local old_handle_node_drops = minetest.handle_node_drops + +function minetest.handle_node_drops(pos, drops, digger) + + -- are we holding Lava Pick? + if digger:get_wielded_item():get_name() ~= ("mobs:pick_lava") then + return old_handle_node_drops(pos, drops, digger) + end + + -- reset new smelted drops + local hot_drops = {} + + -- loop through current node drops + for _, drop in pairs(drops) do + + -- get cooked output of current drops + local stack = ItemStack(drop) + local output = minetest.get_craft_result({ + method = "cooking", + width = 1, + items = {drop} + }) + + -- if we have cooked result then add to new list + if output + and output.item + and not output.item:is_empty() then + + table.insert(hot_drops, + ItemStack({ + name = output.item:get_name(), + count = stack:get_count() + }) + ) + + else -- if not then return normal drops + table.insert(hot_drops, stack) + end + end + + return old_handle_node_drops(pos, hot_drops, digger) +end + +minetest.register_tool("mobs:pick_lava", { + description = "Lava Pickaxe", + inventory_image = "mobs_pick_lava.png", + tool_capabilities = { + full_punch_interval = 0.4, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=1.80, [2]=0.90, [3]=0.45}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=6}, + }, +}) + +minetest.register_craft({ + output = "mobs:pick_lava", + recipe = { + {"mobs:lava_orb", "mobs:lava_orb", "mobs:lava_orb"}, + {"", "default:obsidian_shard", ""}, + {"", "default:obsidian_shard", ""}, + } +}) diff --git a/textures/mobs_pick_lava.png b/textures/mobs_pick_lava.png new file mode 100644 index 0000000000000000000000000000000000000000..ec8f1605696dc7b2fe5feeeb7f6420d341499800 GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^4e$wZ%`eIo5D@5KV31cc)Uoir zqObpbweUyBH|jtIj3q&S!3+-1ZlnP@oCO|{#S9GG!XV7ZFl&wkP|(xU#W95AdUC=6 zwkcCY4wytoL`>oeQ8^>1bLc>h7)#)hHxkPjgc1w{!-5+)3>+lXm;~4Y7!EOTHHb8^ mN-WTlkPvFPA?S6Ofx%dY{W$N<)rLSr89ZJ6T-G@yGywohf-=Ye literal 0 HcmV?d00001