xdecor-libre/nodes.lua

490 lines
13 KiB
Lua
Raw Normal View History

2015-07-02 16:26:19 +03:00
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
})
2015-06-10 14:26:04 +03:00
xdecor.register("barrel", {
2015-06-25 18:25:36 +03:00
description = "Barrel",
inventory = {size=24},
infotext = "Barrel",
tiles = { "xdecor_barrel_top.png", "xdecor_barrel_sides.png" },
groups = {snappy=3},
sounds = xdecor.wood
})
2015-06-10 14:26:04 +03:00
xdecor.register("cabinet", {
2015-06-25 18:25:36 +03:00
description = "Cabinet",
inventory = {size=24},
infotext = "Cabinet",
groups = {snappy=3},
sounds = xdecor.wood,
tiles = {
"default_wood.png", "default_wood.png",
"default_wood.png", "default_wood.png",
"default_wood.png","xdecor_cabinet_front.png"
}
})
2015-06-10 14:26:04 +03:00
xdecor.register("cabinet_half", {
2015-06-25 18:25:36 +03:00
description = "Half Cabinet",
inventory = {size=8},
infotext = "Half Cabinet",
groups = {snappy=3},
sounds = xdecor.wood,
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"
}
})
2015-06-10 14:26:04 +03:00
xdecor.register("candle", {
2015-06-25 18:25:36 +03:00
description = "Candle",
light_source = 12,
drawtype = "torchlike",
inventory_image = "xdecor_candle_inv.png",
wield_image = "xdecor_candle_inv.png",
paramtype2 = "wallmounted",
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_wall.png",
animation = {type="vertical_frames", length=1.5} }
},
selection_box = {
type = "wallmounted",
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}
}
})
2015-06-10 14:26:04 +03:00
xdecor.register("cardboard_box", {
2015-06-25 18:25:36 +03:00
description = "Cardboard Box",
inventory = {size=8},
infotext = "Cardboard Box",
groups = {snappy=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}
}
}
})
2015-06-10 14:26:04 +03:00
xdecor.register("cauldron", {
2015-06-25 18:25:36 +03:00
description = "Cauldron",
groups = {snappy=1},
tiles = {
{ name = "xdecor_cauldron_top_anim.png",
animation = {type="vertical_frames", length=3.0} },
"xdecor_cauldron_sides.png"
}
})
2015-06-10 14:26:04 +03:00
xdecor.register("chair", {
2015-06-25 18:25:36 +03:00
description = "Chair",
tiles = {"xdecor_wood.png"},
sounds = xdecor.wood,
groups = {snappy=3},
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}
}
}
})
xdecor.register("chandelier", {
2015-06-25 18:25:36 +03:00
description = "Chandelier",
drawtype = "plantlike",
walkable = false,
inventory_image = "xdecor_chandelier.png",
tiles = {"xdecor_chandelier.png"},
groups = {dig_immediate=3},
light_source = 14
})
2015-06-10 14:26:04 +03:00
xdecor.register("coalstone_tile", {
2015-06-25 18:25:36 +03:00
drawtype = "normal",
description = "Coalstone Tile",
tiles = {"xdecor_coalstone_tile.png"},
groups = {snappy=2},
sounds = xdecor.stone
})
local colors = {"red"} -- Add more curtains colors simply here
for _, c in ipairs(colors) do
xdecor.register("curtain_"..c, {
description = "Curtain ("..c..")",
use_texture_alpha = true,
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",
drawtype = "signlike",
paramtype2 = "wallmounted",
groups = {dig_immediate=3},
selection_box = {type="wallmounted"},
on_rightclick = function(pos, node, clicker, itemstack)
local fdir = node.param2
minetest.set_node(pos, { name="xdecor:curtain_open_"..c, param2=fdir })
end
})
xdecor.register("curtain_open_"..c, {
tiles = { "xdecor_curtain_open.png^[colorize:"..c..":130" },
drawtype = "signlike",
paramtype2 = "wallmounted",
use_texture_alpha = true,
walkable = false,
groups = {dig_immediate=3, not_in_creative_inventory=1},
selection_box = {type="wallmounted"},
drop = "xdecor:curtain_"..c,
on_rightclick = function(pos, node, clicker, itemstack)
local fdir = node.param2
minetest.set_node(pos, { name="xdecor:curtain_"..c, param2=fdir })
end
})
minetest.register_craft({
output = "xdecor:curtain_"..c.." 4",
recipe = {
{"", "wool:"..c, ""},
{"", "wool:"..c, ""},
{"", "wool:"..c, ""}
}
})
2015-06-10 14:26:04 +03:00
end
xdecor.register("cushion", {
2015-06-25 18:25:36 +03:00
description = "Cushion",
tiles = {"xdecor_cushion.png"},
groups = {snappy=3},
on_place = minetest.rotate_node,
node_box = xdecor.nodebox.slab_y(-0.5, 0.5)
})
2015-07-02 16:26:19 +03:00
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
2015-06-11 01:09:37 +03:00
xdecor.register("empty_shelf", {
2015-06-25 18:25:36 +03:00
description = "Empty Shelf",
inventory = {size=24},
infotext = "Empty Shelf",
tiles = { "default_wood.png", "xdecor_empty_shelf.png" },
groups = {snappy=3},
sounds = xdecor.wood
})
local fence_sbox = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}
}
2015-06-10 14:26:04 +03:00
2015-06-10 15:43:14 +03:00
xdecor.register("fence_wrought_iron", {
2015-06-25 18:25:36 +03:00
description = "Wrought Iron Fence",
drawtype = "fencelike",
groups = {snappy=2},
2015-06-27 14:51:47 +03:00
tiles = { "xdecor_wrought_iron.png" },
2015-06-25 18:25:36 +03:00
selection_box = fence_sbox,
2015-06-27 14:51:47 +03:00
inventory_image = "default_fence_overlay.png^xdecor_wrought_iron.png^default_fence_overlay.png^[makealpha:255,126,126"
2015-06-25 18:25:36 +03:00
})
2015-06-10 14:26:04 +03:00
xdecor.register("fire", {
2015-06-25 18:25:36 +03:00
description = "Fake Fire",
light_source = 14,
walkable = false,
tiles = {
{ name = "xdecor_fire_anim.png",
animation = {type="vertical_frames", length=1.5} }
},
drawtype = "plantlike",
damage_per_second = 2,
drop = "",
groups = {dig_immediate=3, not_in_creative_inventory=1}
})
2015-06-10 14:26:04 +03:00
minetest.register_tool("xdecor:flint_steel", {
2015-06-25 18:25:36 +03:00
description = "Flint & Steel",
stack_max = 1,
inventory_image = "xdecor_flint_steel.png",
2015-06-25 18:25:36 +03:00
tool_capabilities = {
groupcaps = {
flamable = {uses=65, maxlevel=1}
}
},
2015-06-10 14:26:04 +03:00
on_use = function(itemstack, user, pointed_thing)
2015-06-16 19:47:29 +03:00
if pointed_thing.type == "node"
and minetest.get_node(pointed_thing.above).name == "air" then
2015-06-10 14:26:04 +03:00
if not minetest.is_protected(pointed_thing.above, user:get_player_name()) then
minetest.set_node(pointed_thing.above, {name="xdecor:fire"})
2015-06-16 19:47:29 +03:00
else
2015-06-25 18:25:36 +03:00
minetest.chat_send_player(user:get_player_name(), "This area is protected!")
end
else
return
end
2015-06-10 14:26:04 +03:00
itemstack:add_wear(65535/65)
return itemstack
2015-06-25 18:25:36 +03:00
end
})
2015-06-10 14:26:04 +03:00
xdecor.register("lantern", {
2015-06-25 18:25:36 +03:00
description = "Lantern",
light_source = 12,
drawtype = "torchlike",
inventory_image = "xdecor_lantern_floor.png",
wield_image = "xdecor_lantern_floor.png",
2015-06-25 18:25:36 +03:00
paramtype2 = "wallmounted",
legacy_wallmounted = true,
walkable = false,
groups = {dig_immediate=3, attached_node=1},
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},
wall_bottom = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25},
2015-06-25 18:25:36 +03:00
wall_side = {-0.5, -0.5, -0.15, 0.5, 0.5, 0.15}
}
})
2015-06-25 18:25:36 +03:00
local flowerstype = { "dandelion_white", "dandelion_yellow", "geranium",
"rose", "tulip", "viola" }
2015-06-10 14:26:04 +03:00
2015-06-25 18:25:36 +03:00
for _, f in ipairs(flowerstype) do
xdecor.register("potted_"..f, {
description = "Potted Flowers ("..f..")",
walkable = false,
groups = {dig_immediate=3},
tiles = {"xdecor_"..f.."_pot.png"},
inventory_image = "xdecor_"..f.."_pot.png",
drawtype = "plantlike",
sounds = xdecor.leaves
})
minetest.register_craft({
type = "shapeless", output = "xdecor:potted_"..f.." 2",
recipe = { "flowers:"..f, "xdecor:plant_pot" }
})
2015-06-10 14:26:04 +03:00
end
xdecor.register("painting", {
2015-06-25 18:25:36 +03:00
description = "Painting",
drawtype = "signlike",
tiles = {"xdecor_painting.png"},
inventory_image = "xdecor_painting.png",
paramtype2 = "wallmounted",
legacy_wallmounted = true,
walkable = false,
wield_image = "xdecor_painting.png",
selection_box = {type="wallmounted"},
groups = {dig_immediate=3, attached_node=1}
})
2015-06-10 14:26:04 +03:00
xdecor.register("plant_pot", {
2015-06-25 18:25:36 +03:00
description = "Plant Pot",
groups = {snappy=3},
tiles = {"xdecor_plant_pot_top.png", "xdecor_plant_pot_bottom.png",
"xdecor_plant_pot_sides.png"}
})
2015-06-10 14:26:04 +03:00
xdecor.register("metal_cabinet", {
2015-06-25 18:25:36 +03:00
description = "Metal Cabinet",
inventory = {size=24},
groups = {snappy=1},
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"
}
})
2015-06-10 14:26:04 +03:00
xdecor.register("moonbrick", {
2015-06-25 18:25:36 +03:00
drawtype = "normal",
description = "Moonbrick",
tiles = {"xdecor_moonbrick.png"},
groups = {snappy=2},
sounds = xdecor.stone
})
2015-06-10 14:26:04 +03:00
xdecor.register("multishelf", {
2015-06-25 18:25:36 +03:00
description = "Multi Shelf",
inventory = {size=24},
infotext = "Multi Shelf",
2015-06-10 14:26:04 +03:00
tiles = {"default_wood.png", "xdecor_multishelf.png"},
2015-06-25 18:25:36 +03:00
groups = {snappy=3},
sounds = xdecor.wood
})
local rope_sbox = {
type = "fixed",
fixed = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
}
2015-06-10 14:26:04 +03:00
xdecor.register("rope", {
2015-06-25 18:25:36 +03:00
description = "Rope",
walkable = false,
climbable = true,
groups = {dig_immediate=3},
selection_box = rope_sbox,
tiles = {"xdecor_rope.png"},
inventory_image = "xdecor_rope_inv.png",
wield_image = "xdecor_rope_inv.png",
drawtype = "plantlike"
})
xdecor.register("stereo", {
2015-06-25 18:25:36 +03:00
description = "Stereo",
groups = {snappy=3},
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"
}
})
2015-06-11 01:09:37 +03:00
xdecor.register("stone_rune", {
2015-06-25 18:25:36 +03:00
description = "Stone Rune",
tiles = {"xdecor_stone_rune.png"},
drawtype = "normal",
groups = {snappy=3},
sounds = xdecor.stone
})
2015-07-02 16:26:19 +03:00
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 }
}
})
2015-06-11 01:09:37 +03:00
xdecor.register("stone_tile", {
2015-06-25 18:25:36 +03:00
description = "Stone Tile",
tiles = {"xdecor_stone_tile.png"},
drawtype = "normal",
groups = {snappy=3},
sounds = xdecor.stone
})
2015-06-10 14:26:04 +03:00
xdecor.register("table", {
2015-06-25 18:25:36 +03:00
description = "Table",
tiles = {"xdecor_wood.png"},
groups = {snappy=3},
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}
}
}
})
2015-06-10 14:26:04 +03:00
2015-07-02 16:26:19 +03:00
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},
}
}
})
2015-06-10 14:26:04 +03:00
xdecor.register("tv", {
2015-06-25 18:25:36 +03:00
description = "Television",
light_source = 11,
groups = {snappy=3},
tiles = {
"xdecor_television_left.png^[transformR270",
"xdecor_television_left.png^[transformR90",
"xdecor_television_left.png^[transformFX",
2015-06-25 18:25:36 +03:00
"xdecor_television_left.png", "xdecor_television_back.png",
{ name = "xdecor_television_front_animated.png",
animation = {type="vertical_frames", length=80.0} }
}
})
2015-06-12 13:37:35 +03:00
xdecor.register("woodframed_glass", {
2015-06-25 18:25:36 +03:00
description = "Wood Framed Glass",
drawtype = "glasslike_framed",
tiles = { "xdecor_framed_glass.png", "xdecor_framed_glass_detail.png" },
groups = {snappy=3},
sounds = xdecor.glass
})
2015-06-10 14:26:04 +03:00
xdecor.register("wood_tile", {
2015-06-25 18:25:36 +03:00
description = "Wood Tile",
tiles = {"xdecor_wood_tile.png"},
drawtype = "normal",
groups = {snappy=2, wood=1},
sounds = xdecor.wood
})