Use new doors API from upstream

This commit is contained in:
Jean-Patrick Guerrero 2016-02-13 19:18:55 +01:00
parent 84358fc489
commit 3fa408300a
27 changed files with 31 additions and 32 deletions

View File

@ -227,28 +227,23 @@ xdecor.register("cushion_block", {
drop = "xdecor:cushion 2" drop = "xdecor:cushion 2"
}) })
local function door_access(door) local function door_access(door) return door:find("prison") end
return door:sub(1,6) == "prison"
end
local door_types = { for _, d in pairs({"japanese", "prison", "rusty_prison",
{"japanese", "brown"}, {"prison", "grey"}, {"prison_rust", "rust"}, "screen", "slide", "woodglass"}) do
{"screen", "brownb"}, {"slide", "brownc"}, {"woodglass", "brown"} doors.register(d.."_door", {
} tiles = {{name = "xdecor_"..d.."_door.png", backface_culling=true}},
description = string.gsub(" "..d, "%W%l", string.upper):sub(2):gsub("_", " ").." Door",
for _, d in pairs(door_types) do inventory_image = "xdecor_"..d.."_door_inv.png",
doors.register_door("xdecor:"..d[1].."_door", { protected = door_access(d),
description = string.gsub(" "..d[1], "%W%l", string.upper):sub(2):gsub("_", " ").." Door",
inventory_image = "xdecor_"..d[1].."_door_inv.png",
groups = {choppy=3, cracky=3, oddly_breakable_by_hand=1, flammable=2, door=1}, 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"}, material = ""
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
}) })
minetest.register_alias("xdecor:"..d.."_door", "doors:"..d.."_door")
end end
minetest.register_alias("xdecor:prison_rust_door", "doors:rusty_prison_door")
xdecor.register("empty_shelf", { xdecor.register("empty_shelf", {
description = "Empty Shelf", description = "Empty Shelf",
inventory = {size=24}, inventory = {size=24},
@ -452,14 +447,14 @@ xdecor.register("multishelf", {
sounds = default.node_sound_wood_defaults() sounds = default.node_sound_wood_defaults()
}) })
xpanes.register_pane("rust_bar", { xpanes.register_pane("rusty_bar", {
description = "Rust Bars", description = "Rusty Iron Bars",
tiles = {"xdecor_rust_bars.png"}, tiles = {"xdecor_rusty_bars.png"},
drawtype = "airlike", drawtype = "airlike",
paramtype = "light", paramtype = "light",
textures = {"xdecor_rust_bars.png", "xdecor_rust_bars.png", "xpanes_space.png"}, textures = {"xdecor_rusty_bars.png", "xdecor_rusty_bars.png", "xpanes_space.png"},
inventory_image = "xdecor_rust_bars.png", inventory_image = "xdecor_rusty_bars.png",
wield_image = "xdecor_rust_bars.png", wield_image = "xdecor_rusty_bars.png",
groups = {cracky=3, oddly_breakable_by_hand=2, pane=1}, groups = {cracky=3, oddly_breakable_by_hand=2, pane=1},
recipe = { recipe = {
{"", "default:dirt", ""}, {"", "default:dirt", ""},
@ -467,6 +462,10 @@ xpanes.register_pane("rust_bar", {
{"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", { xdecor.register("stonepath", {
description = "Garden Stone Path", description = "Garden Stone Path",

View File

@ -216,7 +216,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = "xdecor:japanese_door", output = "doors:japanese_door",
recipe = { recipe = {
{"group:wood", "default:paper"}, {"group:wood", "default:paper"},
{"default:paper", "group:wood"}, {"default:paper", "group:wood"},
@ -267,7 +267,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = "xdecor:prison_door", output = "doors:prison_door",
recipe = { recipe = {
{"xpanes:bar", "xpanes:bar"}, {"xpanes:bar", "xpanes:bar"},
{"xpanes:bar", "xpanes:bar"}, {"xpanes:bar", "xpanes:bar"},
@ -276,11 +276,11 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = "xdecor:prison_rust_door", output = "doors:rusty_prison_door",
recipe = { recipe = {
{"xpanes:rust_bar", "xpanes:rust_bar"}, {"xpanes:rusty_bar", "xpanes:rusty_bar"},
{"xpanes:rust_bar", "xpanes:rust_bar"}, {"xpanes:rusty_bar", "xpanes:rusty_bar"},
{"xpanes:rust_bar", "xpanes:rust_bar"} {"xpanes:rusty_bar", "xpanes:rusty_bar"}
} }
}) })
@ -294,7 +294,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = "xdecor:screen_door", output = "doors:screen_door",
recipe = { recipe = {
{"group:wood", "group:wood"}, {"group:wood", "group:wood"},
{"xpanes:chainlink", "xpanes:chainlink"}, {"xpanes:chainlink", "xpanes:chainlink"},
@ -303,7 +303,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = "xdecor:slide_door", output = "doors:slide_door",
recipe = { recipe = {
{"default:paper", "default:paper"}, {"default:paper", "default:paper"},
{"default:paper", "default:paper"}, {"default:paper", "default:paper"},
@ -398,7 +398,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = "xdecor:woodglass_door", output = "doors:woodglass_door",
recipe = { recipe = {
{"default:glass", "default:glass"}, {"default:glass", "default:glass"},
{"group:wood", "group:wood"}, {"group:wood", "group:wood"},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

View File

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

View File

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B