2015-08-16 22:57:17 +03:00
|
|
|
local sound = {}
|
|
|
|
sound.wood = default.node_sound_wood_defaults()
|
|
|
|
sound.glass = default.node_sound_glass_defaults()
|
|
|
|
sound.leaves = default.node_sound_leaves_defaults()
|
|
|
|
sound.stone = default.node_sound_stone_defaults()
|
|
|
|
|
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",
|
2015-07-04 16:54:40 +03:00
|
|
|
textures = {"xdecor_bamboo_frame.png", "xdecor_bamboo_frame.png",
|
|
|
|
"xpanes_space.png"},
|
2015-07-02 16:26:19 +03:00
|
|
|
inventory_image = "xdecor_bamboo_frame.png",
|
|
|
|
wield_image = "xdecor_bamboo_frame.png",
|
2015-07-04 12:23:20 +03:00
|
|
|
groups = {snappy=3, pane=1, flammable=2},
|
2015-07-02 16:26:19 +03: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 12:23:20 +03:00
|
|
|
groups = {snappy=3, flammable=2},
|
2015-08-04 23:33:16 +03:00
|
|
|
damage_per_second = 4,
|
2015-08-16 22:14:01 +03:00
|
|
|
selection_box = xdecor.nodebox.slab_y(0.3)
|
2015-07-02 16:26:19 +03:00
|
|
|
})
|
|
|
|
|
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",
|
2015-07-04 16:54:40 +03:00
|
|
|
tiles = {"xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=3, flammable=2},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
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",
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=3, flammable=2},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood,
|
2015-06-25 18:25:36 +03:00
|
|
|
tiles = {
|
|
|
|
"default_wood.png", "default_wood.png",
|
|
|
|
"default_wood.png", "default_wood.png",
|
2015-07-05 19:25:53 +03:00
|
|
|
"default_wood.png", "xdecor_cabinet_front.png"
|
2015-06-25 18:25:36 +03:00
|
|
|
}
|
|
|
|
})
|
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",
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=3, flammable=3},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood,
|
2015-06-25 18:25:36 +03:00
|
|
|
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",
|
2015-08-17 21:19:58 +03:00
|
|
|
wield_image = "xdecor_candle_wield.png",
|
2015-06-25 18:25:36 +03:00
|
|
|
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",
|
2015-08-07 02:33:38 +03:00
|
|
|
sunlight_propagates = true,
|
2015-07-04 12:23:20 +03:00
|
|
|
groups = {snappy=3, flammable=3},
|
2015-07-04 16:54:40 +03:00
|
|
|
tiles = {"xdecor_cardbox_top.png", "xdecor_cardbox_top.png",
|
|
|
|
"xdecor_cardbox_sides.png"},
|
2015-06-25 18:25:36 +03:00
|
|
|
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",
|
2015-07-04 12:23:20 +03:00
|
|
|
groups = {cracky=1},
|
2015-06-25 18:25:36 +03:00
|
|
|
tiles = {
|
|
|
|
{ name = "xdecor_cauldron_top_anim.png",
|
2015-08-05 21:08:16 +03:00
|
|
|
animation = {type="vertical_frames", length=3.0} },
|
2015-06-25 18:25:36 +03:00
|
|
|
"xdecor_cauldron_sides.png"
|
|
|
|
}
|
|
|
|
})
|
2015-06-10 14:26:04 +03:00
|
|
|
|
2015-07-05 19:25:53 +03:00
|
|
|
if minetest.get_modpath("bucket") then
|
|
|
|
local original_bucket_on_use = minetest.registered_items["bucket:bucket_empty"].on_use
|
|
|
|
minetest.override_item("bucket:bucket_empty", {
|
|
|
|
on_use = function(itemstack, user, pointed_thing)
|
|
|
|
local inv = user:get_inventory()
|
2015-08-03 13:53:02 +03:00
|
|
|
local player = user:get_player_name()
|
|
|
|
|
2015-07-05 19:25:53 +03:00
|
|
|
if pointed_thing.type == "node" and
|
2015-07-30 00:55:01 +03:00
|
|
|
minetest.get_node(pointed_thing.under).name == "xdecor:cauldron" then
|
2015-07-05 19:25:53 +03:00
|
|
|
if inv:room_for_item("main", "bucket:bucket_water 1") then
|
|
|
|
itemstack:take_item()
|
|
|
|
inv:add_item("main", "bucket:bucket_water 1")
|
|
|
|
else
|
2015-08-03 13:53:02 +03:00
|
|
|
minetest.chat_send_player(player, "No enough room in your inventory.")
|
2015-07-05 19:25:53 +03:00
|
|
|
end
|
|
|
|
return itemstack
|
|
|
|
else if original_bucket_on_use then
|
|
|
|
return original_bucket_on_use(itemstack, user, pointed_thing)
|
|
|
|
else return end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2015-08-16 13:30:54 +03:00
|
|
|
xpanes.register_pane("chainlink", {
|
|
|
|
description = "Chain Link",
|
|
|
|
tiles = {"xdecor_chainlink.png"},
|
|
|
|
drawtype = "airlike",
|
|
|
|
paramtype = "light",
|
|
|
|
textures = {"xdecor_chainlink.png", "xdecor_chainlink.png",
|
|
|
|
"xpanes_space.png"},
|
|
|
|
inventory_image = "xdecor_chainlink.png",
|
|
|
|
wield_image = "xdecor_chainlink.png",
|
|
|
|
groups = {snappy=3, pane=1},
|
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot", "", "default:steel_ingot"},
|
|
|
|
{"", "default:steel_ingot", ""},
|
|
|
|
{"default:steel_ingot", "", "default:steel_ingot"}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
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"},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood,
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=3, flammable=2},
|
2015-08-07 02:33:38 +03:00
|
|
|
sunlight_propagates = true,
|
2015-06-25 18:25:36 +03: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}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2015-06-11 23:06:54 +03:00
|
|
|
|
|
|
|
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},
|
2015-08-04 23:33:16 +03:00
|
|
|
light_source = 14,
|
|
|
|
selection_box = xdecor.nodebox.slab_y(0.5, 0.5)
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
2015-06-10 14:26:04 +03:00
|
|
|
|
2015-07-05 19:25:53 +03:00
|
|
|
xdecor.register("cobweb", {
|
|
|
|
description = "Cobweb",
|
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"xdecor_cobweb.png"},
|
|
|
|
inventory_image = "xdecor_cobweb.png",
|
|
|
|
liquid_viscosity = 8,
|
|
|
|
liquidtype = "source",
|
|
|
|
liquid_alternative_flowing = "xdecor:cobweb",
|
|
|
|
liquid_alternative_source = "xdecor:cobweb",
|
|
|
|
liquid_renewable = false,
|
|
|
|
liquid_range = 0,
|
|
|
|
walkable = false,
|
2015-07-28 23:08:23 +03:00
|
|
|
selection_box = {type = "regular"},
|
2015-07-05 19:25:53 +03:00
|
|
|
groups = {dig_immediate=3, liquid=3, flammable=3},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.leaves
|
2015-07-05 19:25:53 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
local colors = {"red"} -- Add more curtains colors simply here.
|
2015-06-25 18:25:36 +03:00
|
|
|
|
2015-08-05 21:08:16 +03:00
|
|
|
for _, c in pairs(colors) do
|
2015-06-25 18:25:36 +03:00
|
|
|
xdecor.register("curtain_"..c, {
|
2015-08-21 16:47:51 +03:00
|
|
|
description = c:gsub("%l", string.upper, 1).." Curtain",
|
2015-06-25 18:25:36 +03:00
|
|
|
use_texture_alpha = true,
|
|
|
|
walkable = false,
|
2015-07-04 16:54:40 +03:00
|
|
|
tiles = {"xdecor_curtain.png^[colorize:"..c..":130"},
|
2015-06-25 18:25:36 +03: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 12:23:20 +03:00
|
|
|
groups = {dig_immediate=3, flammable=3},
|
2015-06-25 18:25:36 +03:00
|
|
|
selection_box = {type="wallmounted"},
|
2015-08-23 01:12:26 +03:00
|
|
|
on_rightclick = function(pos, node, _, _)
|
2015-07-05 19:25:53 +03:00
|
|
|
minetest.set_node(pos, {name="xdecor:curtain_open_"..c, param2=node.param2})
|
2015-06-25 18:25:36 +03:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
xdecor.register("curtain_open_"..c, {
|
2015-07-04 16:54:40 +03:00
|
|
|
tiles = {"xdecor_curtain_open.png^[colorize:"..c..":130"},
|
2015-06-25 18:25:36 +03:00
|
|
|
drawtype = "signlike",
|
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
use_texture_alpha = true,
|
|
|
|
walkable = false,
|
2015-07-04 12:23:20 +03:00
|
|
|
groups = {dig_immediate=3, flammable=3, not_in_creative_inventory=1},
|
2015-06-25 18:25:36 +03:00
|
|
|
selection_box = {type="wallmounted"},
|
|
|
|
drop = "xdecor:curtain_"..c,
|
2015-08-23 01:12:26 +03:00
|
|
|
on_rightclick = function(pos, node, _, _)
|
2015-07-05 19:25:53 +03:00
|
|
|
minetest.set_node(pos, {name="xdecor:curtain_"..c, param2=node.param2})
|
2015-06-25 18:25:36 +03:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "xdecor:curtain_"..c.." 4",
|
|
|
|
recipe = {
|
|
|
|
{"", "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"},
|
2015-07-05 19:25:53 +03:00
|
|
|
groups = {snappy=3, flammable=3, fall_damage_add_percent=-50},
|
2015-06-25 18:25:36 +03:00
|
|
|
on_place = minetest.rotate_node,
|
|
|
|
node_box = xdecor.nodebox.slab_y(-0.5, 0.5)
|
|
|
|
})
|
2015-06-11 23:06:54 +03:00
|
|
|
|
2015-08-16 14:24:57 +03:00
|
|
|
local function door_access(door)
|
|
|
|
if door:find("prison") then return true end
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
local door_types = {
|
|
|
|
{"japanese", "brown"},
|
|
|
|
{"prison", "grey"},
|
|
|
|
{"prison_rust", "rust"},
|
|
|
|
{"screen", "brownb"},
|
|
|
|
{"slide", "brownc"},
|
|
|
|
{"woodglass", "brown"}
|
|
|
|
}
|
2015-07-02 16:26:19 +03:00
|
|
|
|
|
|
|
for _, d in pairs(door_types) do
|
2015-08-16 14:24:57 +03:00
|
|
|
doors.register_door("xdecor:"..d[1].."_door", {
|
|
|
|
description = d[1]:gsub("%l", string.upper, 1).." Door",
|
|
|
|
inventory_image = "xdecor_"..d[1].."_door_inv.png",
|
2015-08-03 13:53:02 +03:00
|
|
|
groups = {choppy=3, flammable=2, door=1},
|
2015-08-16 14:24:57 +03:00
|
|
|
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]),
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood,
|
2015-08-16 14:24:57 +03:00
|
|
|
sunlight = false
|
2015-07-02 16:26:19 +03:00
|
|
|
})
|
|
|
|
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",
|
2015-07-04 16:54:40 +03:00
|
|
|
tiles = {"default_wood.png", "xdecor_empty_shelf.png"},
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=3, flammable=2},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
|
|
|
|
2015-07-05 17:40:33 +03:00
|
|
|
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"
|
|
|
|
},
|
|
|
|
groups = {cracky=2},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.stone,
|
2015-07-05 17:40:33 +03:00
|
|
|
on_construct = function(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
2015-08-17 12:50:32 +03:00
|
|
|
local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots
|
2015-07-05 17:40:33 +03:00
|
|
|
meta:set_string("formspec",
|
2015-08-17 12:50:32 +03:00
|
|
|
"size[8,9]"..xbg..
|
2015-07-05 17:40:33 +03:00
|
|
|
"list[current_player;enderchest;0,0;8,4;]"..
|
|
|
|
"list[current_player;main;0,5;8,4;]")
|
|
|
|
meta:set_string("infotext", "Ender Chest")
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_on_joinplayer(function(player)
|
|
|
|
local inv = player:get_inventory()
|
|
|
|
inv:set_size("enderchest", 8*4)
|
|
|
|
end)
|
|
|
|
|
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",
|
2015-07-04 12:23:20 +03:00
|
|
|
groups = {cracky=2},
|
2015-07-04 16:54:40 +03:00
|
|
|
tiles = {"xdecor_wrought_iron.png"},
|
2015-08-07 02:33:38 +03:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}
|
|
|
|
},
|
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-07-04 12:23:20 +03:00
|
|
|
description = "Fancy Fire",
|
2015-08-07 02:33:38 +03:00
|
|
|
drawtype = "plantlike",
|
2015-06-25 18:25:36 +03:00
|
|
|
light_source = 14,
|
|
|
|
walkable = false,
|
|
|
|
tiles = {
|
|
|
|
{ name = "xdecor_fire_anim.png",
|
|
|
|
animation = {type="vertical_frames", length=1.5} }
|
|
|
|
},
|
|
|
|
damage_per_second = 2,
|
|
|
|
drop = "",
|
2015-08-03 13:53:02 +03:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-1/3.5, -1/2, -1/3.5, 1/3.5, -1/2+2/16, 1/3.5}
|
|
|
|
},
|
2015-07-04 12:23:20 +03:00
|
|
|
groups = {dig_immediate=3, hot=3, not_in_creative_inventory=1}
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
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",
|
2015-06-11 23:06:54 +03:00
|
|
|
inventory_image = "xdecor_flint_steel.png",
|
2015-06-25 18:25:36 +03:00
|
|
|
tool_capabilities = {
|
2015-08-07 16:10:42 +03:00
|
|
|
groupcaps = { igniter = {uses=10, maxlevel=1} }
|
2015-06-25 18:25:36 +03:00
|
|
|
},
|
2015-06-10 14:26:04 +03:00
|
|
|
on_use = function(itemstack, user, pointed_thing)
|
2015-08-03 13:53:02 +03:00
|
|
|
local player = user:get_player_name()
|
2015-07-05 19:25:53 +03:00
|
|
|
if pointed_thing.type == "node" and
|
2015-07-30 00:55:01 +03:00
|
|
|
minetest.get_node(pointed_thing.above).name == "air" then
|
2015-08-03 13:53:02 +03:00
|
|
|
if not minetest.is_protected(pointed_thing.above, player) then
|
2015-06-10 14:26:04 +03:00
|
|
|
minetest.set_node(pointed_thing.above, {name="xdecor:fire"})
|
2015-06-16 19:47:29 +03:00
|
|
|
else
|
2015-08-03 13:53:02 +03:00
|
|
|
minetest.chat_send_player(player, "This area is protected.")
|
2015-06-25 18:25:36 +03:00
|
|
|
end
|
2015-08-03 13:53:02 +03:00
|
|
|
else return end
|
2015-06-10 14:26:04 +03:00
|
|
|
|
2015-08-07 16:10:42 +03:00
|
|
|
itemstack:add_wear(1000)
|
2015-06-10 14:26:04 +03:00
|
|
|
return itemstack
|
2015-06-25 18:25:36 +03:00
|
|
|
end
|
|
|
|
})
|
2015-06-10 14:26:04 +03:00
|
|
|
|
2015-07-30 00:55:01 +03:00
|
|
|
minetest.register_tool("xdecor:hammer", {
|
|
|
|
description = "Hammer",
|
2015-08-21 16:47:51 +03:00
|
|
|
inventory_image = "xdecor_hammer.png",
|
2015-08-23 01:12:26 +03:00
|
|
|
wield_image = "xdecor_hammer.png",
|
|
|
|
on_use = function(_,_,_) do return end end
|
2015-07-30 00:55:01 +03:00
|
|
|
})
|
|
|
|
|
2015-07-04 14:20:00 +03:00
|
|
|
xdecor.register("ivy", {
|
|
|
|
description = "Ivy",
|
|
|
|
drawtype = "signlike",
|
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
groups = {dig_immediate=3, flammable=2, plant=1},
|
|
|
|
paramtype2 = "wallmounted",
|
2015-07-05 19:25:53 +03:00
|
|
|
selection_box = {type="wallmounted"},
|
2015-07-04 14:20:00 +03:00
|
|
|
legacy_wallmounted = true,
|
|
|
|
tiles = {"xdecor_ivy.png"},
|
|
|
|
inventory_image = "xdecor_ivy.png",
|
|
|
|
wield_image = "xdecor_ivy.png",
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.leaves
|
2015-07-04 14:20:00 +03:00
|
|
|
})
|
|
|
|
|
2015-06-11 23:06:54 +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",
|
2015-06-11 23:06:54 +03:00
|
|
|
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},
|
2015-07-04 16:54:40 +03:00
|
|
|
tiles = {"xdecor_lantern_floor.png", "xdecor_lantern_ceiling.png",
|
|
|
|
"xdecor_lantern.png"},
|
2015-06-25 18:25:36 +03:00
|
|
|
selection_box = {
|
|
|
|
type = "wallmounted",
|
2015-06-11 23:06:54 +03:00
|
|
|
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-11 23:06:54 +03:00
|
|
|
|
2015-08-08 01:37:31 +03:00
|
|
|
xdecor.register("lightbox", {
|
|
|
|
description = "Light Box",
|
|
|
|
tiles = {"xdecor_lightbox.png"},
|
|
|
|
groups = {cracky=3},
|
|
|
|
light_source = 13,
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.glass
|
2015-08-08 01:37:31 +03:00
|
|
|
})
|
|
|
|
|
2015-08-17 21:35:32 +03:00
|
|
|
xdecor.register("packed_ice", {
|
|
|
|
drawtype = "normal",
|
|
|
|
description = "Packed Ice",
|
|
|
|
tiles = {"xdecor_packed_ice.png"},
|
|
|
|
groups = {cracky=2},
|
|
|
|
sounds = sound.glass
|
|
|
|
})
|
|
|
|
|
2015-06-25 18:25:36 +03:00
|
|
|
local flowerstype = { "dandelion_white", "dandelion_yellow", "geranium",
|
2015-07-29 14:52:39 +03:00
|
|
|
"rose", "tulip", "viola" }
|
2015-06-10 14:26:04 +03:00
|
|
|
|
2015-08-05 21:08:16 +03:00
|
|
|
for _, f in pairs(flowerstype) do
|
2015-06-25 18:25:36 +03:00
|
|
|
xdecor.register("potted_"..f, {
|
|
|
|
description = "Potted Flowers ("..f..")",
|
|
|
|
walkable = false,
|
2015-07-05 02:38:12 +03:00
|
|
|
groups = {dig_immediate=3, flammable=3, plant=1, flower=1},
|
2015-06-25 18:25:36 +03:00
|
|
|
tiles = {"xdecor_"..f.."_pot.png"},
|
|
|
|
inventory_image = "xdecor_"..f.."_pot.png",
|
|
|
|
drawtype = "plantlike",
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.leaves,
|
2015-08-16 22:14:01 +03:00
|
|
|
selection_box = xdecor.nodebox.slab_y(0.3)
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2015-08-21 18:23:36 +03:00
|
|
|
output = "xdecor:potted_"..f,
|
2015-07-05 19:25:53 +03:00
|
|
|
recipe = {
|
2015-08-21 18:23:36 +03:00
|
|
|
{"default:clay_brick", "flowers:"..f, "default:clay_brick"},
|
|
|
|
{"", "default:clay_brick", ""}
|
2015-07-05 19:25:53 +03:00
|
|
|
}
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
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"},
|
2015-07-04 12:23:20 +03:00
|
|
|
groups = {dig_immediate=3, flammable=2, attached_node=1}
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
2015-06-10 14:26:04 +03:00
|
|
|
|
|
|
|
xdecor.register("plant_pot", {
|
2015-06-25 18:25:36 +03:00
|
|
|
description = "Plant Pot",
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {snappy=3},
|
2015-06-25 18:25:36 +03:00
|
|
|
tiles = {"xdecor_plant_pot_top.png", "xdecor_plant_pot_bottom.png",
|
|
|
|
"xdecor_plant_pot_sides.png"}
|
|
|
|
})
|
2015-06-10 14:26:04 +03:00
|
|
|
|
2015-06-11 23:06:54 +03:00
|
|
|
xdecor.register("metal_cabinet", {
|
2015-06-25 18:25:36 +03:00
|
|
|
description = "Metal Cabinet",
|
|
|
|
inventory = {size=24},
|
2015-08-23 20:04:09 +03:00
|
|
|
groups = {snappy=3},
|
2015-06-25 18:25:36 +03: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-11 23:06:54 +03:00
|
|
|
|
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-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=3, flammable=2},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
|
|
|
|
2015-07-05 02:38:12 +03:00
|
|
|
xpanes.register_pane("rust_bar", {
|
|
|
|
description = "Rust Bars",
|
|
|
|
tiles = {"xdecor_rust_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",
|
2015-08-23 20:04:09 +03:00
|
|
|
groups = {snappy=3, pane=1},
|
2015-07-05 02:38:12 +03:00
|
|
|
recipe = {
|
2015-08-17 00:40:10 +03:00
|
|
|
{"", "default:dirt", ""},
|
|
|
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
|
|
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
|
2015-07-05 02:38:12 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2015-06-11 23:06:54 +03:00
|
|
|
xdecor.register("stereo", {
|
2015-06-25 18:25:36 +03:00
|
|
|
description = "Stereo",
|
2015-08-23 20:04:09 +03:00
|
|
|
groups = {snappy=3},
|
2015-06-25 18:25:36 +03: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-11 23:06:54 +03:00
|
|
|
|
2015-07-02 16:26:19 +03:00
|
|
|
xdecor.register("stonepath", {
|
|
|
|
description = "Garden Stone Path",
|
2015-07-04 12:23:20 +03:00
|
|
|
tiles = {"default_stone.png"},
|
|
|
|
groups = {snappy=3, stone=1},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.stone,
|
2015-08-07 02:33:38 +03:00
|
|
|
sunlight_propagates = true,
|
2015-07-02 16:26:19 +03:00
|
|
|
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}
|
|
|
|
}
|
|
|
|
},
|
2015-08-16 22:14:01 +03:00
|
|
|
selection_box = xdecor.nodebox.slab_y(0.05)
|
2015-07-02 16:26:19 +03:00
|
|
|
})
|
|
|
|
|
2015-08-21 18:08:18 +03:00
|
|
|
local stonish = {"desertstone_tile", "stone_tile", "stone_rune",
|
|
|
|
"coalstone_tile", "moonbrick", "hard_clay"}
|
|
|
|
|
|
|
|
for _, t in pairs(stonish) do
|
|
|
|
xdecor.register(t, {
|
2015-06-25 18:25:36 +03:00
|
|
|
drawtype = "normal",
|
2015-08-21 18:08:18 +03:00
|
|
|
description = string.sub(t:gsub("%l", string.upper, 1), 1, -6)
|
|
|
|
.." "..t:sub(-4):gsub("%l", string.upper, 1),
|
|
|
|
tiles = {"xdecor_"..t..".png"},
|
|
|
|
groups = {cracky=2},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.stone
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
2015-08-21 18:08:18 +03:00
|
|
|
end
|
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"},
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=3, flammable=2},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood,
|
2015-06-25 18:25:36 +03:00
|
|
|
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"},
|
2015-08-04 17:12:23 +03:00
|
|
|
wield_image = "xdecor_tatami.png",
|
2015-07-04 12:23:20 +03:00
|
|
|
groups = {snappy=3, flammable=2},
|
2015-07-02 16:26:19 +03:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2015-07-05 19:25:53 +03:00
|
|
|
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
|
2015-07-02 16:26:19 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2015-07-05 17:40:33 +03:00
|
|
|
xdecor.register("trash_can", {
|
|
|
|
description = "Trash Can",
|
|
|
|
tiles = {"xdecor_wood.png"},
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=3, flammable=2},
|
2015-08-07 02:33:38 +03:00
|
|
|
sunlight_propagates = true,
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood,
|
2015-07-05 17:40:33 +03:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.3125, -0.5, 0.3125, 0.3125, 0.5, 0.375},
|
|
|
|
{0.3125, -0.5, -0.375, 0.375, 0.5, 0.375},
|
|
|
|
{-0.3125, -0.5, -0.375, 0.3125, 0.5, -0.3125},
|
|
|
|
{-0.375, -0.5, -0.375, -0.3125, 0.5, 0.375},
|
|
|
|
{-0.3125, -0.5, -0.3125, 0.3125, -0.4375, 0.3125}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
collision_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2015-08-04 18:18:38 +03:00
|
|
|
{-0.375, -0.5, -0.375, 0.375, 0.19, 0.375}
|
2015-07-05 17:40:33 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
on_construct = function(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
2015-08-07 02:33:38 +03:00
|
|
|
meta:set_string("infotext", "Trash Can - throw your waste here.")
|
2015-07-05 17:40:33 +03:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Thanks to Evergreen for this code.
|
|
|
|
local old_on_step = minetest.registered_entities["__builtin:item"].on_step
|
|
|
|
minetest.registered_entities["__builtin:item"].on_step = function(self, dtime)
|
|
|
|
if minetest.get_node(self.object:getpos()).name == "xdecor:trash_can" then
|
|
|
|
self.object:remove()
|
|
|
|
return
|
|
|
|
end
|
|
|
|
old_on_step(self, dtime)
|
|
|
|
end
|
|
|
|
|
2015-06-10 14:26:04 +03:00
|
|
|
xdecor.register("tv", {
|
2015-06-25 18:25:36 +03:00
|
|
|
description = "Television",
|
|
|
|
light_source = 11,
|
2015-08-23 20:04:09 +03:00
|
|
|
groups = {snappy=3},
|
2015-06-11 23:06:54 +03:00
|
|
|
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",
|
2015-07-04 16:54:40 +03:00
|
|
|
tiles = {"xdecor_framed_glass.png", "xdecor_framed_glass_detail.png"},
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {cracky=3},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.glass
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|
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",
|
2015-08-03 00:47:02 +03:00
|
|
|
groups = {choppy=2, wood=1, flammable=2},
|
2015-08-16 22:05:01 +03:00
|
|
|
sounds = sound.wood
|
2015-06-25 18:25:36 +03:00
|
|
|
})
|