Skip to content
Snippets Groups Projects
Commit 6062c3f5 authored by jp's avatar jp
Browse files

Random painting on placing

parent 3c83904e
No related branches found
No related tags found
No related merge requests found
......@@ -251,7 +251,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = "xdecor:painting",
output = "xdecor:painting_1",
recipe = {
{"default:sign_wall", "dye:blue"}
}
......
......@@ -483,20 +483,40 @@ for _, f in pairs(flowers) do
})
end
xdecor.register("painting", {
xdecor.register("painting_1", {
description = "Painting",
drawtype = "signlike",
tiles = {"xdecor_painting.png"},
inventory_image = "xdecor_painting.png",
tiles = {"xdecor_painting_1.png"},
inventory_image = "xdecor_painting_1.png",
paramtype2 = "wallmounted",
legacy_wallmounted = true,
walkable = false,
on_rotate = screwdriver.rotate_simple,
wield_image = "xdecor_painting.png",
wield_image = "xdecor_painting_1.png",
selection_box = {type="wallmounted"},
groups = {dig_immediate=3, flammable=3, attached_node=1}
groups = {dig_immediate=3, flammable=3, attached_node=1},
after_place_node = function(pos, _, _, _)
local node = minetest.get_node(pos)
minetest.set_node(pos, {name = "xdecor:painting_"..math.random(1,4), param2 = node.param2})
end
})
minetest.register_alias("xdecor:painting", "xdecor:painting_1")
for i = 2, 4 do
xdecor.register("painting_"..i, {
drawtype = "signlike",
tiles = {"xdecor_painting_"..i..".png"},
paramtype2 = "wallmounted",
legacy_wallmounted = true,
walkable = false,
on_rotate = screwdriver.rotate_simple,
drop = "xdecor:painting_1",
selection_box = {type="wallmounted"},
groups = {dig_immediate=3, flammable=3, attached_node=1, not_in_creative_inventory=1}
})
end
for _, b in pairs({{"cactus", "cactus"}, {"moon", "stone"}}) do
xdecor.register(b[1].."brick", {
drawtype = "normal",
......
textures/xdecor_painting.png

252 B

textures/xdecor_painting_1.png

246 B

textures/xdecor_painting_2.png

409 B

textures/xdecor_painting_3.png

437 B

textures/xdecor_painting_4.png

409 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment