]> git.lizzy.rs Git - xdecor.git/blobdiff - nodes.lua
More cleanup
[xdecor.git] / nodes.lua
index b040a1419d235397856967e2bf509d731f529216..aa3cc4b0b52ea2a984782c360474f926c94f46e0 100644 (file)
--- a/nodes.lua
+++ b/nodes.lua
@@ -1,14 +1,14 @@
+screwdriver = screwdriver or {}
+
 xpanes.register_pane("bamboo_frame", {
        description = "Bamboo Frame",
        tiles = {"xdecor_bamboo_frame.png"},
        drawtype = "airlike",
        paramtype = "light",
-       sunlight_propagates = true,
-       textures = {"xdecor_bamboo_frame.png", "xdecor_bamboo_frame.png", 
-                       "xpanes_space.png"},
+       textures = {"xdecor_bamboo_frame.png", "xdecor_bamboo_frame.png", "xpanes_space.png"},
        inventory_image = "xdecor_bamboo_frame.png",
        wield_image = "xdecor_bamboo_frame.png",
-       groups = {snappy=3, pane=1, flammable=2},
+       groups = {choppy=3, oddly_breakable_by_hand=2, pane=1, flammable=2},
        recipe = {
                {"default:papyrus", "default:papyrus", "default:papyrus"},
                {"default:papyrus", "farming:cotton", "default:papyrus"},
@@ -22,8 +22,9 @@ xdecor.register("baricade", {
        walkable = false,
        inventory_image = "xdecor_baricade.png",
        tiles = {"xdecor_baricade.png"},
-       groups = {snappy=3, flammable=2},
-       damage_per_second = 4
+       groups = {choppy=2, oddly_breakable_by_hand=1, flammable=3},
+       damage_per_second = 4,
+       selection_box = xdecor.nodebox.slab_y(0.3)
 })
 
 xdecor.register("barrel", {
@@ -31,34 +32,35 @@ xdecor.register("barrel", {
        inventory = {size=24},
        infotext = "Barrel",
        tiles = {"xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
-       groups = {choppy=3, flammable=2},
-       sounds = xdecor.wood
+       groups = {choppy=2, oddly_breakable_by_hand=1, flammable=3},
+       sounds = default.node_sound_wood_defaults()
 })
 
 xdecor.register("cabinet", {
-       description = "Cabinet",
+       description = "Wood Cabinet",
        inventory = {size=24},
-       infotext = "Cabinet",
-       groups = {choppy=3, flammable=2},
-       sounds = xdecor.wood,
+       infotext = "Wood Cabinet",
+       groups = {choppy=2, oddly_breakable_by_hand=1, flammable=3},
+       sounds = default.node_sound_wood_defaults(),
+       on_rotate = screwdriver.rotate_simple,
        tiles = {
-               "default_wood.png", "default_wood.png",
-               "default_wood.png", "default_wood.png",
-               "default_wood.png", "xdecor_cabinet_front.png"
+               "xdecor_cabinet_sides.png", "xdecor_cabinet_sides.png",
+               "xdecor_cabinet_sides.png", "xdecor_cabinet_sides.png",
+               "xdecor_cabinet_sides.png", "xdecor_cabinet_front.png"
        }
 })
 
 xdecor.register("cabinet_half", {
-       description = "Half Cabinet",
+       description = "Half Wood Cabinet",
        inventory = {size=8},
-       infotext = "Half Cabinet",
-       groups = {choppy=3, flammable=3},
-       sounds = xdecor.wood,
+       infotext = "Half Wood Cabinet",
+       groups = {choppy=3, oddly_breakable_by_hand=2, flammable=3},
+       sounds = default.node_sound_wood_defaults(),
        node_box = xdecor.nodebox.slab_y(0.5, 0.5),
        tiles = {
-               "default_wood.png", "default_wood.png",
-               "default_wood.png", "default_wood.png",
-               "default_wood.png", "xdecor_cabinet_half_front.png"
+               "xdecor_cabinet_sides.png", "xdecor_cabinet_sides.png",
+               "xdecor_half_cabinet_sides.png", "xdecor_half_cabinet_sides.png",
+               "xdecor_half_cabinet_sides.png", "xdecor_half_cabinet_front.png"
        }
 })
 
@@ -67,7 +69,7 @@ xdecor.register("candle", {
        light_source = 12,
        drawtype = "torchlike",
        inventory_image = "xdecor_candle_inv.png",
-       wield_image = "xdecor_candle_inv.png",
+       wield_image = "xdecor_candle_wield.png",
        paramtype2 = "wallmounted",
        legacy_wallmounted = true,
        walkable = false,
@@ -75,101 +77,37 @@ xdecor.register("candle", {
        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}
        }
 })
 
-xdecor.register("cardboard_box", {
-       description = "Cardboard Box",
-       inventory = {size=8},
-       infotext = "Cardboard Box",
-       groups = {snappy=3, flammable=3},
-       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 = {cracky=1},
-       tiles = {
-               { name = "xdecor_cauldron_top_anim.png",
-               animation = {type="vertical_frames", length=3.0} },
-               "xdecor_cauldron_sides.png"
-       }
-})
-
-if minetest.get_modpath("bucket") then
-       local original_bucket_on_use = minetest.registered_items["bucket:bucket_empty"].on_use
-       minetest.override_item("bucket:bucket_empty", {
-               on_use = function(itemstack, user, pointed_thing)
-                       local inv = user:get_inventory()
-                       local player = user:get_player_name()
-
-                       if pointed_thing.type == "node" and
-                                       minetest.get_node(pointed_thing.under).name == "xdecor:cauldron" then
-                               if inv:room_for_item("main", "bucket:bucket_water 1") then
-                                       itemstack:take_item()
-                                       inv:add_item("main", "bucket:bucket_water 1")
-                               else
-                                       minetest.chat_send_player(player, "No enough room in your inventory.")
-                               end
-                               return itemstack
-                       else if original_bucket_on_use then
-                               return original_bucket_on_use(itemstack, user, pointed_thing)
-                       else return end
-               end
-       end
-       })
-end
-
-xdecor.register("chair", {
-       description = "Chair",
-       tiles = {"xdecor_wood.png"},
-       sounds = xdecor.wood,
-       groups = {choppy=3, flammable=2},
-       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}
-               }
+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"}
        }
 })
 
-xdecor.register("chandelier", {
-       description = "Chandelier",
-       drawtype = "plantlike",
-       walkable = false,
-       inventory_image = "xdecor_chandelier.png",
-       tiles = {"xdecor_chandelier.png"},
-       groups = {dig_immediate=3},
-       light_source = 14
-})
-
-xdecor.register("coalstone_tile", {
-       drawtype = "normal",
-       description = "Coalstone Tile",
-       tiles = {"xdecor_coalstone_tile.png"},
-       groups = {cracky=2, stone=1},
-       sounds = xdecor.stone
-})
-
+-- 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",
@@ -184,38 +122,34 @@ xdecor.register("cobweb", {
        walkable = false,
        selection_box = {type = "regular"},
        groups = {dig_immediate=3, liquid=3, flammable=3},
-       sounds = xdecor.leaves
+       sounds = default.node_sound_leaves_defaults()
 })
 
-local colors = {"red"} -- Add more curtains colors simply here.
-
-for _, c in ipairs(colors) do
+for _, c in pairs({"red"}) do  -- Add more curtains colors simply here.
        xdecor.register("curtain_"..c, {
-               description = "Curtain ("..c..")",
-               use_texture_alpha = true,
+               description = c:gsub("^%l", string.upper).." Curtain",
                walkable = false,
-               tiles = {"xdecor_curtain.png^[colorize:"..c..":130"},
-               inventory_image = "xdecor_curtain_open.png^[colorize:"..c..":130",
-               wield_image = "xdecor_curtain.png^[colorize:"..c..":130",
+               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, clicker, itemstack)
+               on_rightclick = function(pos, node)
                        minetest.set_node(pos, {name="xdecor:curtain_open_"..c, param2=node.param2})
                end
        })
 
        xdecor.register("curtain_open_"..c, {
-               tiles = {"xdecor_curtain_open.png^[colorize:"..c..":130"},
+               tiles = {"wool_white.png^[colorize:"..c..":170^xdecor_curtain_open_overlay.png^[makealpha:255,126,126"},
                drawtype = "signlike",
                paramtype2 = "wallmounted",
-               use_texture_alpha = true,
                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, clicker, itemstack)
+               on_rightclick = function(pos, node)
                        minetest.set_node(pos, {name="xdecor:curtain_"..c, param2=node.param2})
                end
        })
@@ -229,25 +163,40 @@ for _, c in ipairs(colors) do
        })
 end
 
