+minetest.register_craft({
+ output = "xdecor:baricade",
+ recipe = {
+ {"group:stick", "default:steel_ingot", "group:stick"},
+ {"", "group:stick", ""},
+ {"group:stick", "", "group:stick"}
+ }
+})
+
minetest.register_craft({
output = "xdecor:candle",
recipe = {
description = "Hammer",
inventory_image = "xdecor_hammer.png"
})
+
+minetest.register_craft({
+ output = "xdecor:japanese_door",
+ recipe = {
+ {"group:wood", "group:wood"},
+ {"default:paper", "default:paper"},
+ {"group:wood", "group:wood"}
+ }
+})
minetest.register_craft({
output = "xdecor:lantern",
{"default:iron_lump"}
}
})
+
+minetest.register_craft({
+ output = "xdecor:mailbox",
+ recipe = {
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ {"dye:red", "default:paper", "dye:red"},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
+ }
+})
minetest.register_craft({
output = "xdecor:metal_cabinet",
}
})
+minetest.register_craft({
+ output = "xdecor:stonepath 16",
+ recipe = {
+ {"stairs:slab_stone", "", "stairs:slab_stone"},
+ {"", "stairs:slab_stone", ""},
+ {"stairs:slab_stone", "", "stairs:slab_stone"}
+ }
+})
+
minetest.register_craft({
output = "xdecor:table",
recipe = {
}
})
+minetest.register_craft({
+ output = "xdecor:tatami",
+ recipe = {
+ {"farming:wheat", "farming:wheat", "farming:wheat"}
+ }
+})
+
minetest.register_craft({
output = "xdecor:tv",
recipe = {
{"group:wood", "group:wood"}
}
})
+
+minetest.register_craft({
+ output = "xdecor:woodglass_door",
+ recipe = {
+ {"default:glass", "default:glass"},
+ {"group:wood", "group:wood"},
+ {"group:wood", "group:wood"}
+ }
+})
default
-moreblocks?
+doors
+xpanes
dofile(modpath.."/handlers/registration.lua")
dofile(modpath.."/crafts.lua")
dofile(modpath.."/itemframes.lua")
+dofile(modpath.."/mailbox.lua")
dofile(modpath.."/nodes.lua")
dofile(modpath.."/worktable.lua")
--- /dev/null
+xdecor.register("mailbox", {
+ description = "Mailbox",
+ tiles = {
+ "xdecor_mailbox_top.png", "xdecor_mailbox_bottom.png",
+ "xdecor_mailbox_side.png", "xdecor_mailbox_side.png",
+ "xdecor_mailbox.png", "xdecor_mailbox.png",
+ },
+ groups = {snappy=3},
+ after_place_node = function(pos, placer, itemstack)
+ local meta = minetest.get_meta(pos)
+ local owner = placer:get_player_name()
+
+ meta:set_string("owner", owner)
+ meta:set_string("infotext", owner.."'s Mailbox")
+
+ local inv = meta:get_inventory()
+ inv:set_size("main", 8*4)
+ inv:set_size("drop", 1)
+ end,
+ on_rightclick = function(pos, node, clicker, itemstack)
+ local meta = minetest.get_meta(pos)
+ local player = clicker:get_player_name()
+ local owner = meta:get_string("owner")
+ local meta = minetest.get_meta(pos)
+
+ if owner == player then
+ minetest.show_formspec(
+ clicker:get_player_name(),
+ "default:chest_locked",
+ xdecor.get_mailbox_formspec(pos))
+ else
+ minetest.show_formspec(
+ clicker:get_player_name(),
+ "default:chest_locked",
+ xdecor.get_mailbox_insert_formspec(pos))
+ end
+ end,
+ can_dig = function(pos,player)
+ local meta = minetest.get_meta(pos)
+ local owner = meta:get_string("owner")
+ local inv = meta:get_inventory()
+
+ return player:get_player_name() == owner and inv:is_empty("main")
+ end,
+ on_metadata_inventory_put = function(pos, listname, index, stack, player)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+
+ if listname == "drop" and inv:room_for_item("main", stack) then
+ inv:remove_item("drop", stack)
+ inv:add_item("main", stack)
+ end
+ end,
+ allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ if listname == "main" then
+ return 0
+ end
+ if listname == "drop" then
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+
+ if inv:room_for_item("main", stack) then
+ return -1
+ else
+ return 0
+ end
+ end
+ end,
+})
+
+function xdecor.get_mailbox_formspec(pos)
+ local spos = pos.x..","..pos.y..","..pos.z
+ local formspec =
+ "size[8,9]"..xdecor.fancy_gui..
+ "label[0,0;You received...]"..
+ "list[nodemeta:"..spos..";main;0,0.75;8,4;]"..
+ "list[current_player;main;0,5.25;8,4;]"
+ return formspec
+end
+
+function xdecor.get_mailbox_insert_formspec(pos)
+ local spos = pos.x..","..pos.y..","..pos.z
+ local formspec =
+ "size[8,5]"..xdecor.fancy_gui..
+ "label[0,0;Send your goods...]"..
+ "list[nodemeta:"..spos..";drop;3.5,0;1,1;]"..
+ "list[current_player;main;0,1.25;8,4;]"
+ return formspec
+end
+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" },
+ inventory_image = "xdecor_bamboo_frame.png",
+ wield_image = "xdecor_bamboo_frame.png",
+ groups = {snappy=3, pane=1},
+ recipe = {
+ {"default:papyrus", "default:papyrus", "default:papyrus"},
+ {"default:papyrus", "farming:cotton", "default:papyrus"},
+ {"default:papyrus", "default:papyrus", "default:papyrus"}
+ }
+})
+
+xdecor.register("baricade", {
+ description = "Baricade",
+ drawtype = "plantlike",
+ walkable = false,
+ inventory_image = "xdecor_baricade.png",
+ tiles = {"xdecor_baricade.png"},
+ groups = {snappy=3},
+ damage_per_second = 4
+})
+
xdecor.register("barrel", {
description = "Barrel",
inventory = {size=24},
node_box = xdecor.nodebox.slab_y(-0.5, 0.5)
})
+local door_types = {"woodglass", "japanese"}
+
+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 = {snappy=3, 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,
+ })
+end
+
xdecor.register("empty_shelf", {
description = "Empty Shelf",
inventory = {size=24},
sounds = xdecor.stone
})
+xdecor.register("stonepath", {
+ description = "Garden Stone Path",
+ tiles = { "default_stone.png" },
+ groups = { snappy=3 },
+ 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"},
}
})
+xdecor.register("tatami", {
+ description = "Tatami",
+ tiles = {"xdecor_tatami.png"},
+ groups = {snappy=3},
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
+ }
+ }
+})
+
xdecor.register("tv", {
description = "Television",
light_source = 11,
elseif string.find(mat, "brick") then
local newname = string.gsub(mat, "(brick)", "_%1")
return "default_"..newname..".png"
+ elseif string.find(mat, "tree") then
+ local newname = string.gsub(mat, "(tree)", "%1_top")
+ return "default_"..newname..".png"
else
return "default_"..mat..".png"
end