mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 12:33:43 +01:00
Make craftguide's book burnable
This commit is contained in:
parent
99f2fc1b50
commit
a74de97c87
10
init.lua
10
init.lua
@ -1,6 +1,6 @@
|
|||||||
local craftguide, datas = {}, {}
|
local craftguide, datas = {}, {}
|
||||||
local progressive_mode = minetest.setting_getbool("craftguide_progressive_mode")
|
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(
|
local iX, iY = (minetest.setting_get("craftguide_size") or "8x3"):match(
|
||||||
"([%d]+)[.%d+]*[^%d]*x[^%d]*([%d]+)[.%d+]*")
|
"([%d]+)[.%d+]*[^%d]*x[^%d]*([%d]+)[.%d+]*")
|
||||||
iX, iY = max(8, iX or 8), max(1, iY or 3)
|
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)
|
craftguide:get_formspec(player_name)
|
||||||
else for item in pairs(fields) do
|
else for item in pairs(fields) do
|
||||||
if not item:find(":") then return end
|
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
|
if progressive_mode then
|
||||||
local _, player_has_item =
|
local _, player_has_item =
|
||||||
@ -303,5 +303,11 @@ minetest.register_craft({
|
|||||||
recipe = {"default:book"}
|
recipe = {"default:book"}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "craftguide:book",
|
||||||
|
burntime = 3
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_alias("xdecor:crafting_guide", "craftguide:book")
|
minetest.register_alias("xdecor:crafting_guide", "craftguide:book")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user