121 lines
4.1 KiB
Lua
121 lines
4.1 KiB
Lua
--[[
|
|
Copyright 2019-2022 MCL
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
]]
|
|
|
|
--[[
|
|
TODO:
|
|
Add milk
|
|
Add a crafting recipe for chocolate
|
|
Add cocoa trees
|
|
]]
|
|
|
|
--Cocoa
|
|
minetest.register_craftitem("chocolate:cocoa_beans", {
|
|
description = "Cocoa",
|
|
inventory_image = "chocolate_cocoa_beans.png",
|
|
})
|
|
|
|
minetest.register_craftitem("chocolate:cocoa_powder", {
|
|
description = "Cocoa Powder",
|
|
inventory_image = "chocolate_cocoa_powder.png",
|
|
})
|
|
|
|
--Bars
|
|
minetest.register_craftitem("chocolate:bar_dark", {
|
|
description = "Dark Chocolate Bar",
|
|
inventory_image = "chocolate_bar_dark.png",
|
|
on_use = minetest.item_eat(6),
|
|
})
|
|
|
|
minetest.register_craftitem("chocolate:bar_milk", {
|
|
description = "Milk Chocolate Bar",
|
|
inventory_image = "chocolate_bar_milk.png",
|
|
on_use = minetest.item_eat(5),
|
|
})
|
|
|
|
minetest.register_craftitem("chocolate:bar_white", {
|
|
description = "White Chocolate Bar",
|
|
inventory_image = "chocolate_bar_white.png",
|
|
on_use = minetest.item_eat(3),
|
|
})
|
|
|
|
--Blocks
|
|
minetest.register_node("chocolate:block_dark", {
|
|
description = "Dark Chocolate Block",
|
|
tiles = {"chocolate_block_dark.png"},
|
|
on_use = minetest.item_eat(20),
|
|
})
|
|
|
|
minetest.register_node("chocolate:block_milk", {
|
|
description = "Milk Chocolate Block",
|
|
tiles = {"chocolate_block_milk.png"},
|
|
on_use = minetest.item_eat(20),
|
|
})
|
|
|
|
minetest.register_node("chocolate:block_white", {
|
|
description = "White Chocolate Block",
|
|
tiles = {"chocolate_block_white.png"},
|
|
on_use = minetest.item_eat(15),
|
|
})
|
|
|
|
--If the player doesn't have the vessels mod installed,
|
|
--the mod registers its own glass and steel bottle craftitem.
|
|
if not minetest.get_modpath("vessels") then
|
|
minetest.register_craftitem("chocolate:vsl_bottle_glass", {
|
|
description = "Empty Glass Bottle",
|
|
inventory_image = "chocolate_vsl_bottle_glass.png",
|
|
})
|
|
|
|
minetest.register_craftitem("chocolate:vsl_bottle_steel", {
|
|
description = "Empty Steel Bottle",
|
|
inventory_image = "chocolate_vsl_bottle_steel.png",
|
|
})
|
|
end
|
|
|
|
--Liquid Chocolate Glass Bottles
|
|
minetest.register_craftitem("chocolate:vsl_bottle_glass_dark", {
|
|
description = "Liquid Dark Chocolate Glass Bottle",
|
|
inventory_image = "chocolate_vsl_bottle_glass_dark.png",
|
|
on_use = minetest.item_eat(3),
|
|
})
|
|
|
|
minetest.register_craftitem("chocolate:vsl_bottle_glass_milk", {
|
|
description = "Liquid Milk Chocolate Glass Bottle",
|
|
inventory_image = "chocolate_vsl_bottle_glass_milk.png",
|
|
on_use = minetest.item_eat(2),
|
|
})
|
|
|
|
minetest.register_craftitem("chocolate:vsl_bottle_glass_white", {
|
|
description = "Liquid White Chocolate Glass Bottle",
|
|
inventory_image = "chocolate_vsl_bottle_glass_white.png",
|
|
on_use = minetest.item_eat(1),
|
|
})
|
|
|
|
--Liquid Chocolate Steel Bottles
|
|
minetest.register_craftitem("chocolate:vsl_bottle_steel_dark", {
|
|
description = "Liquid Dark Chocolate Steel Bottle",
|
|
inventory_image = "chocolate_vsl_bottle_steel.png",
|
|
on_use = minetest.item_eat(3),
|
|
})
|
|
|
|
minetest.register_craftitem("chocolate:vsl_bottle_steel_milk", {
|
|
description = "Liquid Milk Chocolate Steel Bottle",
|
|
inventory_image = "chocolate_vsl_bottle_steel.png",
|
|
on_use = minetest.item_eat(2),
|
|
})
|
|
|
|
minetest.register_craftitem("chocolate:vsl_bottle_steel_white", {
|
|
description = "Liquid White Chocolate Steel Bottle",
|
|
inventory_image = "chocolate_vsl_bottle_steel.png",
|
|
on_use = minetest.item_eat(1),
|
|
})
|
|
|