-xdecor.register("cushion", {
-       description = "Cushion",
+xdecor.register("crate", {
+       description = "Crate",
+       inventory = {size=24},
+       infotext = "Crate",
+       tiles = {"xdecor_crate.png"},
+       groups = {choppy=2, oddly_breakable_by_hand=1, flammable=3},
+       sounds = default.node_sound_wood_defaults()
+})
+
+xdecor.register("cushion_block", {
        tiles = {"xdecor_cushion.png"},
-       groups = {snappy=3, flammable=3, fall_damage_add_percent=-50},
-       on_place = minetest.rotate_node,
-       node_box = xdecor.nodebox.slab_y(-0.5, 0.5)
+       groups = {snappy=3, flammable=3, fall_damage_add_percent=-75, not_in_creative_inventory=1},
+       drop = "xdecor:cushion 2"
 })
 
-local door_types = {"woodglass", "japanese"}
+local function door_access(door)
+       return door:find("prison")
+end
+
+local door_types = {
+       {"japanese", "brown"}, {"prison", "grey"}, {"prison_rust", "rust"},
+       {"screen", "brownb"}, {"slide", "brownc"}, {"woodglass", "brown"}
+}
 
 for _, d in pairs(door_types) do
-       doors.register_door("xdecor:"..d.."_door", {
-               description = string.sub(string.upper(d), 0, 1)..
-                               string.sub(d, 2).." Door",
-               inventory_image = "xdecor_"..d.."_door_inv.png",
-               groups = {choppy=3, flammable=2, door=1},
-               tiles_bottom = {"xdecor_"..d.."_door_b.png", "xdecor_brown.png"},
-               tiles_top = {"xdecor_"..d.."_door_a.png", "xdecor_brown.png"},
-               sounds = xdecor.wood
+       doors.register_door("xdecor:"..d[1].."_door", {
+               description = string.gsub(" "..d[1], "%W%l", string.upper):sub(2):gsub("_", " ").." Door",
+               inventory_image = "xdecor_"..d[1].."_door_inv.png",
+               groups = {choppy=3, cracky=3, oddly_breakable_by_hand=1, flammable=2, door=1},
+               tiles_bottom = {"xdecor_"..d[1].."_door_b.png", "xdecor_"..d[2]..".png"},
+               tiles_top = {"xdecor_"..d[1].."_door_a.png", "xdecor_"..d[2]..".png"},
+               only_placer_can_open = door_access(d[1]),
+               sounds = default.node_sound_wood_defaults(),
+               sunlight = false
        })
 end
 
@@ -255,29 +204,30 @@ xdecor.register("empty_shelf", {
        description = "Empty Shelf",
        inventory = {size=24},
        infotext = "Empty Shelf",
-       tiles = {"default_wood.png", "xdecor_empty_shelf.png"},
-       groups = {choppy=3, flammable=2},
-       sounds = xdecor.wood
+       tiles = {"default_wood.png", "default_wood.png^xdecor_empty_shelf.png"},
+       groups = {choppy=2, oddly_breakable_by_hand=1, flammable=3},
+       sounds = default.node_sound_wood_defaults(),
+       on_rotate = screwdriver.rotate_simple
 })
 
 xdecor.register("enderchest", {
        description = "Ender Chest",
        tiles = {
-               "xdecor_enderchest_top.png",
-               "xdecor_enderchest_top.png",
-               "xdecor_enderchest_side.png",
-               "xdecor_enderchest_side.png",
-               "xdecor_enderchest_side.png",
-               "xdecor_enderchest_front.png"
+               "xdecor_enderchest_top.png", "xdecor_enderchest_top.png",
+               "xdecor_enderchest_side.png", "xdecor_enderchest_side.png",
+               "xdecor_enderchest_side.png", "xdecor_enderchest_front.png"
        },
-       groups = {cracky=2},
-       sounds = xdecor.stone,
+       groups = {cracky=1, choppy=1, oddly_breakable_by_hand=1},
+       sounds = default.node_sound_stone_defaults(),
+       on_rotate = screwdriver.rotate_simple,
        on_construct = function(pos)
                local meta = minetest.get_meta(pos)
-               meta:set_string("formspec",
-                               "size[8,9]"..xdecor.fancy_gui..
-                               "list[current_player;enderchest;0,0;8,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+               meta:set_string("formspec", [[ size[8,9]
+                               list[current_player;enderchest;0,0;8,4;]
+                               list[current_player;main;0,5;8,4;]
+                               listring[current_player;enderchest]
+                               listring[current_player;main] ]]
+                               ..xbg..default.get_hotbar_bg(0,5))
                meta:set_string("infotext", "Ender Chest")
        end
 })
@@ -287,78 +237,36 @@ minetest.register_on_joinplayer(function(player)
        inv:set_size("enderchest", 8*4)
 end)
 
-local fence_sbox = {
-       type = "fixed",
-       fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}
-}
-
-xdecor.register("fence_wrought_iron", {
-       description = "Wrought Iron Fence",
-       drawtype = "fencelike",
-       groups = {cracky=2},
-       tiles = {"xdecor_wrought_iron.png"},
-       selection_box = fence_sbox,
-       inventory_image = "default_fence_overlay.png^xdecor_wrought_iron.png^default_fence_overlay.png^[makealpha:255,126,126"
-})
-
 xdecor.register("fire", {
        description = "Fancy Fire",
+       drawtype = "plantlike",
        light_source = 14,
        walkable = false,
        tiles = {
                { name = "xdecor_fire_anim.png",
                animation = {type="vertical_frames", length=1.5} }
        },
-       drawtype = "plantlike",
-       damage_per_second = 2,
+       damage_per_second = 4,
        drop = "",
        selection_box = {
-               type = "fixed",
-               fixed = {-1/3.5, -1/2, -1/3.5, 1/3.5, -1/2+2/16, 1/3.5}
+               type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, -0.3, 0.3}
        },
        groups = {dig_immediate=3, hot=3, not_in_creative_inventory=1}
 })
 
