xdecor/nodes.lua

488 lines
13 KiB
Lua
Raw Normal View History

2015-07-02 06:26:19 -07: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"},
2015-07-02 06:26:19 -07:00
inventory_image = "xdecor_bamboo_frame.png",
wield_image = "xdecor_bamboo_frame.png",
2015-07-04 02:23:20 -07:00
groups = {snappy=3, pane=1, flammable=2},
2015-07-02 06:26:19 -07:00
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"},
2015-07-04 02:23:20 -07:00
groups = {snappy=3, flammable=2},
2015-07-02 06:26:19 -07:00
damage_per_second = 4
})
2015-06-10 04:26:04 -07:00
xdecor.register("barrel", {
2015-06-25 08:25:36 -07:00
description = "Barrel",
inventory = {size=24},
infotext = "Barrel",
tiles = {"xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
2015-07-04 02:23:20 -07:00
groups = {choppy=3, flammable=2},
2015-06-25 08:25:36 -07:00
sounds = xdecor.wood
})
2015-06-10 04:26:04 -07:00
xdecor.register("cabinet", {
2015-06-25 08:25:36 -07:00
description = "Cabinet",
inventory = {size=24},
infotext = "Cabinet",
2015-07-04 02:23:20 -07:00
groups = {choppy=3},
2015-06-25 08:25:36 -07:00
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 04:26:04 -07:00
xdecor.register("cabinet_half", {
2015-06-25 08:25:36 -07:00
description = "Half Cabinet",
inventory = {size=8},
infotext = "Half Cabinet",
2015-07-04 02:23:20 -07:00
groups = {choppy=3, flammable=2},
2015-06-25 08:25:36 -07:00
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 04:26:04 -07:00
xdecor.register("candle", {
2015-06-25 08:25:36 -07: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 04:26:04 -07:00
xdecor.register("cardboard_box", {
2015-06-25 08:25:36 -07:00
description = "Cardboard Box",
inventory = {size=8},
infotext = "Cardboard Box",
2015-07-04 02:23:20 -07:00
groups = {snappy=3, flammable=3},
tiles = {"xdecor_cardbox_top.png", "xdecor_cardbox_top.png",
"xdecor_cardbox_sides.png"},
2015-06-25 08:25:36 -07:00
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.5, -0.3125, 0.3125, 0, 0.3125}
}
}
})
2015-06-10 04:26:04 -07:00
xdecor.register("cauldron", {
2015-06-25 08:25:36 -07:00
description = "Cauldron",
2015-07-04 02:23:20 -07:00
groups = {cracky=1},
2015-06-25 08:25:36 -07:00
tiles = {
{ name = "xdecor_cauldron_top_anim.png",
animation = {type="vertical_frames", length=3.0} },
"xdecor_cauldron_sides.png"
}
})
2015-06-10 04:26:04 -07:00
xdecor.register("chair", {
2015-06-25 08:25:36 -07:00
description = "Chair",
tiles = {"xdecor_wood.png"},
sounds = xdecor.wood,
2015-07-04 02:23:20 -07:00
groups = {choppy=3, flammable=2},
2015-06-25 08:25:36 -07:00
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 08:25:36 -07: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 04:26:04 -07:00
xdecor.register("coalstone_tile", {
2015-06-25 08:25:36 -07:00
drawtype = "normal",
description = "Coalstone Tile",
tiles = {"xdecor_coalstone_tile.png"},
2015-07-04 02:23:20 -07:00
groups = {cracky=2, stone=1},
2015-06-25 08:25:36 -07:00
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"},
2015-06-25 08:25:36 -07:00
inventory_image = "xdecor_curtain_open.png^[colorize:"..c..":130",
wield_image = "xdecor_curtain.png^[colorize:"..c..":130",
drawtype = "signlike",
paramtype2 = "wallmounted",
2015-07-04 02:23:20 -07:00
groups = {dig_immediate=3, flammable=3},
2015-06-25 08:25:36 -07:00
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"},
2015-06-25 08:25:36 -07:00
drawtype = "signlike",
paramtype2 = "wallmounted",
use_texture_alpha = true,
walkable = false,
2015-07-04 02:23:20 -07:00
groups = {dig_immediate=3, flammable=3, not_in_creative_inventory=1},
2015-06-25 08:25:36 -07:00
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 04:26:04 -07:00
end
xdecor.register("cushion", {
2015-06-25 08:25:36 -07:00
description = "Cushion",
tiles = {"xdecor_cushion.png"},
2015-07-04 02:23:20 -07:00
groups = {snappy=3, flammable=3, fall_damage_add_percent = -50},
2015-06-25 08:25:36 -07:00
on_place = minetest.rotate_node,
node_box = xdecor.nodebox.slab_y(-0.5, 0.5)
})
2015-07-02 06:26:19 -07: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",
2015-07-04 02:23:20 -07:00
groups = {choppy=3, flammable=2, door=1},
2015-07-02 06:26:19 -07:00
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-10 15:09:37 -07:00
xdecor.register("empty_shelf", {
2015-06-25 08:25:36 -07:00
description = "Empty Shelf",
inventory = {size=24},
infotext = "Empty Shelf",
tiles = {"default_wood.png", "xdecor_empty_shelf.png"},
2015-07-04 02:23:20 -07:00
groups = {choppy=3, flammable=2},
2015-06-25 08:25:36 -07:00
sounds = xdecor.wood
})
local fence_sbox = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}
}
2015-06-10 04:26:04 -07:00
2015-06-10 05:43:14 -07:00
xdecor.register("fence_wrought_iron", {
2015-06-25 08:25:36 -07:00
description = "Wrought Iron Fence",
drawtype = "fencelike",
2015-07-04 02:23:20 -07:00
groups = {cracky=2},
tiles = {"xdecor_wrought_iron.png"},
2015-06-25 08:25:36 -07:00
selection_box = fence_sbox,
2015-06-27 04:51:47 -07:00
inventory_image = "default_fence_overlay.png^xdecor_wrought_iron.png^default_fence_overlay.png^[makealpha:255,126,126"
2015-06-25 08:25:36 -07:00
})
2015-06-10 04:26:04 -07:00
xdecor.register("fire", {
2015-07-04 02:23:20 -07:00
description = "Fancy Fire",
2015-06-25 08:25:36 -07:00
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 = "",
2015-07-04 02:23:20 -07:00
groups = {dig_immediate=3, hot=3, not_in_creative_inventory=1}
2015-06-25 08:25:36 -07:00
})
2015-06-10 04:26:04 -07:00
minetest.register_tool("xdecor:flint_steel", {
2015-06-25 08:25:36 -07:00
description = "Flint & Steel",
stack_max = 1,
inventory_image = "xdecor_flint_steel.png",
2015-06-25 08:25:36 -07:00
tool_capabilities = {
groupcaps = {
flamable = {uses=65, maxlevel=1}
}
},
2015-06-10 04:26:04 -07:00
on_use = function(itemstack, user, pointed_thing)
2015-06-16 09:47:29 -07:00
if pointed_thing.type == "node"
and minetest.get_node(pointed_thing.above).name == "air" then
2015-06-10 04:26:04 -07: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 09:47:29 -07:00
else
2015-06-25 08:25:36 -07:00
minetest.chat_send_player(user:get_player_name(), "This area is protected!")
end
else
return
end
2015-06-10 04:26:04 -07:00
itemstack:add_wear(65535/65)
return itemstack
2015-06-25 08:25:36 -07:00
end
})
2015-06-10 04:26:04 -07:00
2015-07-04 04:20:00 -07:00
xdecor.register("ivy", {
description = "Ivy",
drawtype = "signlike",
walkable = false,
climbable = true,
groups = {dig_immediate=3, flammable=2, plant=1},
paramtype2 = "wallmounted",
selection_box = { type="wallmounted" },
legacy_wallmounted = true,
tiles = {"xdecor_ivy.png"},
inventory_image = "xdecor_ivy.png",
wield_image = "xdecor_ivy.png",
sounds = xdecor.leaves
})
xdecor.register("lantern", {
2015-06-25 08:25:36 -07:00
description = "Lantern",
light_source = 12,
drawtype = "torchlike",
inventory_image = "xdecor_lantern_floor.png",
wield_image = "xdecor_lantern_floor.png",
2015-06-25 08:25:36 -07: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"},
2015-06-25 08:25:36 -07:00
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 08:25:36 -07:00
wall_side = {-0.5, -0.5, -0.15, 0.5, 0.5, 0.15}
}
})
2015-06-25 08:25:36 -07:00
local flowerstype = { "dandelion_white", "dandelion_yellow", "geranium",
"rose", "tulip", "viola" }
2015-06-10 04:26:04 -07:00
2015-06-25 08:25:36 -07:00
for _, f in ipairs(flowerstype) do
xdecor.register("potted_"..f, {
description = "Potted Flowers ("..f..")",
walkable = false,
2015-07-04 02:23:20 -07:00
groups = {dig_immediate=3, flammable=3, plant=1},
2015-06-25 08:25:36 -07:00
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 04:26:04 -07:00
end
xdecor.register("painting", {
2015-06-25 08:25:36 -07: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"},
2015-07-04 02:23:20 -07:00
groups = {dig_immediate=3, flammable=2, attached_node=1}
2015-06-25 08:25:36 -07:00
})
2015-06-10 04:26:04 -07:00
xdecor.register("plant_pot", {
2015-06-25 08:25:36 -07:00
description = "Plant Pot",
2015-07-04 02:23:20 -07:00
groups = {cracky=3},
2015-06-25 08:25:36 -07:00
tiles = {"xdecor_plant_pot_top.png", "xdecor_plant_pot_bottom.png",
"xdecor_plant_pot_sides.png"}
})
2015-06-10 04:26:04 -07:00
xdecor.register("metal_cabinet", {
2015-06-25 08:25:36 -07:00
description = "Metal Cabinet",
inventory = {size=24},
2015-07-04 02:23:20 -07:00
groups = {cracky=2},
2015-06-25 08:25:36 -07:00
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 04:26:04 -07:00
xdecor.register("moonbrick", {
2015-06-25 08:25:36 -07:00
drawtype = "normal",
description = "Moonbrick",
tiles = {"xdecor_moonbrick.png"},
2015-07-04 02:23:20 -07:00
groups = {cracky=2},
2015-06-25 08:25:36 -07:00
sounds = xdecor.stone
})
2015-06-10 04:26:04 -07:00
xdecor.register("multishelf", {
2015-06-25 08:25:36 -07:00
description = "Multi Shelf",
inventory = {size=24},
infotext = "Multi Shelf",
2015-06-10 04:26:04 -07:00
tiles = {"default_wood.png", "xdecor_multishelf.png"},
2015-07-04 02:23:20 -07:00
groups = {choppy=3, flammable=2},
2015-06-25 08:25:36 -07:00
sounds = xdecor.wood
})
xdecor.register("stereo", {
2015-06-25 08:25:36 -07:00
description = "Stereo",
2015-07-04 02:23:20 -07:00
groups = {snappy=2},
2015-06-25 08:25:36 -07:00
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-10 15:09:37 -07:00
xdecor.register("stone_rune", {
2015-06-25 08:25:36 -07:00
description = "Stone Rune",
tiles = {"xdecor_stone_rune.png"},
drawtype = "normal",
2015-07-04 02:23:20 -07:00
groups = {cracky=2, stone=1},
2015-06-25 08:25:36 -07:00
sounds = xdecor.stone
})
2015-07-02 06:26:19 -07:00
xdecor.register("stonepath", {
description = "Garden Stone Path",
2015-07-04 02:23:20 -07:00
tiles = {"default_stone.png"},
groups = {snappy=3, stone=1},
2015-07-02 06:26:19 -07:00
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",
2015-07-04 02:23:20 -07:00
fixed = {-0.4375, -0.5, -0.4375, 0.4375, -0.4, 0.4375}
2015-07-02 06:26:19 -07:00
}
})
2015-06-10 15:09:37 -07:00
xdecor.register("stone_tile", {
2015-06-25 08:25:36 -07:00
description = "Stone Tile",
tiles = {"xdecor_stone_tile.png"},
drawtype = "normal",
2015-07-04 02:23:20 -07:00
groups = {cracky=2, stone=1},
2015-06-25 08:25:36 -07:00
sounds = xdecor.stone
})
2015-06-10 04:26:04 -07:00
xdecor.register("table", {
2015-06-25 08:25:36 -07:00
description = "Table",
tiles = {"xdecor_wood.png"},
2015-07-04 02:23:20 -07:00
groups = {choppy=3, flammable=2},
2015-06-25 08:25:36 -07:00
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 04:26:04 -07:00
2015-07-02 06:26:19 -07:00
xdecor.register("tatami", {
description = "Tatami",
tiles = {"xdecor_tatami.png"},
2015-07-04 02:23:20 -07:00
groups = {snappy=3, flammable=2},
2015-07-02 06:26:19 -07:00
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
}
}
})
2015-06-10 04:26:04 -07:00
xdecor.register("tv", {
2015-06-25 08:25:36 -07:00
description = "Television",
light_source = 11,
2015-07-04 02:23:20 -07:00
groups = {snappy=2},
tiles = {
"xdecor_television_left.png^[transformR270",
"xdecor_television_left.png^[transformR90",
"xdecor_television_left.png^[transformFX",
2015-06-25 08:25:36 -07: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 03:37:35 -07:00
xdecor.register("woodframed_glass", {
2015-06-25 08:25:36 -07:00
description = "Wood Framed Glass",
drawtype = "glasslike_framed",
tiles = {"xdecor_framed_glass.png", "xdecor_framed_glass_detail.png"},
2015-07-04 02:23:20 -07:00
groups = {cracky=3},
2015-06-25 08:25:36 -07:00
sounds = xdecor.glass
})
2015-06-10 04:26:04 -07:00
xdecor.register("wood_tile", {
2015-06-25 08:25:36 -07:00
description = "Wood Tile",
tiles = {"xdecor_wood_tile.png"},
drawtype = "normal",
2015-07-04 02:23:20 -07:00
groups = {choppy=2, wood=1, flammable=2},
2015-06-25 08:25:36 -07:00
sounds = xdecor.wood
})