1 xpanes.register_pane("bamboo_frame", {
2 description = "Bamboo Frame",
3 tiles = {"xdecor_bamboo_frame.png"},
6 sunlight_propagates = true,
7 textures = {"xdecor_bamboo_frame.png", "xdecor_bamboo_frame.png",
9 inventory_image = "xdecor_bamboo_frame.png",
10 wield_image = "xdecor_bamboo_frame.png",
11 groups = {snappy=3, pane=1, flammable=2},
13 {"default:papyrus", "default:papyrus", "default:papyrus"},
14 {"default:papyrus", "farming:cotton", "default:papyrus"},
15 {"default:papyrus", "default:papyrus", "default:papyrus"}
19 xdecor.register("baricade", {
20 description = "Baricade",
21 drawtype = "plantlike",
23 inventory_image = "xdecor_baricade.png",
24 tiles = {"xdecor_baricade.png"},
25 groups = {snappy=3, flammable=2},
29 xdecor.register("barrel", {
30 description = "Barrel",
31 inventory = {size=24},
33 tiles = {"xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
34 groups = {choppy=3, flammable=2},
38 xdecor.register("cabinet", {
39 description = "Cabinet",
40 inventory = {size=24},
42 groups = {choppy=3, flammable=2},
45 "default_wood.png", "default_wood.png",
46 "default_wood.png", "default_wood.png",
47 "default_wood.png", "xdecor_cabinet_front.png"
51 xdecor.register("cabinet_half", {
52 description = "Half Cabinet",
54 infotext = "Half Cabinet",
55 groups = {choppy=3, flammable=3},
57 node_box = xdecor.nodebox.slab_y(0.5, 0.5),
59 "default_wood.png", "default_wood.png",
60 "default_wood.png", "default_wood.png",
61 "default_wood.png", "xdecor_cabinet_half_front.png"
65 xdecor.register("candle", {
66 description = "Candle",
68 drawtype = "torchlike",
69 inventory_image = "xdecor_candle_inv.png",
70 wield_image = "xdecor_candle_inv.png",
71 paramtype2 = "wallmounted",
72 legacy_wallmounted = true,
74 groups = {dig_immediate=3, attached_node=1},
76 { name = "xdecor_candle_floor.png",
77 animation = {type="vertical_frames", length=1.5} },
78 { name = "xdecor_candle_wall.png",
79 animation = {type="vertical_frames", length=1.5} }
83 wall_bottom = {-0.25, -0.5, -0.25, 0.25, 0.1, 0.25},
84 wall_side = {-0.5, -0.35, -0.15, -0.15, 0.4, 0.15}
88 xdecor.register("cardboard_box", {
89 description = "Cardboard Box",
91 infotext = "Cardboard Box",
92 groups = {snappy=3, flammable=3},
93 tiles = {"xdecor_cardbox_top.png", "xdecor_cardbox_top.png",
94 "xdecor_cardbox_sides.png"},
98 {-0.3125, -0.5, -0.3125, 0.3125, 0, 0.3125}
103 xdecor.register("cauldron", {
104 description = "Cauldron",
107 { name = "xdecor_cauldron_top_anim.png",
108 animation = {type="vertical_frames", length=3.0} },
109 "xdecor_cauldron_sides.png"
113 if minetest.get_modpath("bucket") then
114 local original_bucket_on_use = minetest.registered_items["bucket:bucket_empty"].on_use
115 minetest.override_item("bucket:bucket_empty", {
116 on_use = function(itemstack, user, pointed_thing)
117 local inv = user:get_inventory()
118 if pointed_thing.type == "node" and
119 minetest.get_node(pointed_thing.under).name == "xdecor:cauldron" then
120 if inv:room_for_item("main", "bucket:bucket_water 1") then
121 itemstack:take_item()
122 inv:add_item("main", "bucket:bucket_water 1")
124 minetest.chat_send_player(user:get_player_name(),
125 "No room in your inventory to add a filled bucket!")
128 else if original_bucket_on_use then
129 return original_bucket_on_use(itemstack, user, pointed_thing)
136 xdecor.register("chair", {
137 description = "Chair",
138 tiles = {"xdecor_wood.png"},
139 sounds = xdecor.wood,
140 groups = {choppy=3, flammable=2},
144 {-0.3125, -0.5, 0.1875, -0.1875, 0.5, 0.3125},
145 {0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
146 {-0.1875, 0.025, 0.22, 0.1875, 0.45, 0.28},
147 {-0.3125, -0.5, -0.3125, -0.1875, -0.125, -0.1875},
148 {0.1875, -0.5, -0.3125, 0.3125, -0.125, -0.1875},
149 {-0.3125, -0.125, -0.3125, 0.3125, 0, 0.1875}
154 xdecor.register("chandelier", {
155 description = "Chandelier",
156 drawtype = "plantlike",
158 inventory_image = "xdecor_chandelier.png",
159 tiles = {"xdecor_chandelier.png"},
160 groups = {dig_immediate=3},
164 xdecor.register("coalstone_tile", {
166 description = "Coalstone Tile",
167 tiles = {"xdecor_coalstone_tile.png"},
168 groups = {cracky=2, stone=1},
169 sounds = xdecor.stone
172 xdecor.register("cobweb", {
173 description = "Cobweb",
174 drawtype = "plantlike",
175 tiles = {"xdecor_cobweb.png"},
176 inventory_image = "xdecor_cobweb.png",
177 liquid_viscosity = 8,
178 liquidtype = "source",
179 liquid_alternative_flowing = "xdecor:cobweb",
180 liquid_alternative_source = "xdecor:cobweb",
181 liquid_renewable = false,
184 selection_box = {type = "regular"},
185 groups = {dig_immediate=3, liquid=3, flammable=3},
186 sounds = xdecor.leaves
189 local colors = {"red"} -- Add more curtains colors simply here.
191 for _, c in ipairs(colors) do
192 xdecor.register("curtain_"..c, {
193 description = "Curtain ("..c..")",
194 use_texture_alpha = true,
196 tiles = {"xdecor_curtain.png^[colorize:"..c..":130"},
197 inventory_image = "xdecor_curtain_open.png^[colorize:"..c..":130",
198 wield_image = "xdecor_curtain.png^[colorize:"..c..":130",
199 drawtype = "signlike",
200 paramtype2 = "wallmounted",
201 groups = {dig_immediate=3, flammable=3},
202 selection_box = {type="wallmounted"},
203 on_rightclick = function(pos, node, clicker, itemstack)
204 minetest.set_node(pos, {name="xdecor:curtain_open_"..c, param2=node.param2})
208 xdecor.register("curtain_open_"..c, {
209 tiles = {"xdecor_curtain_open.png^[colorize:"..c..":130"},
210 drawtype = "signlike",
211 paramtype2 = "wallmounted",
212 use_texture_alpha = true,
214 groups = {dig_immediate=3, flammable=3, not_in_creative_inventory=1},
215 selection_box = {type="wallmounted"},
216 drop = "xdecor:curtain_"..c,
217 on_rightclick = function(pos, node, clicker, itemstack)
218 minetest.set_node(pos, {name="xdecor:curtain_"..c, param2=node.param2})
222 minetest.register_craft({
223 output = "xdecor:curtain_"..c.." 4",
225 {"", "wool:"..c, ""},
231 xdecor.register("cushion", {
232 description = "Cushion",
233 tiles = {"xdecor_cushion.png"},
234 groups = {snappy=3, flammable=3, fall_damage_add_percent=-50},
235 on_place = minetest.rotate_node,
236 node_box = xdecor.nodebox.slab_y(-0.5, 0.5)
239 local door_types = {"woodglass", "japanese"}
241 for _, d in pairs(door_types) do
242 doors.register_door("xdecor:"..d.."_door", {
243 description = string.sub(string.upper(d), 0, 1)..
244 string.sub(d, 2).." Door",
245 inventory_image = "xdecor_"..d.."_door_inv.png",
246 groups = {snappy=2, choppy=3, flammable=2, door=1},
247 tiles_bottom = {"xdecor_"..d.."_door_b.png", "xdecor_brown.png"},
248 tiles_top = {"xdecor_"..d.."_door_a.png", "xdecor_brown.png"},
253 xdecor.register("empty_shelf", {
254 description = "Empty Shelf",
255 inventory = {size=24},
256 infotext = "Empty Shelf",
257 tiles = {"default_wood.png", "xdecor_empty_shelf.png"},
258 groups = {choppy=3, flammable=2},
262 xdecor.register("enderchest", {
263 description = "Ender Chest",
265 "xdecor_enderchest_top.png",
266 "xdecor_enderchest_top.png",
267 "xdecor_enderchest_side.png",
268 "xdecor_enderchest_side.png",
269 "xdecor_enderchest_side.png",
270 "xdecor_enderchest_front.png"
273 sounds = xdecor.stone,
274 on_construct = function(pos)
275 local meta = minetest.get_meta(pos)
276 meta:set_string("formspec",
277 "size[8,9]"..xdecor.fancy_gui..
278 "list[current_player;enderchest;0,0;8,4;]"..
279 "list[current_player;main;0,5;8,4;]")
280 meta:set_string("infotext", "Ender Chest")
284 minetest.register_on_joinplayer(function(player)
285 local inv = player:get_inventory()
286 inv:set_size("enderchest", 8*4)
291 fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}
294 xdecor.register("fence_wrought_iron", {
295 description = "Wrought Iron Fence",
296 drawtype = "fencelike",
298 tiles = {"xdecor_wrought_iron.png"},
299 selection_box = fence_sbox,
300 inventory_image = "default_fence_overlay.png^xdecor_wrought_iron.png^default_fence_overlay.png^[makealpha:255,126,126"
303 xdecor.register("fire", {
304 description = "Fancy Fire",
308 { name = "xdecor_fire_anim.png",
309 animation = {type="vertical_frames", length=1.5} }
311 drawtype = "plantlike",
312 damage_per_second = 2,
314 groups = {dig_immediate=3, hot=3, not_in_creative_inventory=1}
317 minetest.register_tool("xdecor:flint_steel", {
318 description = "Flint & Steel",
319 inventory_image = "xdecor_flint_steel.png",
320 tool_capabilities = {
321 groupcaps = { flamable = {uses=65, maxlevel=1} }
323 on_use = function(itemstack, user, pointed_thing)
324 if pointed_thing.type == "node" and
325 minetest.get_node(pointed_thing.above).name == "air" then
326 if not minetest.is_protected(pointed_thing.above,
327 user:get_player_name()) then
328 minetest.set_node(pointed_thing.above, {name="xdecor:fire"})
330 minetest.chat_send_player(user:get_player_name(),
331 "This area is protected!")
337 itemstack:add_wear(65535/65)
342 minetest.register_tool("xdecor:hammer", {
343 description = "Hammer",
344 inventory_image = "xdecor_hammer.png"
347 xdecor.register("ivy", {
349 drawtype = "signlike",
352 groups = {dig_immediate=3, flammable=2, plant=1},
353 paramtype2 = "wallmounted",
354 selection_box = {type="wallmounted"},
355 legacy_wallmounted = true,
356 tiles = {"xdecor_ivy.png"},
357 inventory_image = "xdecor_ivy.png",
358 wield_image = "xdecor_ivy.png",
359 sounds = xdecor.leaves
362 xdecor.register("lantern", {
363 description = "Lantern",
365 drawtype = "torchlike",
366 inventory_image = "xdecor_lantern_floor.png",
367 wield_image = "xdecor_lantern_floor.png",
368 paramtype2 = "wallmounted",
369 legacy_wallmounted = true,
371 groups = {dig_immediate=3, attached_node=1},
372 tiles = {"xdecor_lantern_floor.png", "xdecor_lantern_ceiling.png",
373 "xdecor_lantern.png"},
375 type = "wallmounted",
376 wall_top = {-0.25, -0.4, -0.25, 0.25, 0.5, 0.25},
377 wall_bottom = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25},
378 wall_side = {-0.5, -0.5, -0.15, 0.5, 0.5, 0.15}
382 local flowerstype = { "dandelion_white", "dandelion_yellow", "geranium",
383 "rose", "tulip", "viola" }
385 for _, f in ipairs(flowerstype) do
386 xdecor.register("potted_"..f, {
387 description = "Potted Flowers ("..f..")",
389 groups = {dig_immediate=3, flammable=3, plant=1, flower=1},
390 tiles = {"xdecor_"..f.."_pot.png"},
391 inventory_image = "xdecor_"..f.."_pot.png",
392 drawtype = "plantlike",
393 sounds = xdecor.leaves
396 minetest.register_craft({
397 output = "xdecor:potted_"..f.." 2",
399 {"flowers:"..f, "xdecor:plant_pot"}
404 xdecor.register("painting", {
405 description = "Painting",
406 drawtype = "signlike",
407 tiles = {"xdecor_painting.png"},
408 inventory_image = "xdecor_painting.png",
409 paramtype2 = "wallmounted",
410 legacy_wallmounted = true,
412 wield_image = "xdecor_painting.png",
413 selection_box = {type="wallmounted"},
414 groups = {dig_immediate=3, flammable=2, attached_node=1}
417 xdecor.register("plant_pot", {
418 description = "Plant Pot",
420 tiles = {"xdecor_plant_pot_top.png", "xdecor_plant_pot_bottom.png",
421 "xdecor_plant_pot_sides.png"}
424 xdecor.register("metal_cabinet", {
425 description = "Metal Cabinet",
426 inventory = {size=24},
428 infotext = "Metal Cabinet",
430 "xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_sides.png",
431 "xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_sides.png",
432 "xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_front.png"
436 xdecor.register("moonbrick", {
438 description = "Moonbrick",
439 tiles = {"xdecor_moonbrick.png"},
441 sounds = xdecor.stone
444 xdecor.register("multishelf", {
445 description = "Multi Shelf",
446 inventory = {size=24},
447 infotext = "Multi Shelf",
448 tiles = {"default_wood.png", "xdecor_multishelf.png"},
449 groups = {choppy=3, flammable=2},
453 xpanes.register_pane("rust_bar", {
454 description = "Rust Bars",
455 tiles = {"xdecor_rust_bars.png"},
456 drawtype = "airlike",
458 sunlight_propagates = true,
459 textures = {"xdecor_rust_bars.png", "xdecor_rust_bars.png",
461 inventory_image = "xdecor_rust_bars.png",
462 wield_image = "xdecor_rust_bars.png",
463 groups = {snappy=2, pane=1},
465 {"xpanes:bar", "default:dirt"}
469 xdecor.register("stereo", {
470 description = "Stereo",
473 "xdecor_stereo_top.png", "xdecor_stereo_bottom.png",
474 "xdecor_stereo_left.png^[transformFX", "xdecor_stereo_left.png",
475 "xdecor_stereo_back.png", "xdecor_stereo_front.png"
479 xdecor.register("stone_rune", {
480 description = "Stone Rune",
481 tiles = {"xdecor_stone_rune.png"},
483 groups = {cracky=2, stone=1},
484 sounds = xdecor.stone
487 xdecor.register("stonepath", {
488 description = "Garden Stone Path",
489 tiles = {"default_stone.png"},
490 groups = {snappy=3, stone=1},
491 sounds = xdecor.stone,
495 {-0.4375, -0.5, 0.3125, -0.3125, -0.48, 0.4375},
496 {-0.25, -0.5, 0.125, 0, -0.48, 0.375},
497 {0.125, -0.5, 0.125, 0.4375, -0.48, 0.4375},
498 {-0.4375, -0.5, -0.125, -0.25, -0.48, 0.0625},
499 {-0.0625, -0.5, -0.25, 0.25, -0.48, 0.0625},
500 {0.3125, -0.5, -0.25, 0.4375, -0.48, -0.125},
501 {-0.3125, -0.5, -0.375, -0.125, -0.48, -0.1875},
502 {0.125, -0.5, -0.4375, 0.25, -0.48, -0.3125}
507 fixed = {-0.4375, -0.5, -0.4375, 0.4375, -0.4, 0.4375}
511 xdecor.register("stone_tile", {
512 description = "Stone Tile",
513 tiles = {"xdecor_stone_tile.png"},
515 groups = {cracky=2, stone=1},
516 sounds = xdecor.stone
519 xdecor.register("table", {
520 description = "Table",
521 tiles = {"xdecor_wood.png"},
522 groups = {choppy=3, flammable=2},
523 sounds = xdecor.wood,
527 {-0.5, 0.4, -0.5, 0.5, 0.5, 0.5},
528 {-0.15, -0.5, -0.15, 0.15, 0.4, 0.15}
533 xdecor.register("tatami", {
534 description = "Tatami",
535 tiles = {"xdecor_tatami.png"},
536 groups = {snappy=3, flammable=2},
540 {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
545 xdecor.register("trash_can", {
546 description = "Trash Can",
547 tiles = {"xdecor_wood.png"},
548 groups = {choppy=3, flammable=2},
549 sounds = xdecor.wood,
553 {-0.3125, -0.5, 0.3125, 0.3125, 0.5, 0.375},
554 {0.3125, -0.5, -0.375, 0.375, 0.5, 0.375},
555 {-0.3125, -0.5, -0.375, 0.3125, 0.5, -0.3125},
556 {-0.375, -0.5, -0.375, -0.3125, 0.5, 0.375},
557 {-0.3125, -0.5, -0.3125, 0.3125, -0.4375, 0.3125}
563 {-0.375, -0.5, 0.375, 0.375, 0.25, 0.375},
564 {0.375, -0.5, -0.375, 0.375, 0.25, 0.375},
565 {-0.375, -0.5, -0.375, 0.375, 0.25, -0.375},
566 {-0.375, -0.5, -0.375, -0.375, 0.25, 0.375},
567 {-0.375, -0.5, -0.375, 0.375, -0.4375, 0.375}
570 on_construct = function(pos)
571 local meta = minetest.get_meta(pos)
572 meta:set_string("infotext", "Trash Can - throw your waste here!")
576 -- Thanks to Evergreen for this code.
577 local old_on_step = minetest.registered_entities["__builtin:item"].on_step
578 minetest.registered_entities["__builtin:item"].on_step = function(self, dtime)
579 if minetest.get_node(self.object:getpos()).name == "xdecor:trash_can" then
583 old_on_step(self, dtime)
586 xdecor.register("tv", {
587 description = "Television",
591 "xdecor_television_left.png^[transformR270",
592 "xdecor_television_left.png^[transformR90",
593 "xdecor_television_left.png^[transformFX",
594 "xdecor_television_left.png", "xdecor_television_back.png",
595 { name = "xdecor_television_front_animated.png",
596 animation = {type="vertical_frames", length=80.0} }
600 xdecor.register("woodframed_glass", {
601 description = "Wood Framed Glass",
602 drawtype = "glasslike_framed",
603 tiles = {"xdecor_framed_glass.png", "xdecor_framed_glass_detail.png"},
605 sounds = xdecor.glass
608 xdecor.register("wood_tile", {
609 description = "Wood Tile",
610 tiles = {"xdecor_wood_tile.png"},
612 groups = {choppy=2, wood=1, flammable=2},