-minetest.register_tool("xdecor:flint_steel", {
-       description = "Flint & Steel",
-       inventory_image = "xdecor_flint_steel.png",
-       tool_capabilities = {
-               groupcaps = { igniter = {uses=65, maxlevel=1} }
-       },
-       on_use = function(itemstack, user, pointed_thing)
-               local player = user:get_player_name()
-               if pointed_thing.type == "node" and
-                               minetest.get_node(pointed_thing.above).name == "air" then
-                       if not minetest.is_protected(pointed_thing.above, player) then
-                               minetest.set_node(pointed_thing.above, {name="xdecor:fire"})
-                       else
-                               minetest.chat_send_player(player, "This area is protected.")
-                       end
-               else return end
-
-               itemstack:add_wear(65535/65)
-               return itemstack
-       end
-})
-
-minetest.register_tool("xdecor:hammer", {
-       description = "Hammer",
-       inventory_image = "xdecor_hammer.png"
-})
-
 xdecor.register("ivy", {
        description = "Ivy",
        drawtype = "signlike",
        walkable = false,
        climbable = true,
-       groups = {dig_immediate=3, flammable=2, plant=1},
+       groups = {dig_immediate=3, flammable=3, plant=1},
        paramtype2 = "wallmounted",
        selection_box = {type="wallmounted"},
        legacy_wallmounted = true,
        tiles = {"xdecor_ivy.png"},
        inventory_image = "xdecor_ivy.png",
        wield_image = "xdecor_ivy.png",
-       sounds = xdecor.leaves
+       sounds = default.node_sound_leaves_defaults()
 })
 
 xdecor.register("lantern", {
@@ -372,7 +280,7 @@ xdecor.register("lantern", {
        walkable = false,
        groups = {dig_immediate=3, attached_node=1},
        tiles = {"xdecor_lantern_floor.png", "xdecor_lantern_ceiling.png",
-               "xdecor_lantern.png"},
+                       "xdecor_lantern.png"},
        selection_box = {
                type = "wallmounted",
                wall_top = {-0.25, -0.4, -0.25, 0.25, 0.5, 0.25},
@@ -381,75 +289,118 @@ xdecor.register("lantern", {
        }
 })
 
-local flowerstype = { "dandelion_white", "dandelion_yellow", "geranium",
-               "rose", "tulip", "viola" }
+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",
+       description = "Packed Ice",
+       tiles = {"xdecor_packed_ice.png"},
+       groups = {cracky=1, puts_out_fire=1},
+       sounds = default.node_sound_glass_defaults()
+})
+
+local flowers = {"dandelion_white", "dandelion_yellow", "geranium", "rose",
+               "tulip", "viola"}
 
-for _, f in ipairs(flowerstype) do
+for _, f in pairs(flowers) do
        xdecor.register("potted_"..f, {
-               description = "Potted Flowers ("..f..")",
+               description = string.gsub("Potted Flowers ("..f..")", "_", " "),
                walkable = false,
                groups = {dig_immediate=3, flammable=3, plant=1, flower=1},
                tiles = {"xdecor_"..f.."_pot.png"},
                inventory_image = "xdecor_"..f.."_pot.png",
                drawtype = "plantlike",
-               sounds = xdecor.leaves
+               sounds = default.node_sound_leaves_defaults(),
+               selection_box = xdecor.nodebox.slab_y(0.3)
        })
 
        minetest.register_craft({
-               output = "xdecor:potted_"..f.." 2",
+               output = "xdecor:potted_"..f,
                recipe = {
-                       {"flowers:"..f, "xdecor:plant_pot"}
+                       {"default:clay_brick", "flowers:"..f, "default:clay_brick"},
+                       {"", "default:clay_brick", ""}
                }
        })
 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_empty.png",
+       wield_image = "xdecor_painting_empty.png",
        paramtype2 = "wallmounted",
        legacy_wallmounted = true,
-       walkable = false,
-       wield_image = "xdecor_painting.png",
-       selection_box = {type="wallmounted"},
-       groups = {dig_immediate=3, flammable=2, attached_node=1}
+       wield_image = "xdecor_painting_empty.png",
+       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)
+               local random = math.random(4)
+               if random == 1 then return end
+               minetest.set_node(pos, {name="xdecor:painting_"..random, param2=node.param2})
+       end
 })
 
