]> git.lizzy.rs Git - xdecor.git/blobdiff - nodes.lua
Avoid some formspec concatenations
[xdecor.git] / nodes.lua
index 048b75e0ca11e9c161b411c2eec14557e84c6cd9..f118a3ecd8cbfe395e03a402b88391b829f60fae 100644 (file)
--- a/nodes.lua
+++ b/nodes.lua
@@ -352,35 +352,44 @@ end
 
 xdecor.register("painting_1", {
        description = "Painting",
-       drawtype = "signlike",
        tiles = {"xdecor_painting_1.png"},
-       inventory_image = "xdecor_painting_1.png",
+       inventory_image = "xdecor_painting_empty.png",
+       wield_image = "xdecor_painting_empty.png",
        paramtype2 = "wallmounted",
        legacy_wallmounted = true,
-       walkable = false,
-       on_rotate = screwdriver.rotate_simple,
        wield_image = "xdecor_painting_empty.png",
-       selection_box = {type="wallmounted"},
-       groups = {dig_immediate=3, flammable=3, attached_node=1},
-       after_place_node = function(pos, _, _, _)
+       sunlight_propagates = true,
+       groups = {choppy=3, oddly_breakable_by_hand=2, flammable=3, attached_node=1},
+       sounds = default.node_sound_wood_defaults(),
+       node_box = {
+               type = "wallmounted",
+               wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
+               wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
+               wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375}
+       },
+       on_construct = 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")
+minetest.register_alias("xdecor:painting", "xdecor:painting_1") -- legacy code
 
 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}
+               sunlight_propagates = true,
+               groups = {choppy=3, oddly_breakable_by_hand=2, flammable=3, attached_node=1, not_in_creative_inventory=1},
+               sounds = default.node_sound_wood_defaults(),
+               node_box = {
+                       type = "wallmounted",
+                       wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
+                       wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
+                       wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375}
+               }
        })
 end