1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-11-11 12:50:21 +01:00
homedecor_modpack/homedecor/paintings.lua
Vanessa Ezekowitz 67598d3280 add blank canvas craft item and recipes for paintings
First, craft a blank canvas from four sticks
and some white wool:

- s -
s W s
- s -

Then, combine that canvas with some black and white dyes in the right
pattern to get the painting you want.

Paintings are numbred in-game, from 1 to 20.  Since there are so many
paintings, and so little crafting space, the only way I could think to
do it was to use binary for the recipe.  Convert the number of the
painting you want into binary, then use black dye for each 0 and white for
each 1, and lay them down into the crafting grid in this pattern:

bit2  bit1  bit0
  -   bit4  bit3
  -   Canv.   -

With the blank canvas in the bottom center slot.  For example, if you
want painting number 9, that would be 01001 in binary, so you'd arrange
the crafting grid like so:

Black Black White  --->  Painting #9
  -   Black White
  -   Canv.   -
2014-07-04 04:45:58 -04:00

30 lines
867 B
Lua

--Various kinds of paintings
for i = 1,20 do
minetest.register_node("homedecor:painting_"..i, {
description = "Decorative painting #"..i,
drawtype = "nodebox",
tiles = {
"homedecor_painting_edges.png",
"homedecor_painting_edges.png",
"homedecor_painting_edges.png",
"homedecor_painting_edges.png",
"homedecor_painting_back.png",
"homedecor_painting"..i..".png"
},
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -32/64, -32/64, 28/64, -30/64, 32/64, 32/64 }, -- left edge
{ 30/64, -32/64, 28/64, 32/64, 32/64, 32/64 }, -- right edge
{ -32/64, 30/64, 28/64, 32/64, 32/64, 32/64 }, -- top edge
{ -32/64, -30/64, 28/64, 32/64, -32/64, 32/64 }, -- bottom edge
{ -32/64, -32/64, 29/64, 32/64, 32/64, 29/64 } -- the canvas
}
},
groups = {snappy=3},
})
end