-xdecor.register("plant_pot", {
-       description = "Plant Pot",
-       groups = {snappy=3},
-       tiles = {"xdecor_plant_pot_top.png", "xdecor_plant_pot_bottom.png",
-               "xdecor_plant_pot_sides.png"}
-})
+for i = 2, 4 do
+       xdecor.register("painting_"..i, {
+               tiles = {"xdecor_painting_"..i..".png"},
+               paramtype2 = "wallmounted",
+               legacy_wallmounted = true,
+               drop = "xdecor:painting_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
 
-xdecor.register("metal_cabinet", {
-       description = "Metal Cabinet",
-       inventory = {size=24},
-       groups = {cracky=2},
-       infotext = "Metal Cabinet",
-       tiles = {
-               "xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_sides.png",
-               "xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_sides.png",
-               "xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_front.png"
+for _, b in pairs({{"cactus", "cactus"}, {"moon", "stone"}}) do
+       xdecor.register(b[1].."brick", {
+               drawtype = "normal",
+               description = b[1]:gsub("^%l", string.upper).." Brick",
+               tiles = {"xdecor_"..b[1].."brick.png"},
+               groups = {cracky=2},
+               sounds = default.node_sound_stone_defaults(),
+       })
+       
+       minetest.register_craft({
+       output = "xdecor:"..b[1].."brick",
+       recipe = {
+               {"default:brick", "default:"..b[2]}
        }
 })
-
-xdecor.register("moonbrick", {
-       drawtype = "normal",
-       description = "Moonbrick",
-       tiles = {"xdecor_moonbrick.png"},
-       groups = {cracky=2},
-       sounds = xdecor.stone
-})
+end
 
 xdecor.register("multishelf", {
        description = "Multi Shelf",
        inventory = {size=24},
        infotext = "Multi Shelf",
-       tiles = {"default_wood.png", "xdecor_multishelf.png"},
-       groups = {choppy=3, flammable=2},
-       sounds = xdecor.wood
+       on_rotate = screwdriver.rotate_simple,
+       tiles = {"default_wood.png", "default_wood.png^xdecor_multishelf.png"},
+       groups = {choppy=2, oddly_breakable_by_hand=1, flammable=3},
+       sounds = default.node_sound_wood_defaults()
 })
 
 xpanes.register_pane("rust_bar", {
@@ -457,138 +408,69 @@ xpanes.register_pane("rust_bar", {
        tiles = {"xdecor_rust_bars.png"},
        drawtype = "airlike",
        paramtype = "light",
-       sunlight_propagates = true,
-       textures = {"xdecor_rust_bars.png", "xdecor_rust_bars.png", 
-                       "xpanes_space.png"},
+       textures = {"xdecor_rust_bars.png", "xdecor_rust_bars.png", "xpanes_space.png"},
        inventory_image = "xdecor_rust_bars.png",
        wield_image = "xdecor_rust_bars.png",
-       groups = {snappy=2, pane=1},
+       groups = {cracky=3, oddly_breakable_by_hand=2, pane=1},
        recipe = {
-               {"xpanes:bar", "default:dirt"}
+               {"", "default:dirt", ""},
+               {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+               {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
        }
 })
 
-xdecor.register("stereo", {
-       description = "Stereo",
-       groups = {snappy=2},
-       tiles = {
-               "xdecor_stereo_top.png", "xdecor_stereo_bottom.png",
-               "xdecor_stereo_left.png^[transformFX", "xdecor_stereo_left.png",
-               "xdecor_stereo_back.png", "xdecor_stereo_front.png"
-       }
-})
-
-xdecor.register("stone_rune", {
-       description = "Stone Rune",
-       tiles = {"xdecor_stone_rune.png"},
-       drawtype = "normal",
-       groups = {cracky=2, stone=1},
-       sounds = xdecor.stone
-})
-
 xdecor.register("stonepath", {
        description = "Garden Stone Path",
        tiles = {"default_stone.png"},
-       groups = {snappy=3, stone=1},
-       sounds = xdecor.stone,
-       node_box = {
-               type = "fixed",
-               fixed = {
-                       {-0.4375, -0.5, 0.3125, -0.3125, -0.48, 0.4375},
-                       {-0.25, -0.5, 0.125, 0, -0.48, 0.375},
-                       {0.125, -0.5, 0.125, 0.4375, -0.48, 0.4375},
-                       {-0.4375, -0.5, -0.125, -0.25, -0.48, 0.0625},
-                       {-0.0625, -0.5, -0.25, 0.25, -0.48, 0.0625},
-                       {0.3125, -0.5, -0.25, 0.4375, -0.48, -0.125},
-                       {-0.3125, -0.5, -0.375, -0.125, -0.48, -0.1875},
-                       {0.125, -0.5, -0.4375, 0.25, -0.48, -0.3125}
-               }
-       },
-       selection_box = {
-               type = "fixed",
-               fixed = {-0.4375, -0.5, -0.4375, 0.4375, -0.4, 0.4375}
-       }
-})
-
-xdecor.register("stone_tile", {
-       description = "Stone Tile",
-       tiles = {"xdecor_stone_tile.png"},
-       drawtype = "normal",
-       groups = {cracky=2, stone=1},
-       sounds = xdecor.stone
-})
+       groups = {snappy=3},
+       on_rotate = screwdriver.rotate_simple,
+       sounds = default.node_sound_stone_defaults(),
+       sunlight_propagates = true,
+       node_box = xdecor.pixelnodebox(16, {
+               {8,  0,  8, 6, 0.5, 6},
+               {1,  0,  1, 6, 0.5, 6},
+               {1,  0, 10, 5, 0.5, 5},
+               {10, 0,  2, 4, 0.5, 4}
+       }),
+       selection_box = xdecor.nodebox.slab_y(0.05)
+})
+
+local stonish = {"desertstone_tile", "stone_tile", "stone_rune",
+               "coalstone_tile", "hard_clay"}
+
+for _, t in pairs(stonish) do
+       xdecor.register(t, {
+               drawtype = "normal",
+               description = string.gsub(" "..t, "%W%l", string.upper):sub(2):gsub("_", " "),
+               tiles = {"xdecor_"..t..".png"},
+               groups = {cracky=1},
+               sounds = default.node_sound_stone_defaults()
+       })
+end
 
 xdecor.register("table", {
        description = "Table",
        tiles = {"xdecor_wood.png"},
-       groups = {choppy=3, flammable=2},
-       sounds = xdecor.wood,
-       node_box = {
-               type = "fixed",
-               fixed = {
-                       {-0.5, 0.4, -0.5, 0.5, 0.5, 0.5},
-                       {-0.15, -0.5, -0.15, 0.15, 0.4, 0.15}
-               }
-       }
+       groups = {choppy=3, oddly_breakable_by_hand=2, flammable=3},
+       sounds = default.node_sound_wood_defaults(),
+       node_box = xdecor.pixelnodebox(16, {
+               {0, 14, 0, 16, 2, 16}, {5.5, 0, 5.5, 5, 14, 6}
+       })
 })
 
 xdecor.register("tatami", {
        description = "Tatami",
        tiles = {"xdecor_tatami.png"},
-       groups = {snappy=3, flammable=2},
-       node_box = {
-               type = "fixed",
-               fixed = {
-                       {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
-               }
-       }
-})
-
-xdecor.register("trash_can", {
-       description = "Trash Can",
-       tiles = {"xdecor_wood.png"},
-       groups = {choppy=3, flammable=2},
-       sounds = xdecor.wood,
-       node_box = {
-               type = "fixed",
-               fixed = {
-                       {-0.3125, -0.5, 0.3125, 0.3125, 0.5, 0.375},
-                       {0.3125, -0.5, -0.375, 0.375, 0.5, 0.375},
-                       {-0.3125, -0.5, -0.375, 0.3125, 0.5, -0.3125},
-                       {-0.375, -0.5, -0.375, -0.3125, 0.5, 0.375},
-                       {-0.3125, -0.5, -0.3125, 0.3125, -0.4375, 0.3125}
-               }
-       },
-       collision_box = {
-               type = "fixed",
-               fixed = {
-                       {-0.375, -0.5, 0.375, 0.375, 0.25, 0.375},
-                       {0.375, -0.5, -0.375, 0.375, 0.25, 0.375},
-                       {-0.375, -0.5, -0.375, 0.375, 0.25, -0.375},
-                       {-0.375, -0.5, -0.375, -0.375, 0.25, 0.375},
-                       {-0.375, -0.5, -0.375, 0.375, -0.4375, 0.375}
-               }
-       },
-       on_construct = function(pos)
-               local meta = minetest.get_meta(pos)
-               meta:set_string("infotext", "Trash Can - throw your waste here!")
-       end
+       wield_image = "xdecor_tatami.png",
+       groups = {snappy=3, flammable=3},
+       node_box = xdecor.nodebox.slab_y(0.0625)
 })
 
--- Thanks to Evergreen for this code.
-local old_on_step = minetest.registered_entities["__builtin:item"].on_step
-minetest.registered_entities["__builtin:item"].on_step = function(self, dtime)
-       if minetest.get_node(self.object:getpos()).name == "xdecor:trash_can" then
-               self.object:remove()
-               return
-       end
-       old_on_step(self, dtime)
-end
-
 xdecor.register("tv", {
        description = "Television",
        light_source = 11,
-       groups = {snappy=2},
+       groups = {snappy=3},
+       on_rotate = screwdriver.rotate_simple,
        tiles = {
                "xdecor_television_left.png^[transformR270",
                "xdecor_television_left.png^[transformR90",
@@ -599,18 +481,35 @@ xdecor.register("tv", {
        }
 })
 
+xpanes.register_pane("wood_frame", {
+       description = "Wood Frame",
+       tiles = {"xdecor_wood_frame.png"},
+       drawtype = "airlike",
+       paramtype = "light",
+       textures = {"xdecor_wood_frame.png", "xdecor_wood_frame.png", "xpanes_space.png"},
+       inventory_image = "xdecor_wood_frame.png",
+       wield_image = "xdecor_wood_frame.png",
+       groups = {choppy=3, oddly_breakable_by_hand=2, pane=1, flammable=3},
+       sounds = default.node_sound_wood_defaults(),
+       recipe = {
+               {"group:wood", "group:stick", "group:wood"},
+               {"group:stick", "group:stick", "group:stick"},
+               {"group:wood", "group:stick", "group:wood"}
+       }
+})
+
 xdecor.register("woodframed_glass", {
        description = "Wood Framed Glass",
        drawtype = "glasslike_framed",
-       tiles = {"xdecor_framed_glass.png", "xdecor_framed_glass_detail.png"},
-       groups = {cracky=3},
-       sounds = xdecor.glass
+       tiles = {"xdecor_woodframed_glass.png", "xdecor_woodframed_glass_detail.png"},
+       groups = {cracky=3, oddly_breakable_by_hand=2},
+       sounds = default.node_sound_glass_defaults()
 })
 
 xdecor.register("wood_tile", {
        description = "Wood Tile",
        tiles = {"xdecor_wood_tile.png"},
        drawtype = "normal",
-       groups = {choppy=2, wood=1, flammable=2},
-       sounds = xdecor.wood
+       groups = {choppy=1, oddly_breakable_by_hand=1, wood=1, flammable=2},
+       sounds = default.node_sound_wood_defaults()
 })