Add new nodes and tweaks

This commit is contained in:
jp 2015-07-02 15:26:19 +02:00
parent c7ff35ba1b
commit 84ab2967be
20 changed files with 225 additions and 1 deletions

View File

@ -1,3 +1,12 @@
minetest.register_craft({
output = "xdecor:baricade",
recipe = {
{"group:stick", "default:steel_ingot", "group:stick"},
{"", "group:stick", ""},
{"group:stick", "", "group:stick"}
}
})
minetest.register_craft({ minetest.register_craft({
output = "xdecor:candle", output = "xdecor:candle",
recipe = { recipe = {
@ -139,6 +148,15 @@ minetest.register_craftitem("xdecor:hammer", {
inventory_image = "xdecor_hammer.png" inventory_image = "xdecor_hammer.png"
}) })
minetest.register_craft({
output = "xdecor:japanese_door",
recipe = {
{"group:wood", "group:wood"},
{"default:paper", "default:paper"},
{"group:wood", "group:wood"}
}
})
minetest.register_craft({ minetest.register_craft({
output = "xdecor:lantern", output = "xdecor:lantern",
recipe = { recipe = {
@ -148,6 +166,15 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = "xdecor:mailbox",
recipe = {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"dye:red", "default:paper", "dye:red"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
}
})
minetest.register_craft({ minetest.register_craft({
output = "xdecor:metal_cabinet", output = "xdecor:metal_cabinet",
recipe = { recipe = {
@ -210,6 +237,15 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = "xdecor:stonepath 16",
recipe = {
{"stairs:slab_stone", "", "stairs:slab_stone"},
{"", "stairs:slab_stone", ""},
{"stairs:slab_stone", "", "stairs:slab_stone"}
}
})
minetest.register_craft({ minetest.register_craft({
output = "xdecor:table", output = "xdecor:table",
recipe = { recipe = {
@ -219,6 +255,13 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = "xdecor:tatami",
recipe = {
{"farming:wheat", "farming:wheat", "farming:wheat"}
}
})
minetest.register_craft({ minetest.register_craft({
output = "xdecor:tv", output = "xdecor:tv",
recipe = { recipe = {
@ -253,3 +296,12 @@ minetest.register_craft({
{"group:wood", "group:wood"} {"group:wood", "group:wood"}
} }
}) })
minetest.register_craft({
output = "xdecor:woodglass_door",
recipe = {
{"default:glass", "default:glass"},
{"group:wood", "group:wood"},
{"group:wood", "group:wood"}
}
})

View File

@ -1,2 +1,3 @@
default default
moreblocks? doors
xpanes

View File

@ -5,5 +5,6 @@ dofile(modpath.."/handlers/nodeboxes.lua")
dofile(modpath.."/handlers/registration.lua") dofile(modpath.."/handlers/registration.lua")
dofile(modpath.."/crafts.lua") dofile(modpath.."/crafts.lua")
dofile(modpath.."/itemframes.lua") dofile(modpath.."/itemframes.lua")
dofile(modpath.."/mailbox.lua")
dofile(modpath.."/nodes.lua") dofile(modpath.."/nodes.lua")
dofile(modpath.."/worktable.lua") dofile(modpath.."/worktable.lua")

89
mailbox.lua Normal file
View File

@ -0,0 +1,89 @@
xdecor.register("mailbox", {
description = "Mailbox",
tiles = {
"xdecor_mailbox_top.png", "xdecor_mailbox_bottom.png",
"xdecor_mailbox_side.png", "xdecor_mailbox_side.png",
"xdecor_mailbox.png", "xdecor_mailbox.png",
},
groups = {snappy=3},
after_place_node = function(pos, placer, itemstack)
local meta = minetest.get_meta(pos)
local owner = placer:get_player_name()
meta:set_string("owner", owner)
meta:set_string("infotext", owner.."'s Mailbox")
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
inv:set_size("drop", 1)
end,
on_rightclick = function(pos, node, clicker, itemstack)
local meta = minetest.get_meta(pos)
local player = clicker:get_player_name()
local owner = meta:get_string("owner")
local meta = minetest.get_meta(pos)
if owner == player then
minetest.show_formspec(
clicker:get_player_name(),
"default:chest_locked",
xdecor.get_mailbox_formspec(pos))
else
minetest.show_formspec(
clicker:get_player_name(),
"default:chest_locked",
xdecor.get_mailbox_insert_formspec(pos))
end
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
return player:get_player_name() == owner and inv:is_empty("main")
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if listname == "drop" and inv:room_for_item("main", stack) then
inv:remove_item("drop", stack)
inv:add_item("main", stack)
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == "main" then
return 0
end
if listname == "drop" then
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:room_for_item("main", stack) then
return -1
else
return 0
end
end
end,
})
function xdecor.get_mailbox_formspec(pos)
local spos = pos.x..","..pos.y..","..pos.z
local formspec =
"size[8,9]"..xdecor.fancy_gui..
"label[0,0;You received...]"..
"list[nodemeta:"..spos..";main;0,0.75;8,4;]"..
"list[current_player;main;0,5.25;8,4;]"
return formspec
end
function xdecor.get_mailbox_insert_formspec(pos)
local spos = pos.x..","..pos.y..","..pos.z
local formspec =
"size[8,5]"..xdecor.fancy_gui..
"label[0,0;Send your goods...]"..
"list[nodemeta:"..spos..";drop;3.5,0;1,1;]"..
"list[current_player;main;0,1.25;8,4;]"
return formspec
end

View File

@ -1,3 +1,31 @@
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
})
xdecor.register("barrel", { xdecor.register("barrel", {
description = "Barrel", description = "Barrel",
inventory = {size=24}, inventory = {size=24},
@ -171,6 +199,20 @@ xdecor.register("cushion", {
node_box = xdecor.nodebox.slab_y(-0.5, 0.5) node_box = xdecor.nodebox.slab_y(-0.5, 0.5)
}) })
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
xdecor.register("empty_shelf", { xdecor.register("empty_shelf", {
description = "Empty Shelf", description = "Empty Shelf",
inventory = {size=24}, inventory = {size=24},
@ -358,6 +400,30 @@ xdecor.register("stone_rune", {
sounds = xdecor.stone sounds = xdecor.stone
}) })
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 }
}
})
xdecor.register("stone_tile", { xdecor.register("stone_tile", {
description = "Stone Tile", description = "Stone Tile",
tiles = {"xdecor_stone_tile.png"}, tiles = {"xdecor_stone_tile.png"},
@ -380,6 +446,18 @@ xdecor.register("table", {
} }
}) })
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},
}
}
})
xdecor.register("tv", { xdecor.register("tv", {
description = "Television", description = "Television",
light_source = 11, light_source = 11,

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

BIN
textures/xdecor_brown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

BIN
textures/xdecor_mailbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

BIN
textures/xdecor_tatami.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

View File

@ -146,6 +146,9 @@ local function name(mat)
elseif string.find(mat, "brick") then elseif string.find(mat, "brick") then
local newname = string.gsub(mat, "(brick)", "_%1") local newname = string.gsub(mat, "(brick)", "_%1")
return "default_"..newname..".png" return "default_"..newname..".png"
elseif string.find(mat, "tree") then
local newname = string.gsub(mat, "(tree)", "%1_top")
return "default_"..newname..".png"
else else
return "default_"..mat..".png" return "default_"..mat..".png"
end end