diff --git a/enchanting.lua b/enchanting.lua index 03f2789..787e6a9 100644 --- a/enchanting.lua +++ b/enchanting.lua @@ -2,6 +2,8 @@ local enchanting = {} function enchanting.construct(pos) local meta = minetest.get_meta(pos) + local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots + meta:set_string("formspec", "size[8,7;]"..xbg.. "label[0.85,-0.15;Enchant]".."image[0.6,0.2;2,2;xdecor_enchbook.png]".. "list[current_name;tool;0.5,2;1,1;]".. @@ -78,7 +80,7 @@ xdecor.register("enchantment_table", { "xdecor_enchantment_side.png", "xdecor_enchantment_side.png" }, groups = {cracky=1}, - sounds = sound.stone, + sounds = default.node_sound_stone_defaults(), can_dig = enchanting.dig, on_construct = enchanting.construct, on_receive_fields = enchanting.fields, diff --git a/handlers/registration.lua b/handlers/registration.lua index 8487d40..94f708b 100644 --- a/handlers/registration.lua +++ b/handlers/registration.lua @@ -5,13 +5,7 @@ local default_can_dig = function(pos, _) return inv:is_empty("main") end -sound = {} -sound.wood = default.node_sound_wood_defaults() -sound.glass = default.node_sound_glass_defaults() -sound.leaves = default.node_sound_leaves_defaults() -sound.stone = default.node_sound_stone_defaults() - -xbg = default.gui_bg..default.gui_bg_img..default.gui_slots +local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots local default_inventory_size = 32 local default_inventory_formspecs = { @@ -66,7 +60,8 @@ function xdecor.register(name, def) meta:set_string("infotext", infotext) end local size = inventory.size or default_inventory_size - meta:get_inventory():set_size("main", size) + local inv = meta:get_inventory() + inv:set_size("main", size) meta:set_string("formspec", inventory.formspec or get_formspec_by_size(size)) end diff --git a/hive.lua b/hive.lua index baea942..5cadc20 100644 --- a/hive.lua +++ b/hive.lua @@ -2,6 +2,8 @@ local hive = {} function hive.construct(pos) local meta = minetest.get_meta(pos) + local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots + meta:set_string("formspec", "size[8,5;]"..xbg.. "label[1.35,0;Bees are making honey\nwith pollen around...]".. "image[0.2,-0.1;1,1;flowers_dandelion_white.png]".. diff --git a/itemframe.lua b/itemframe.lua index 12c91e7..57a0870 100644 --- a/itemframe.lua +++ b/itemframe.lua @@ -82,7 +82,7 @@ end xdecor.register("frame", { description = "Item frame", groups = {choppy=3, snappy=2}, - sounds = sound.wood, + sounds = default.node_sound_wood_defaults(), on_rotate = screwdriver.disallow, node_box = { type = "fixed", diff --git a/mailbox.lua b/mailbox.lua index 09754b0..a9053fc 100644 --- a/mailbox.lua +++ b/mailbox.lua @@ -59,6 +59,8 @@ xdecor.register("mailbox", { end }) +local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots + function mailbox.get_formspec(pos) local spos = pos.x..","..pos.y..","..pos.z local formspec = diff --git a/nodes.lua b/nodes.lua index b2945ea..9c074b1 100644 --- a/nodes.lua +++ b/nodes.lua @@ -1,3 +1,9 @@ +local sound = {} +sound.wood = default.node_sound_wood_defaults() +sound.glass = default.node_sound_glass_defaults() +sound.leaves = default.node_sound_leaves_defaults() +sound.stone = default.node_sound_stone_defaults() + xpanes.register_pane("bamboo_frame", { description = "Bamboo Frame", tiles = {"xdecor_bamboo_frame.png"}, diff --git a/worktable.lua b/worktable.lua index 6b7c839..9bcd6eb 100644 --- a/worktable.lua +++ b/worktable.lua @@ -34,6 +34,7 @@ function worktable.construct(pos) end nodebtn = table.concat(nodebtn) + local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots meta:set_string("formspec", "size[8,7;]"..xbg.. "label[0,0;Cut your material into...]"..nodebtn.. "label[0,1.5;Input]".."list[current_name;input;0,2;1,1;]".. @@ -118,7 +119,7 @@ end xdecor.register("worktable", { description = "Work Table", groups = {cracky=2, choppy=2}, - sounds = sound.wood, + sounds = default.node_sound_wood_defaults(), tiles = { "xdecor_worktable_top.png", "xdecor_worktable_top.png", "xdecor_worktable_sides.png", "xdecor_worktable_sides.png", diff --git a/xwall.lua b/xwall.lua index 2320736..471fd24 100644 --- a/xwall.lua +++ b/xwall.lua @@ -184,7 +184,7 @@ function xwall.register_wall(name, tiles, def) def = { description = string.sub(name:gsub("%l", string.upper, 7), 8, -6).." Wall", textures = {tiles, tiles, tiles, tiles}, - sounds = sound.stone, + sounds = default.node_sound_stone_defaults(), groups = {cracky=3, stone=1, pane=1}, sunlight_propagates = true, collision_box = {