2013-05-19 18:43:04 +02:00
|
|
|
-- mods/default/craftitems.lua
|
|
|
|
|
2019-09-10 19:09:51 +02:00
|
|
|
-- support for MT game translation.
|
|
|
|
local S = default.get_translator
|
|
|
|
|
2021-09-04 23:37:27 +02:00
|
|
|
local esc = minetest.formspec_escape
|
|
|
|
local formspec_size = "size[8,8]"
|
|
|
|
|
|
|
|
local function formspec_core(tab)
|
|
|
|
if tab == nil then tab = 1 else tab = tostring(tab) end
|
|
|
|
return "tabheader[0,0;book_header;" ..
|
|
|
|
esc(S("Write")) .. "," ..
|
|
|
|
esc(S("Read")) .. ";" ..
|
|
|
|
tab .. ";false;false]"
|
|
|
|
end
|
|
|
|
|
|
|
|
local function formspec_write(title, text)
|
|
|
|
return "field[0.5,1;7.5,0;title;" .. esc(S("Title:")) .. ";" ..
|
|
|
|
esc(title) .. "]" ..
|
|
|
|
"textarea[0.5,1.5;7.5,7;text;" .. esc(S("Contents:")) .. ";" ..
|
|
|
|
esc(text) .. "]" ..
|
|
|
|
"button_exit[2.5,7.5;3,1;save;" .. esc(S("Save")) .. "]"
|
|
|
|
end
|
|
|
|
|
|
|
|
local function formspec_read(owner, title, string, text, page, page_max)
|
|
|
|
return "label[0.5,0.5;" .. esc(S("by @1", owner)) .. "]" ..
|
|
|
|
"tablecolumns[color;text]" ..
|
|
|
|
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
|
|
|
|
"table[0.4,0;7,0.5;title;#FFFF00," .. esc(title) .. "]" ..
|
|
|
|
"textarea[0.5,1.5;7.5,7;;" ..
|
|
|
|
esc(string ~= "" and string or text) .. ";]" ..
|
|
|
|
"button[2.4,7.6;0.8,0.8;book_prev;<]" ..
|
|
|
|
"label[3.2,7.7;" .. esc(S("Page @1 of @2", page, page_max)) .. "]" ..
|
|
|
|
"button[4.9,7.6;0.8,0.8;book_next;>]"
|
|
|
|
end
|
|
|
|
|
|
|
|
local function formspec_string(lpp, page, lines, string)
|
|
|
|
for i = ((lpp * page) - lpp) + 1, lpp * page do
|
|
|
|
if not lines[i] then break end
|
|
|
|
string = string .. lines[i] .. "\n"
|
|
|
|
end
|
|
|
|
return string
|
|
|
|
end
|
|
|
|
|
2022-06-01 20:54:16 +02:00
|
|
|
local book_writers = {}
|
|
|
|
|
|
|
|
minetest.register_on_leaveplayer(function(player)
|
|
|
|
book_writers[player:get_player_name()] = nil
|
|
|
|
end)
|
|
|
|
|
2021-09-04 23:37:27 +02:00
|
|
|
local tab_number
|
2016-04-10 21:29:02 +02:00
|
|
|
local lpp = 14 -- Lines per book's page
|
2016-03-16 22:01:14 +01:00
|
|
|
local function book_on_use(itemstack, user)
|
2015-01-24 16:29:55 +01:00
|
|
|
local player_name = user:get_player_name()
|
2017-02-26 19:37:35 +01:00
|
|
|
local meta = itemstack:get_meta()
|
2016-06-26 13:34:14 +02:00
|
|
|
local title, text, owner = "", "", player_name
|
2016-04-10 21:29:02 +02:00
|
|
|
local page, page_max, lines, string = 1, 1, {}, ""
|
2016-03-16 22:01:14 +01:00
|
|
|
|
2017-02-26 19:37:35 +01:00
|
|
|
-- Backwards compatibility
|
|
|
|
local old_data = minetest.deserialize(itemstack:get_metadata())
|
|
|
|
if old_data then
|
|
|
|
meta:from_table({ fields = old_data })
|
|
|
|
end
|
|
|
|
|
|
|
|
local data = meta:to_table().fields
|
|
|
|
|
|
|
|
if data.owner then
|
2021-09-04 23:37:27 +02:00
|
|
|
title = data.title or ""
|
|
|
|
text = data.text or ""
|
2016-03-16 22:01:14 +01:00
|
|
|
owner = data.owner
|
2016-03-23 19:31:25 +01:00
|
|
|
|
2016-04-10 21:29:02 +02:00
|
|
|
for str in (text .. "\n"):gmatch("([^\n]*)[\n]") do
|
|
|
|
lines[#lines+1] = str
|
|
|
|
end
|
|
|
|
|
2016-03-23 19:31:25 +01:00
|
|
|
if data.page then
|
|
|
|
page = data.page
|
|
|
|
page_max = data.page_max
|
2021-09-04 23:37:27 +02:00
|
|
|
string = formspec_string(lpp, page, lines, string)
|
2016-03-23 19:31:25 +01:00
|
|
|
end
|
2015-01-24 16:29:55 +01:00
|
|
|
end
|
2016-03-16 22:01:14 +01:00
|
|
|
|
2016-06-26 13:34:14 +02:00
|
|
|
local formspec
|
2021-09-04 23:37:27 +02:00
|
|
|
if title == "" and text == "" then
|
|
|
|
formspec = formspec_write(title, text)
|
|
|
|
elseif owner == player_name then
|
|
|
|
local tab = tab_number or 1
|
|
|
|
if tab == 2 then
|
|
|
|
formspec = formspec_core(tab) ..
|
|
|
|
formspec_read(owner, title, string, text, page, page_max)
|
|
|
|
else
|
|
|
|
formspec = formspec_core(tab) .. formspec_write(title, text)
|
|
|
|
end
|
2015-01-24 16:29:55 +01:00
|
|
|
else
|
2021-09-04 23:37:27 +02:00
|
|
|
formspec = formspec_read(owner, title, string, text, page, page_max)
|
2015-01-24 16:29:55 +01:00
|
|
|
end
|
2016-03-16 22:01:14 +01:00
|
|
|
|
2021-09-04 23:37:27 +02:00
|
|
|
minetest.show_formspec(player_name, "default:book", formspec_size .. formspec)
|
2022-06-01 20:54:16 +02:00
|
|
|
-- Store the wield index in case the user accidentally switches before the formspec is shown
|
|
|
|
book_writers[player_name] = {wield_index = user:get_wield_index()}
|
2017-03-14 06:28:03 +01:00
|
|
|
return itemstack
|
2015-01-24 16:29:55 +01:00
|
|
|
end
|
|
|
|
|
2017-06-14 19:57:05 +02:00
|
|
|
local max_text_size = 10000
|
2017-06-14 22:31:47 +02:00
|
|
|
local max_title_size = 80
|
|
|
|
local short_title_size = 35
|
2016-03-16 22:01:14 +01:00
|
|
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
2022-06-01 20:54:16 +02:00
|
|
|
if formname ~= "default:book" then
|
|
|
|
return
|
|
|
|
end
|
2021-09-04 23:37:27 +02:00
|
|
|
local player_name = player:get_player_name()
|
2015-01-24 16:29:55 +01:00
|
|
|
local inv = player:get_inventory()
|
2022-06-01 20:54:16 +02:00
|
|
|
if not book_writers[player_name] then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
local wield_index = book_writers[player_name].wield_index
|
|
|
|
local wield_list = player:get_wield_list()
|
|
|
|
local stack = inv:get_stack(wield_list, wield_index)
|
|
|
|
local written = stack:get_name() == "default:book_written"
|
|
|
|
if stack:get_name() ~= "default:book" and not written then
|
|
|
|
-- No book in the wield slot, abort & inform the player
|
|
|
|
minetest.chat_send_player(player_name, S("The book you were writing to mysteriously disappeared."))
|
|
|
|
return
|
|
|
|
end
|
2021-09-04 23:37:27 +02:00
|
|
|
local data = stack:get_meta():to_table().fields
|
|
|
|
|
|
|
|
local title = data.title or ""
|
|
|
|
local text = data.text or ""
|
|
|
|
|
|
|
|
if fields.book_header ~= nil and data.owner == player_name then
|
|
|
|
local contents
|
|
|
|
local tab = tonumber(fields.book_header)
|
|
|
|
if tab == 1 then
|
|
|
|
contents = formspec_core(tab) ..
|
|
|
|
formspec_write(title, text)
|
|
|
|
elseif tab == 2 then
|
|
|
|
local lines, string = {}, ""
|
|
|
|
for str in (text .. "\n"):gmatch("([^\n]*)[\n]") do
|
|
|
|
lines[#lines+1] = str
|
|
|
|
end
|
|
|
|
string = formspec_string(lpp, data.page, lines, string)
|
|
|
|
contents = formspec_read(player_name, title, string,
|
|
|
|
text, data.page, data.page_max)
|
|
|
|
end
|
|
|
|
tab_number = tab
|
|
|
|
local formspec = formspec_size .. formspec_core(tab) .. contents
|
|
|
|
minetest.show_formspec(player_name, "default:book", formspec)
|
|
|
|
return
|
|
|
|
end
|
2016-03-16 22:01:14 +01:00
|
|
|
|
2022-06-01 20:54:16 +02:00
|
|
|
if fields.close then
|
|
|
|
book_writers[player_name] = nil
|
|
|
|
end
|
|
|
|
|
2021-09-04 23:37:27 +02:00
|
|
|
if fields.save and fields.title and fields.text then
|
|
|
|
local new_stack
|
2022-06-01 20:54:16 +02:00
|
|
|
if not written then
|
2016-03-16 22:01:14 +01:00
|
|
|
local count = stack:get_count()
|
|
|
|
if count == 1 then
|
|
|
|
stack:set_name("default:book_written")
|
|
|
|
else
|
|
|
|
stack:set_count(count - 1)
|
|
|
|
new_stack = ItemStack("default:book_written")
|
|
|
|
end
|
2015-01-24 16:29:55 +01:00
|
|
|
end
|
2016-03-16 22:01:14 +01:00
|
|
|
|
2021-09-04 23:37:27 +02:00
|
|
|
if data.owner ~= player_name and title ~= "" and text ~= "" then
|
2017-04-26 01:15:15 +02:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2016-03-16 22:01:14 +01:00
|
|
|
if not data then data = {} end
|
2017-06-14 22:31:47 +02:00
|
|
|
data.title = fields.title:sub(1, max_title_size)
|
2017-02-26 19:37:35 +01:00
|
|
|
data.owner = player:get_player_name()
|
2017-06-14 22:31:47 +02:00
|
|
|
local short_title = data.title
|
|
|
|
-- Don't bother triming the title if the trailing dots would make it longer
|
|
|
|
if #short_title > short_title_size + 3 then
|
|
|
|
short_title = short_title:sub(1, short_title_size) .. "..."
|
|
|
|
end
|
2019-09-10 19:09:51 +02:00
|
|
|
data.description = S("\"@1\" by @2", short_title, data.owner)
|
2017-06-14 19:57:05 +02:00
|
|
|
data.text = fields.text:sub(1, max_text_size)
|
2017-10-16 04:09:26 +02:00
|
|
|
data.text = data.text:gsub("\r\n", "\n"):gsub("\r", "\n")
|
2016-03-16 22:01:14 +01:00
|
|
|
data.page = 1
|
2016-04-10 21:29:02 +02:00
|
|
|
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)
|
2016-03-16 22:01:14 +01:00
|
|
|
|
|
|
|
if new_stack then
|
2017-02-26 19:37:35 +01:00
|
|
|
new_stack:get_meta():from_table({ fields = data })
|
2016-03-16 22:01:14 +01:00
|
|
|
if inv:room_for_item("main", new_stack) then
|
|
|
|
inv:add_item("main", new_stack)
|
|
|
|
else
|
2018-07-01 21:44:03 +02:00
|
|
|
minetest.add_item(player:get_pos(), new_stack)
|
2016-03-16 22:01:14 +01:00
|
|
|
end
|
2015-01-24 16:29:55 +01:00
|
|
|
else
|
2017-02-26 19:37:35 +01:00
|
|
|
stack:get_meta():from_table({ fields = data })
|
2015-01-24 16:29:55 +01:00
|
|
|
end
|
2016-03-16 22:01:14 +01:00
|
|
|
|
|
|
|
elseif fields.book_next or fields.book_prev then
|
2021-09-04 23:37:27 +02:00
|
|
|
if not data.page then
|
2016-10-04 19:49:06 +02:00
|
|
|
return
|
|
|
|
end
|
2016-03-23 19:31:25 +01:00
|
|
|
|
2017-02-26 19:37:35 +01:00
|
|
|
data.page = tonumber(data.page)
|
|
|
|
data.page_max = tonumber(data.page_max)
|
|
|
|
|
2016-03-16 22:01:14 +01:00
|
|
|
if fields.book_next then
|
|
|
|
data.page = data.page + 1
|
|
|
|
if data.page > data.page_max then
|
|
|
|
data.page = 1
|
|
|
|
end
|
|
|
|
else
|
|
|
|
data.page = data.page - 1
|
|
|
|
if data.page == 0 then
|
|
|
|
data.page = data.page_max
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-04-29 05:56:51 +02:00
|
|
|
stack:get_meta():from_table({fields = data})
|
2017-03-14 06:28:03 +01:00
|
|
|
stack = book_on_use(stack, player)
|
2015-01-24 16:29:55 +01:00
|
|
|
end
|
2016-04-10 21:29:02 +02:00
|
|
|
|
2017-03-14 06:28:03 +01:00
|
|
|
-- Update stack
|
2022-06-01 20:54:16 +02:00
|
|
|
inv:set_stack(wield_list, wield_index, stack)
|
2015-01-24 16:29:55 +01:00
|
|
|
end)
|
|
|
|
|
2017-03-16 06:22:09 +01:00
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
--
|
|
|
|
-- Craftitem registry
|
|
|
|
--
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:blueberries", {
|
|
|
|
description = S("Blueberries"),
|
|
|
|
inventory_image = "default_blueberries.png",
|
|
|
|
groups = {food_blueberries = 1, food_berry = 1},
|
|
|
|
on_use = minetest.item_eat(2),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:book", {
|
|
|
|
description = S("Book"),
|
|
|
|
inventory_image = "default_book.png",
|
|
|
|
groups = {book = 1, flammable = 3},
|
|
|
|
on_use = book_on_use,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:book_written", {
|
|
|
|
description = S("Book with Text"),
|
|
|
|
inventory_image = "default_book_written.png",
|
|
|
|
groups = {book = 1, not_in_creative_inventory = 1, flammable = 3},
|
|
|
|
stack_max = 1,
|
|
|
|
on_use = book_on_use,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:bronze_ingot", {
|
|
|
|
description = S("Bronze Ingot"),
|
|
|
|
inventory_image = "default_bronze_ingot.png"
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:clay_brick", {
|
|
|
|
description = S("Clay Brick"),
|
|
|
|
inventory_image = "default_clay_brick.png",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:clay_lump", {
|
|
|
|
description = S("Clay Lump"),
|
|
|
|
inventory_image = "default_clay_lump.png",
|
|
|
|
})
|
|
|
|
|
2013-05-19 18:43:04 +02:00
|
|
|
minetest.register_craftitem("default:coal_lump", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Coal Lump"),
|
2013-05-19 18:43:04 +02:00
|
|
|
inventory_image = "default_coal_lump.png",
|
2016-10-24 20:34:00 +02:00
|
|
|
groups = {coal = 1, flammable = 1}
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craftitem("default:copper_ingot", {
|
|
|
|
description = S("Copper Ingot"),
|
|
|
|
inventory_image = "default_copper_ingot.png"
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:copper_lump", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Copper Lump"),
|
2019-06-01 21:10:30 +02:00
|
|
|
inventory_image = "default_copper_lump.png"
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craftitem("default:diamond", {
|
|
|
|
description = S("Diamond"),
|
|
|
|
inventory_image = "default_diamond.png",
|
2017-04-19 03:48:00 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craftitem("default:flint", {
|
|
|
|
description = S("Flint"),
|
|
|
|
inventory_image = "default_flint.png"
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:gold_ingot", {
|
|
|
|
description = S("Gold Ingot"),
|
|
|
|
inventory_image = "default_gold_ingot.png"
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:gold_lump", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Gold Lump"),
|
2019-06-01 21:10:30 +02:00
|
|
|
inventory_image = "default_gold_lump.png"
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craftitem("default:iron_lump", {
|
|
|
|
description = S("Iron Lump"),
|
|
|
|
inventory_image = "default_iron_lump.png"
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craftitem("default:mese_crystal", {
|
|
|
|
description = S("Mese Crystal"),
|
|
|
|
inventory_image = "default_mese_crystal.png",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:mese_crystal_fragment", {
|
|
|
|
description = S("Mese Crystal Fragment"),
|
|
|
|
inventory_image = "default_mese_crystal_fragment.png",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:obsidian_shard", {
|
|
|
|
description = S("Obsidian Shard"),
|
|
|
|
inventory_image = "default_obsidian_shard.png",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:paper", {
|
|
|
|
description = S("Paper"),
|
|
|
|
inventory_image = "default_paper.png",
|
|
|
|
groups = {flammable = 3},
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("default:steel_ingot", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Steel Ingot"),
|
2019-06-01 21:10:30 +02:00
|
|
|
inventory_image = "default_steel_ingot.png"
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craftitem("default:stick", {
|
|
|
|
description = S("Stick"),
|
|
|
|
inventory_image = "default_stick.png",
|
|
|
|
groups = {stick = 1, flammable = 2},
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2017-04-19 03:48:00 +02:00
|
|
|
minetest.register_craftitem("default:tin_ingot", {
|
2019-09-10 19:09:51 +02:00
|
|
|
description = S("Tin Ingot"),
|
2019-06-01 21:10:30 +02:00
|
|
|
inventory_image = "default_tin_ingot.png"
|
2017-04-19 03:48:00 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craftitem("default:tin_lump", {
|
|
|
|
description = S("Tin Lump"),
|
|
|
|
inventory_image = "default_tin_lump.png"
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
--
|
|
|
|
-- Crafting recipes
|
|
|
|
--
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:book",
|
|
|
|
recipe = {
|
|
|
|
{"default:paper"},
|
|
|
|
{"default:paper"},
|
|
|
|
{"default:paper"},
|
|
|
|
}
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2020-01-04 01:09:58 +01:00
|
|
|
default.register_craft_metadata_copy("default:book", "default:book_written")
|
2013-05-19 18:43:04 +02:00
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:bronze_ingot 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"},
|
|
|
|
{"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"},
|
|
|
|
{"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"},
|
|
|
|
}
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:clay_brick 4",
|
|
|
|
recipe = {
|
|
|
|
{"default:brick"},
|
|
|
|
}
|
2013-05-19 18:43:04 +02:00
|
|
|
})
|
2016-03-11 18:27:22 +01:00
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:clay_lump 4",
|
|
|
|
recipe = {
|
|
|
|
{"default:clay"},
|
|
|
|
}
|
2016-03-11 18:27:22 +01:00
|
|
|
})
|
2018-10-09 21:54:22 +02:00
|
|
|
|
2020-01-01 02:38:06 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:coal_lump 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:coalblock"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:copper_ingot 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:copperblock"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:diamond 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:diamondblock"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:gold_ingot 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:goldblock"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:mese_crystal",
|
|
|
|
recipe = {
|
|
|
|
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
|
|
|
|
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
|
|
|
|
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:mese_crystal 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:mese"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:mese_crystal_fragment 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:mese_crystal"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:obsidian_shard 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:obsidian"}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:paper",
|
|
|
|
recipe = {
|
|
|
|
{"default:papyrus", "default:papyrus", "default:papyrus"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:steel_ingot 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:steelblock"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:stick 4",
|
|
|
|
recipe = {
|
|
|
|
{"group:wood"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "default:tin_ingot 9",
|
|
|
|
recipe = {
|
|
|
|
{"default:tinblock"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Cooking recipes
|
|
|
|
--
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "default:clay_brick",
|
|
|
|
recipe = "default:clay_lump",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "default:copper_ingot",
|
|
|
|
recipe = "default:copper_lump",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "default:gold_ingot",
|
|
|
|
recipe = "default:gold_lump",
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "default:steel_ingot",
|
|
|
|
recipe = "default:iron_lump",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "default:tin_ingot",
|
|
|
|
recipe = "default:tin_lump",
|
|
|
|
})
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Fuels
|
|
|
|
--
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "default:book",
|
|
|
|
burntime = 3,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "default:book_written",
|
|
|
|
burntime = 3,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "default:coal_lump",
|
|
|
|
burntime = 40,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "default:paper",
|
|
|
|
burntime = 1,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "group:stick",
|
|
|
|
burntime = 1,
|
2018-10-09 21:54:22 +02:00
|
|
|
})
|