more_chests/models/fridge.lua
nxet 886108a1af Mod rewrite and new models (#21)
* Aliases moved to utils folder

* Method to generate two different formspec layouts, big and small

* Log Actions moved to separate module

* Added method to generate a chest definition

* Rewritten models

* Add Fridge model

* Add Toolbox models

* "Mod loaded" message; Updated localization template

* Add Italian localization

* Fridge now has both normal and big (2 blocks) models

* Fixed mixed indentation

* Rewritten README; improved IT and FR (thanks to @louisroyer) localizations.
2021-02-25 18:19:05 +01:00

51 lines
1.2 KiB
Lua

local gen_def = dofile(minetest.get_modpath("more_chests") .. "/utils/base.lua")
local S = minetest.get_translator("more_chests")
-- TODO model open
local fridge = gen_def({
description = S("Fridge"),
type = "fridge",
size = "small",
tiles = {
side = "fridge_side.png",
front = "fridge_front.png",
},
recipe = {
{"", "default:steel_ingot", ""},
{"default:steel_ingot", "default:ice", "default:steel_ingot"},
{"", "default:steel_ingot", ""}
},
})
minetest.register_node("more_chests:fridge", fridge)
minetest.register_craft({
output = "more_chests:fridge",
recipe = fridge.recipe,
})
local big_fridge = gen_def({
description = S("Big Fridge"),
type = "fridge",
size = "big",
node_box = {
{-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
},
tiles = {
side = "fridge_side.png",
front = "fridge_front.png",
},
recipe = {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:ice", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
},
})
minetest.register_node("more_chests:big_fridge", big_fridge)
minetest.register_craft({
output = "more_chests:big_fridge",
recipe = big_fridge.recipe,
})