inventory_image = "xdecor_bamboo_frame.png",
wield_image = "xdecor_bamboo_frame.png",
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"},
- {"default:papyrus", "default:papyrus", "default:papyrus"}
- }
+ recipe = { {"default:papyrus", "default:papyrus", "default:papyrus"},
+ {"default:papyrus", "farming:cotton", "default:papyrus"},
+ {"default:papyrus", "default:papyrus", "default:papyrus"} }
})
xdecor.register("baricade", {
groups = {choppy=2, oddly_breakable_by_hand=1, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_rotate = screwdriver.rotate_simple,
- tiles = {
- "xdecor_cabinet_sides.png", "xdecor_cabinet_sides.png",
- "xdecor_cabinet_sides.png", "xdecor_cabinet_sides.png",
- "xdecor_cabinet_sides.png", "xdecor_cabinet_front.png"
- }
+ tiles = {"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", {
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 = {
- "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"
- }
+ tiles = {"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"}
})
xdecor.register("candle", {
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} }
+ 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",
}
})
+xdecor.register("chair", {
+ description = "Chair",
+ tiles = {"xdecor_wood.png"},
+ sounds = default.node_sound_wood_defaults(),
+ groups = {choppy=3, oddly_breakable_by_hand=2, flammable=3},
+ on_rotate = screwdriver.rotate_simple,
+ node_box = xdecor.pixelbox(16, {
+ {3, 0, 11, 2, 16, 2},
+ {11, 0, 11, 2, 16, 2},
+ {5, 9, 11.5, 6, 6, 1},
+ {3, 0, 3, 2, 6, 2},
+ {11, 0, 3, 2, 6, 2},
+ {3, 6, 3, 10, 2, 8}
+ }),
+ can_dig = xdecor.sit_dig,
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
+ pos.y = pos.y + 0 -- Sitting position.
+ xdecor.sit(pos, node, clicker, pointed_thing)
+ end
+})
+
xpanes.register_pane("chainlink", {
description = "Chain Link",
tiles = {"xdecor_chainlink.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"}
- }
+ 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
minetest.register_craft({
output = "xdecor:curtain_"..c.." 4",
- recipe = {
- {"", "wool:"..c, ""},
- {"", "wool:"..c, ""}
- }
+ recipe = { {"", "wool:"..c, ""},
+ {"", "wool:"..c, ""} }
})
end
-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()
+minetest.register_alias("xdecor:crate", "default:chess")
+
+xdecor.register("cushion", {
+ description = "Cushion",
+ 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),
+ can_dig = xdecor.sit_dig,
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
+ pos.y = pos.y + 0
+ xdecor.sit(pos, node, clicker, pointed_thing)
+
+ local wield_item = clicker:get_wielded_item():get_name()
+ if wield_item == "xdecor:cushion" and clicker:get_player_control().sneak then
+ local player_name = clicker:get_player_name()
+ if minetest.is_protected(pos, player_name) then
+ minetest.record_protection_violation(pos, player_name) return
+ end
+
+ minetest.set_node(pos, {name="xdecor:cushion_block", param2=node.param2})
+
+ if not minetest.setting_getbool("creative_mode") then
+ itemstack:take_item()
+ end
+ return itemstack
+ end
+ end
})
-local function door_access(door)
- return door:find("prison")
-end
+xdecor.register("cushion_block", {
+ tiles = {"xdecor_cushion.png"},
+ groups = {snappy=3, flammable=3, fall_damage_add_percent=-75, not_in_creative_inventory=1}
+})
-local door_types = {
- {"japanese", "brown"}, {"prison", "grey"}, {"prison_rust", "rust"},
- {"screen", "brownb"}, {"slide", "brownc"}, {"woodglass", "brown"}
+local function door_access(name) return name:find("prison") end
+local xdecor_doors = {
+ japanese = {
+ {"group:wood", "default:paper"},
+ {"default:paper", "group:wood"},
+ {"group:wood", "default:paper"}
+ },
+ prison = {
+ {"xpanes:bar", "xpanes:bar"},
+ {"xpanes:bar", "xpanes:bar"},
+ {"xpanes:bar", "xpanes:bar"}
+ },
+ rusty_prison = {
+ {"xpanes:rusty_bar", "xpanes:rusty_bar"},
+ {"xpanes:rusty_bar", "xpanes:rusty_bar"},
+ {"xpanes:rusty_bar", "xpanes:rusty_bar"}
+ },
+ screen = {
+ {"group:wood", "group:wood"},
+ {"xpanes:chainlink", "xpanes:chainlink"},
+ {"group:wood", "group:wood"}
+ },
+ slide = {
+ {"default:paper", "default:paper"},
+ {"default:paper", "default:paper"},
+ {"group:wood", "group:wood"}
+ },
+ woodglass = {
+ {"default:glass", "default:glass"},
+ {"group:wood", "group:wood"},
+ {"group:wood", "group:wood"}
+ }
}
-for _, d in pairs(door_types) do
- 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",
+for name, recipe in pairs(xdecor_doors) do
+ if not doors.register then break end
+ doors.register(name.."_door", {
+ tiles = {{name = "xdecor_"..name.."_door.png", backface_culling=true}},
+ description = string.gsub(" "..name, "%W%l", string.upper):sub(2):gsub("_", " ").." Door",
+ inventory_image = "xdecor_"..name.."_door_inv.png",
+ protected = door_access(name),
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
+ recipe = recipe
})
+ minetest.register_alias("xdecor:"..name.."_door", "doors:"..name.."_door")
+ minetest.register_alias("xdecor:"..name.."_door_t_1", "air")
+ minetest.register_alias("xdecor:"..name.."_door_t_2", "air")
+ minetest.register_alias("xdecor:"..name.."_door_b_1", "doors:"..name.."_door_a")
+ minetest.register_alias("xdecor:"..name.."_door_b_2", "doors:"..name.."_door_b")
end
+minetest.register_alias("xdecor:prison_rust_door", "doors:rusty_prison_door")
+minetest.register_alias("xdecor:prison_rust_door_t_1", "air")
+minetest.register_alias("xdecor:prison_rust_door_t_2", "air")
+minetest.register_alias("xdecor:prison_rust_door_b_1", "doors:rusty_prison_door_a")
+minetest.register_alias("xdecor:prison_rust_door_b_2", "doors:rusty_prison_door_b")
xdecor.register("empty_shelf", {
description = "Empty Shelf",
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"
- },
+ 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"},
groups = {cracky=1, choppy=1, oddly_breakable_by_hand=1},
sounds = default.node_sound_stone_defaults(),
on_rotate = screwdriver.rotate_simple,
drawtype = "plantlike",
light_source = 14,
walkable = false,
- tiles = {
- { name = "xdecor_fire_anim.png",
- animation = {type="vertical_frames", length=1.5} }
- },
+ tiles = {{ name = "xdecor_fire_anim.png",
+ animation = {type="vertical_frames", length=1.5 }}},
damage_per_second = 4,
drop = "",
- selection_box = {
- type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, -0.3, 0.3}
- },
+ selection_box = xdecor.pixelbox(16, {{4, 0, 4, 8, 3, 8}}),
groups = {dig_immediate=3, hot=3, not_in_creative_inventory=1}
})
legacy_wallmounted = true,
walkable = false,
groups = {dig_immediate=3, attached_node=1},
- tiles = {"xdecor_lantern_floor.png", "xdecor_lantern_ceiling.png",
- "xdecor_lantern.png"},
+ tiles = {"xdecor_lantern_floor.png", "xdecor_lantern_ceiling.png", "xdecor_lantern.png"},
selection_box = {
type = "wallmounted",
wall_top = {-0.25, -0.4, -0.25, 0.25, 0.5, 0.25},
sounds = default.node_sound_glass_defaults()
})
-local flowers = {"dandelion_white", "dandelion_yellow", "geranium", "rose",
- "tulip", "viola"}
-
-for _, f in pairs(flowers) do
+for _, f in pairs({"dandelion_white", "dandelion_yellow", "geranium",
+ "rose", "tulip", "viola"}) do
xdecor.register("potted_"..f, {
description = string.gsub("Potted Flowers ("..f..")", "_", " "),
walkable = false,
minetest.register_craft({
output = "xdecor:potted_"..f,
- recipe = {
- {"default:clay_brick", "flowers:"..f, "default:clay_brick"},
- {"", "default:clay_brick", ""}
- }
+ recipe = { {"default:clay_brick", "flowers:"..f, "default:clay_brick"},
+ {"", "default:clay_brick", ""} }
})
end
})
minetest.register_craft({
- output = "xdecor:"..b[1].."brick",
- recipe = {
- {"default:brick", "default:"..b[2]}
- }
-})
+ output = "xdecor:"..b[1].."brick",
+ type = "shapeless",
+ recipe = {"default:brick", "default:"..b[2]}
+ })
end
xdecor.register("multishelf", {
sounds = default.node_sound_wood_defaults()
})
-xpanes.register_pane("rust_bar", {
- description = "Rust Bars",
- tiles = {"xdecor_rust_bars.png"},
+xpanes.register_pane("rusty_bar", {
+ description = "Rusty Iron Bars",
+ tiles = {"xdecor_rusty_bars.png"},
drawtype = "airlike",
paramtype = "light",
- textures = {"xdecor_rust_bars.png", "xdecor_rust_bars.png", "xpanes_space.png"},
- inventory_image = "xdecor_rust_bars.png",
- wield_image = "xdecor_rust_bars.png",
+ textures = {"xdecor_rusty_bars.png", "xdecor_rusty_bars.png", "xpanes_space.png"},
+ inventory_image = "xdecor_rusty_bars.png",
+ wield_image = "xdecor_rusty_bars.png",
groups = {cracky=3, oddly_breakable_by_hand=2, pane=1},
- recipe = {
- {"", "default:dirt", ""},
- {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
- {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
- }
+ recipe = { {"", "default:dirt", ""},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"} }
})
+minetest.register_alias("xpanes:rust_bar", "xpanes:rusty_bar")
+for i = 1, 15 do
+ minetest.register_alias("xpanes:rust_bar_"..i, "xpanes:rusty_bar_"..i)
+end
+
xdecor.register("stonepath", {
description = "Garden Stone Path",
tiles = {"default_stone.png"},
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}
+ node_box = xdecor.pixelbox(16, {
+ {8, 0, 8, 6, .5, 6},
+ {1, 0, 1, 6, .5, 6},
+ {1, 0, 10, 5, .5, 5},
+ {10, 0, 2, 4, .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
+for _, t in pairs({"desertstone_tile", "stone_tile", "stone_rune",
+ "coalstone_tile", "hard_clay"}) do
xdecor.register(t, {
drawtype = "normal",
description = string.gsub(" "..t, "%W%l", string.upper):sub(2):gsub("_", " "),
tiles = {"xdecor_wood.png"},
groups = {choppy=3, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
- node_box = xdecor.pixelnodebox(16, {
+ node_box = xdecor.pixelbox(16, {
{0, 14, 0, 16, 2, 16}, {5.5, 0, 5.5, 5, 14, 6}
})
})
light_source = 11,
groups = {snappy=3},
on_rotate = screwdriver.rotate_simple,
- tiles = {
- "xdecor_television_left.png^[transformR270",
- "xdecor_television_left.png^[transformR90",
- "xdecor_television_left.png^[transformFX",
- "xdecor_television_left.png", "xdecor_television_back.png",
- { name = "xdecor_television_front_animated.png",
- animation = {type="vertical_frames", length=80.0} }
- }
+ tiles = { "xdecor_television_left.png^[transformR270",
+ "xdecor_television_left.png^[transformR90",
+ "xdecor_television_left.png^[transformFX",
+ "xdecor_television_left.png", "xdecor_television_back.png",
+ {name = "xdecor_television_front_animated.png",
+ animation = {type="vertical_frames", length=80.0}} }
})
xpanes.register_pane("wood_frame", {
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"}
- }
+ recipe = { {"group:wood", "group:stick", "group:wood"},
+ {"group:stick", "group:stick", "group:stick"},
+ {"group:wood", "group:stick", "group:wood"} }
})
xdecor.register("woodframed_glass", {
groups = {choppy=1, oddly_breakable_by_hand=1, wood=1, flammable=2},
sounds = default.node_sound_wood_defaults()
})
+