From a74de97c876d064d024f716e9d5e41c70b800ded Mon Sep 17 00:00:00 2001
From: JP Guerrero <jeanpatrick.guerrero@gmail.com>
Date: Tue, 13 Dec 2016 17:30:43 +0100
Subject: Make craftguide's book burnable

---
 init.lua | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'init.lua')

diff --git a/init.lua b/init.lua
index e451f31..d5c687e 100644
--- a/init.lua
+++ b/init.lua
@@ -1,6 +1,6 @@
 local craftguide, datas = {}, {}
 local progressive_mode = minetest.setting_getbool("craftguide_progressive_mode")
-local min, max, ceil, floor = math.min, math.max, math.ceil, math.floor
+local min, max, ceil = math.min, math.max, math.ceil
 local iX, iY = (minetest.setting_get("craftguide_size") or "8x3"):match(
 		"([%d]+)[.%d+]*[^%d]*x[^%d]*([%d]+)[.%d+]*")
 iX, iY = max(8, iX or 8), max(1, iY or 3)
@@ -262,7 +262,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
 		craftguide:get_formspec(player_name)
 	else for item in pairs(fields) do
 		if not item:find(":") then return end
-		item = item:sub(-4) == "_inv" and item:sub(1,-5) or item
+		if item:sub(-4) == "_inv" then item = item:sub(1,-5) end
 
 		if progressive_mode then
 			local _, player_has_item =
@@ -303,5 +303,11 @@ minetest.register_craft({
 	recipe = {"default:book"}
 })
 
+minetest.register_craft({
+	type = "fuel",
+	recipe = "craftguide:book",
+	burntime = 3
+})
+
 minetest.register_alias("xdecor:crafting_guide", "craftguide:book")
 
-- 
cgit v1.2.3