From 1b76a91d6bce530cf3407ab75f559a358518321b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 1 Feb 2017 16:31:27 +0100 Subject: [PATCH] Move flint and steel to fire mod --- mods/mcl_core/crafting.lua | 6 ---- mods/mcl_core/tools.lua | 27 --------------- mods/mcl_fire/depends.txt | 1 + mods/mcl_fire/flint_and_steel.lua | 32 ++++++++++++++++++ mods/mcl_fire/init.lua | 4 +-- .../textures/mcl_fire_flint_and_steel.png} | Bin 6 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 mods/mcl_fire/depends.txt create mode 100644 mods/mcl_fire/flint_and_steel.lua rename mods/{mcl_core/textures/default_tool_flint_and_steel.png => mcl_fire/textures/mcl_fire_flint_and_steel.png} (100%) diff --git a/mods/mcl_core/crafting.lua b/mods/mcl_core/crafting.lua index 0e703c5a..65d39f9b 100644 --- a/mods/mcl_core/crafting.lua +++ b/mods/mcl_core/crafting.lua @@ -401,12 +401,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - type = 'shapeless', - output = 'mcl_core:flint_and_steel', - recipe = { 'mcl_core:steel_ingot', 'mcl_core:flint'}, -}) - minetest.register_craft({ output = 'mcl_core:shears', recipe = { diff --git a/mods/mcl_core/tools.lua b/mods/mcl_core/tools.lua index 7ea3f71f..545ea4dc 100644 --- a/mods/mcl_core/tools.lua +++ b/mods/mcl_core/tools.lua @@ -312,33 +312,6 @@ minetest.register_tool("mcl_core:sword_diamond", { } }) --- Flint and Steel -minetest.register_tool("mcl_core:flint_and_steel", { - description = "Flint and Steel", - inventory_image = "default_tool_flint_and_steel.png", - liquids_pointable = false, - stack_max = 1, - groups = { tool = 1 }, - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=0, - groupcaps={ - flamable = {uses=65, maxlevel=1}, - } - }, - on_use = function(itemstack, user, pointed_thing) - if pointed_thing.type == "node" then - if minetest.get_node(pointed_thing.under).name == "mcl_tnt:tnt" then - tnt.ignite(pointed_thing.under) - else - mcl_core.set_fire(pointed_thing) - itemstack:add_wear(66000/65) -- 65 uses - return itemstack - end - end - end, -}) - --Shears minetest.register_tool("mcl_core:shears", { description = "Shears", diff --git a/mods/mcl_fire/depends.txt b/mods/mcl_fire/depends.txt new file mode 100644 index 00000000..315237e0 --- /dev/null +++ b/mods/mcl_fire/depends.txt @@ -0,0 +1 @@ +mcl_core diff --git a/mods/mcl_fire/flint_and_steel.lua b/mods/mcl_fire/flint_and_steel.lua new file mode 100644 index 00000000..5b8d94ed --- /dev/null +++ b/mods/mcl_fire/flint_and_steel.lua @@ -0,0 +1,32 @@ +-- Flint and Steel +minetest.register_tool("mcl_fire:flint_and_steel", { + description = "Flint and Steel", + inventory_image = "mcl_fire_flint_and_steel.png", + liquids_pointable = false, + stack_max = 1, + groups = { tool = 1 }, + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=0, + groupcaps={ + flamable = {uses=65, maxlevel=1}, + } + }, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type == "node" then + if minetest.get_node(pointed_thing.under).name == "mcl_tnt:tnt" then + tnt.ignite(pointed_thing.under) + else + mcl_core.set_fire(pointed_thing) + itemstack:add_wear(66000/65) -- 65 uses + return itemstack + end + end + end, +}) + +minetest.register_craft({ + type = 'shapeless', + output = 'mcl_core:flint_and_steel', + recipe = { 'mcl_core:steel_ingot', 'mcl_core:flint'}, +}) diff --git a/mods/mcl_fire/init.lua b/mods/mcl_fire/init.lua index 86027a57..e461e7d6 100644 --- a/mods/mcl_fire/init.lua +++ b/mods/mcl_fire/init.lua @@ -191,7 +191,7 @@ minetest.register_abm({ end, }) +dofile(minetest.get_modpath(minetest.get_current_modname()).."/flint_and_steel.lua") + local time_to_load= os.clock() - init print(string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load)) - - diff --git a/mods/mcl_core/textures/default_tool_flint_and_steel.png b/mods/mcl_fire/textures/mcl_fire_flint_and_steel.png similarity index 100% rename from mods/mcl_core/textures/default_tool_flint_and_steel.png rename to mods/mcl_fire/textures/mcl_fire_flint_and_steel.png