}
})
+-- The following nodedef is licensed under WTFPL for granting a possible re-use
+-- in Minetest Game (https://github.com/minetest/minetest_game).
xdecor.register("cobweb", {
description = "Cobweb",
drawtype = "plantlike",
sounds = default.node_sound_wood_defaults()
})
+xdecor.register("cushion_block", {
+ tiles = {"xdecor_cushion.png"},
+ groups = {snappy=3, flammable=3, fall_damage_add_percent=-75, not_in_creative_inventory=1},
+ drop = "xdecor:cushion 2"
+})
+
local function door_access(door)
return door:find("prison")
end
}
})
-xdecor.register("lightbox", {
- description = "Light Box",
- tiles = {"xdecor_lightbox.png"},
- groups = {cracky=3, choppy=3, oddly_breakable_by_hand=2},
- light_source = 13,
- sounds = default.node_sound_glass_defaults()
-})
+for _, l in pairs({"iron", "wooden"}) do
+ xdecor.register(l.."_lightbox", {
+ description = l:gsub("^%l", string.upper).." Light Box",
+ tiles = {"xdecor_"..l.."_lightbox.png"},
+ groups = {cracky=3, choppy=3, oddly_breakable_by_hand=2},
+ light_source = 13,
+ sounds = default.node_sound_glass_defaults()
+ })
+end
+
+minetest.register_alias("xdecor:lightbox", "xdecor:wooden_lightbox")
xdecor.register("packed_ice", {
drawtype = "normal",
},
on_construct = function(pos)
local node = minetest.get_node(pos)
- minetest.set_node(pos, {name="xdecor:painting_"..math.random(1,4), param2=node.param2})
+ local random = math.random(4)
+ if random == 1 then return end
+ minetest.set_node(pos, {name="xdecor:painting_"..random, param2=node.param2})
end
})