- description = "Candle", light_source = 12,
- inventory_image = "xdecor_candle_inv.png", drawtype = "torchlike",
- paramtype2 = "wallmounted", legacy_wallmounted = true,
- walkable = false, groups = {dig_immediate=3, attached_node=1},
- tiles = {
- {name="xdecor_candle_floor.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}},
- {name="xdecor_candle_wall.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}} },
- selection_box = {type="wallmounted",
- wall_bottom={-0.25, -0.5, -0.25, 0.25, 0.1, 0.25},
- wall_side={-0.5, -0.35, -0.15, -0.15, 0.4, 0.15}} })
-
-xdecor.register("cardboard_box", {
- description = "Cardboard box", groups = {snappy=3}, inventory = {size=8},
- tiles = {"xdecor_cardbox_top.png", "xdecor_cardbox_top.png", "xdecor_cardbox_sides.png"},
- node_box = {type="fixed", fixed={{-0.3125, -0.5, -0.3125, 0.3125, 0, 0.3125}}} })
-
-xdecor.register("cauldron", {
- description = "Cauldron", groups = {snappy=1},
- tiles = {{name="xdecor_cauldron_top_anim.png", animation={type="vertical_frames",
- aspect_w=16, aspect_h=16, length=3.0}}, "xdecor_cauldron_sides.png"} })
-
-xdecor.register("chair", {
- description = "Chair", tiles = {"xdecor_wood.png"},
- sounds = default.node_sound_wood_defaults(), groups = {snappy=3},
- node_box = {type="fixed", fixed={
- {-0.3125, -0.5, 0.1875, -0.1875, 0.5, 0.3125}, {0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
- {-0.1875, 0.025, 0.22, 0.1875, 0.45, 0.28}, {-0.3125, -0.5, -0.3125, -0.1875, -0.125, -0.1875},
- {0.1875, -0.5, -0.3125, 0.3125, -0.125, -0.1875}, {-0.3125, -0.125, -0.3125, 0.3125, 0, 0.1875}}} })
-
-xdecor.register("coalstone_tile", {
- description = "Coalstone tile", tiles = {"xdecor_coalstone_tile.png"},
- groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
-
-local curtaincolors = { {"red", "#ad2323e0:175"} }
-for c in ipairs(curtaincolors) do
-local color = curtaincolors[c][1]
-local hue = curtaincolors[c][2]
-
-xdecor.register("curtain_"..color, {
- description = "Curtain ("..color..")", tiles = {"xdecor_curtain.png^[colorize:"..hue},
- inventory_image = "xdecor_curtain_open.png^[colorize:"..hue,
- drawtype = "signlike", paramtype2 = "wallmounted",
- use_texture_alpha = true, walkable = false,
- groups = {dig_immediate=3}, selection_box = {type="wallmounted"},
- on_rightclick = function(pos, node, clicker, itemstack)
- local fdir = node.param2
- minetest.set_node(pos, {name = "xdecor:curtain_open_"..color, param2 = fdir})
- end })
-
-xdecor.register("curtain_open_"..color, {
- tiles = { "xdecor_curtain_open.png^[colorize:"..hue },
- drawtype = "signlike", paramtype2 = "wallmounted",
- use_texture_alpha = true, walkable = false,
- groups = {dig_immediate=3, not_in_creative_inventory=1},
- selection_box = {type="wallmounted"}, drop = "xdecor:curtain_"..color,
- on_rightclick = function(pos, node, clicker, itemstack)
- local fdir = node.param2
- minetest.set_node(pos, { name = "xdecor:curtain_"..color, param2 = fdir })
- end })
-
-minetest.register_craft({
- output = "xdecor:curtain_"..color.." 4",
- recipe = {{"", "wool:"..color, ""},
- {"", "wool:"..color, ""},
- {"", "wool:"..color, ""}} })
+ description = "Candle",
+ light_source = 12,
+ drawtype = "torchlike",
+ inventory_image = "xdecor_candle_inv.png",
+ wield_image = "xdecor_candle_wield.png",
+ paramtype2 = "wallmounted",
+ legacy_wallmounted = true,
+ walkable = false,
+ groups = {dig_immediate=3, attached_node=1},
+ tiles = {
+ { name = "xdecor_candle_floor.png",
+ animation = {type="vertical_frames", length=1.5} },
+ { name = "xdecor_candle_ceiling.png",
+ animation = {type="vertical_frames", length=1.5} },
+ { name = "xdecor_candle_wall.png",
+ animation = {type="vertical_frames", length=1.5} }
+ },
+ selection_box = {
+ type = "wallmounted",
+ wall_top = {-0.3, -0.4, -0.3, 0.3, 0.5, 0.3},
+ wall_bottom = {-0.25, -0.5, -0.25, 0.25, 0.1, 0.25},
+ wall_side = {-0.5, -0.35, -0.15, -0.15, 0.4, 0.15}
+ }
+})
+
+xpanes.register_pane("chainlink", {
+ description = "Chain Link",
+ tiles = {"xdecor_chainlink.png"},
+ drawtype = "airlike",
+ paramtype = "light",
+ textures = {"xdecor_chainlink.png", "xdecor_chainlink.png", "xpanes_space.png"},
+ inventory_image = "xdecor_chainlink.png",
+ wield_image = "xdecor_chainlink.png",
+ groups = {cracky=3, oddly_breakable_by_hand=2, pane=1},
+ recipe = {
+ {"default:steel_ingot", "", "default:steel_ingot"},
+ {"", "default:steel_ingot", ""},
+ {"default:steel_ingot", "", "default:steel_ingot"}
+ }
+})
+
+-- 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",
+ tiles = {"xdecor_cobweb.png"},
+ inventory_image = "xdecor_cobweb.png",
+ liquid_viscosity = 8,
+ liquidtype = "source",
+ liquid_alternative_flowing = "xdecor:cobweb",
+ liquid_alternative_source = "xdecor:cobweb",
+ liquid_renewable = false,
+ liquid_range = 0,
+ walkable = false,
+ selection_box = {type = "regular"},
+ groups = {dig_immediate=3, liquid=3, flammable=3},
+ sounds = default.node_sound_leaves_defaults()
+})
+
+for _, c in pairs({"red"}) do -- Add more curtains colors simply here.
+ xdecor.register("curtain_"..c, {
+ description = c:gsub("^%l", string.upper).." Curtain",
+ walkable = false,
+ tiles = {"wool_white.png^[colorize:"..c..":170"},
+ inventory_image = "wool_white.png^[colorize:"..c..":170^xdecor_curtain_open_overlay.png^[makealpha:255,126,126",
+ wield_image = "wool_white.png^[colorize:"..c..":170",
+ drawtype = "signlike",
+ paramtype2 = "wallmounted",
+ groups = {dig_immediate=3, flammable=3},
+ selection_box = {type="wallmounted"},
+ on_rightclick = function(pos, node)
+ minetest.set_node(pos, {name="xdecor:curtain_open_"..c, param2=node.param2})
+ end
+ })
+
+ xdecor.register("curtain_open_"..c, {
+ tiles = {"wool_white.png^[colorize:"..c..":170^xdecor_curtain_open_overlay.png^[makealpha:255,126,126"},
+ drawtype = "signlike",
+ paramtype2 = "wallmounted",
+ walkable = false,
+ groups = {dig_immediate=3, flammable=3, not_in_creative_inventory=1},
+ selection_box = {type="wallmounted"},
+ drop = "xdecor:curtain_"..c,
+ on_rightclick = function(pos, node)
+ minetest.set_node(pos, {name="xdecor:curtain_"..c, param2=node.param2})
+ end
+ })
+
+ minetest.register_craft({
+ output = "xdecor:curtain_"..c.." 4",
+ recipe = {
+ {"", "wool:"..c, ""},
+ {"", "wool:"..c, ""}
+ }
+ })