summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorJP Guerrero <jeanpatrick.guerrero@gmail.com>2016-12-13 17:30:43 +0100
committerJP Guerrero <jeanpatrick.guerrero@gmail.com>2016-12-13 17:38:44 +0100
commita74de97c876d064d024f716e9d5e41c70b800ded (patch)
tree8e650edc689e80165027f16b89b9a60b17fd01b3 /init.lua
parent99f2fc1b50c9f3ee7063b2648afd8173a2813c61 (diff)
Make craftguide's book burnable
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua10
1 files changed, 8 insertions, 2 deletions
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")