update cooking mod
not doing a submodule since I'll probably edit the citysim version of this mod
@ -8,6 +8,8 @@ cooking.register_craft({
|
||||
output = "cooking:sugar"
|
||||
})
|
||||
|
||||
if not foodspoil_register then foodspoil_register = function() end end
|
||||
|
||||
--breads
|
||||
minetest.register_craftitem("cooking:bun", {
|
||||
description = "Uncooked Bun",
|
||||
@ -66,6 +68,11 @@ cooking.register_craft({
|
||||
recipe = "farming:bread",
|
||||
output = "cooking:bread_sliced 6"
|
||||
})
|
||||
cooking.register_craft({
|
||||
type = "press",
|
||||
recipe = "default:blueberries",
|
||||
output = "cooking:blueberry_jam 4"
|
||||
})
|
||||
foodspoil_register("cooking:bread_sliced", 4)
|
||||
cooking.register_craft({
|
||||
type = "stack",
|
||||
@ -133,7 +140,7 @@ cooking.register_craft({
|
||||
--mushroom soup
|
||||
minetest.register_craftitem("cooking:mushroom_soup_uncooked", {
|
||||
description = "Uncooked Mushroom Soup",
|
||||
stack_max = 1,
|
||||
--stack_max = 1,
|
||||
inventory_image = "cooking_mushroom_soup_uncooked.png",
|
||||
param2 = 224,
|
||||
on_use = minetest.item_eat(4, "cooking:bowl")
|
||||
@ -141,7 +148,7 @@ minetest.register_craftitem("cooking:mushroom_soup_uncooked", {
|
||||
foodspoil_register("cooking:mushroom_soup_uncooked", 4)
|
||||
minetest.register_craftitem("cooking:mushroom_soup", {
|
||||
description = "Mushroom Soup",
|
||||
stack_max = 1,
|
||||
--stack_max = 1,
|
||||
inventory_image = "cooking_mushroom_soup.png",
|
||||
param2 = 222,
|
||||
on_use = minetest.item_eat(6, "cooking:bowl")
|
||||
@ -212,14 +219,22 @@ minetest.register_craft({
|
||||
},
|
||||
output = "cooking:spoon"
|
||||
})
|
||||
for i, subname in pairs({"wood", "pine_wood", "acacia_wood", "junglewood", "aspen_wood"}) do
|
||||
minetest.register_on_mods_loaded(function()
|
||||
local slablist = {}
|
||||
for name, def in pairs(minetest.registered_nodes) do
|
||||
if string.find(name, "slab") and string.find(name, "wood") then
|
||||
table.insert(slablist, name)
|
||||
end
|
||||
end
|
||||
for i, slabname in pairs(slablist) do
|
||||
minetest.register_craft({
|
||||
recipe = {
|
||||
{"stairs:slab_"..subname},
|
||||
{slabname},
|
||||
},
|
||||
output = "cooking:cutting_board"
|
||||
})
|
||||
end
|
||||
end)
|
||||
minetest.register_craft({
|
||||
recipe = {
|
||||
{"default:cobble", "default:cobble", "default:cobble"},
|
||||
|
@ -3,3 +3,5 @@ technic?
|
||||
farming?
|
||||
foodspoil?
|
||||
flowers?
|
||||
craftguide?
|
||||
unified_inventory?
|
@ -33,11 +33,38 @@ local function table_to_string(tbl)
|
||||
return str
|
||||
end
|
||||
|
||||
local crafttypelist = {
|
||||
stack = "Stacking",
|
||||
mix = "Mixing",
|
||||
cut = "Cutting",
|
||||
press = "Pressing",
|
||||
roll = "Rolling",
|
||||
stove = "Stove",
|
||||
oven = "Oven",
|
||||
soup = "Soup",
|
||||
}
|
||||
if craftguide then
|
||||
for craftname, tbl in pairs(crafttypelist) do
|
||||
craftguide.register_craft_type(craftname, {
|
||||
description = tbl[1],
|
||||
icon = "craftguide_"..craftname.."_icon.png",
|
||||
})
|
||||
end
|
||||
end
|
||||
if unified_inventory then
|
||||
for craftname, tbl in pairs(crafttypelist) do
|
||||
unified_inventory.register_craft_type(craftname, {
|
||||
description = tbl[1],
|
||||
width = 1,
|
||||
height = 0,
|
||||
})
|
||||
end
|
||||
end
|
||||
cooking.register_craft = function(tbl)
|
||||
assert(tbl.type, "No Craft Type Specified")
|
||||
assert(tbl.recipe, "No Craft Recipe Specified")
|
||||
assert(tbl.output, "No Craft Output Specified")
|
||||
if unified_inventory then
|
||||
if unified_inventory or craftguide then
|
||||
local output = table_to_string(tbl.output)
|
||||
for word in string.gmatch(tbl.output, '([^,]+)') do
|
||||
output = word
|
||||
@ -49,13 +76,32 @@ cooking.register_craft = function(tbl)
|
||||
else
|
||||
items = table.copy(tbl.recipe)
|
||||
end
|
||||
if unified_inventory then
|
||||
unifieditems = table.copy(items)
|
||||
unified_inventory.register_craft({
|
||||
type = string.gsub(tbl.type, "^%l", string.upper),
|
||||
output = output,
|
||||
items = items,
|
||||
width = 0,
|
||||
items = unifieditems,
|
||||
})
|
||||
end
|
||||
if craftguide then
|
||||
craftguideitems = table.copy(items)
|
||||
if (tbl.type == "stack" or tbl.type == "mix" or tbl.type == "soup") and #items ~= 1 then
|
||||
local addon = ""
|
||||
for i = 2, #items do
|
||||
addon = addon..", "
|
||||
end
|
||||
for i, item in pairs(items) do
|
||||
craftguideitems[#items+1-i] = item..addon
|
||||
end
|
||||
end
|
||||
craftguide.register_craft({
|
||||
type = tbl.type,
|
||||
result = output,
|
||||
items = craftguideitems,
|
||||
})
|
||||
end
|
||||
end
|
||||
if tbl.type == "oven" or tbl.type == "stove" then
|
||||
tbl.recipe = table_to_string(tbl.recipe)
|
||||
cooking.registered_cookcrafts[tbl.recipe] = {output = tbl.output, time = tbl.cooktime or 10, method = tbl.type}
|
||||
|
43
mods/cooking/license.txt
Normal file
@ -0,0 +1,43 @@
|
||||
in ovenstove.lua there is some copied and edited code from minetest_game default mod, which is under the following license:
|
||||
----------------------
|
||||
|
||||
GNU Lesser General Public License, version 2.1
|
||||
Copyright (C) 2011-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
Copyright (C) 2011-2018 Various Minetest developers and contributors
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms
|
||||
of the GNU Lesser General Public License as published by the Free Software Foundation;
|
||||
either version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details:
|
||||
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
on technic.lua there is some copied and edited code from the technic mod, which is under the following license:
|
||||
-------------------------
|
||||
LGPLv2
|
||||
|
||||
Credits for technic mod:
|
||||
kpoppel
|
||||
Nekogloop
|
||||
Nore/Ekdohibs
|
||||
ShadowNinja
|
||||
VanessaE
|
||||
And many others...
|
||||
|
||||
craftguide_cut_icon.png contains default_sword_steel.png from minetest_game default mod, which is under the following license:
|
||||
-------------------------------
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Attribution 3.0 Unported (CC BY 3.0)
|
||||
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
||||
See https://github.com/minetest/minetest_game/blob/master/mods/default/license.txt for more infomation
|
||||
|
||||
jelys_pizzaria_rolling_pin_inv.png and craftguide_roll_icon.png
|
||||
------------------------------
|
||||
Attribution-ShareAlike 3.0 (CC BY-SA 3.0) Extex
|
||||
inspired by https://www.brik.co/blogs/pixel-art/rolling-pin-pixel-art
|
||||
|
||||
all other code, textures, and models:
|
||||
----------------------
|
||||
Attribution 2.0 Generic (CC BY 2.0) Elkien3
|
@ -1,4 +1,8 @@
|
||||
-- default/furnace.lua
|
||||
--some code is copied and edited from default/furnace.lua from minetest_game
|
||||
--GNU Lesser General Public License, version 2.1
|
||||
--Copyright (C) 2011-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
--Copyright (C) 2011-2018 Various Minetest developers and contributors
|
||||
--see license.txt for more info
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = default.get_translator
|
||||
|
BIN
mods/cooking/screenshot.png
Normal file
After Width: | Height: | Size: 344 KiB |
BIN
mods/cooking/textures/craftguide_cut_icon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/cooking/textures/craftguide_mix_icon.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
mods/cooking/textures/craftguide_oven_icon.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
mods/cooking/textures/craftguide_press_icon.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
mods/cooking/textures/craftguide_roll_icon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/cooking/textures/craftguide_soup_icon.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
mods/cooking/textures/craftguide_stack_icon.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
mods/cooking/textures/craftguide_stove_icon.png
Normal file
After Width: | Height: | Size: 1.5 KiB |