From 649fca5aff6829c2dfface024eb20e6471132daa Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 21 Feb 2017 03:00:48 +0100 Subject: [PATCH] Add mcl_util.is_fuel --- mods/CORE/mcl_util/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 64ecd7303e..52f9caf64f 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -188,3 +188,9 @@ function mcl_util.get_first_occupied_inventory_slot(inventory, listname) end return nil end + +-- Returns true if item (itemstring or ItemStack) can be used as a furnace fuel. +-- Returns false otherwise +function mcl_util.is_fuel(item) + return minetest.get_craft_result({method="fuel", width=1, items={item}}).time ~= 0 +end