This commit is contained in:
jp 2015-06-25 22:46:40 +02:00
parent d3cde805aa
commit dc5a030bc2

View File

@ -13,36 +13,25 @@ local material = {
local def = { -- Node name, yield, nodebox shape. local def = { -- Node name, yield, nodebox shape.
{ "nanoslab", "16", { "nanoslab", "16",
{-0.5, -0.5, -0.5, 0, -0.4375, 0} {-0.5, -0.5, -0.5, 0, -0.4375, 0} },
},
{ "micropanel", "16", { "micropanel", "16",
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0} {-0.5, -0.5, -0.5, 0.5, -0.4375, 0} },
},
{ "microslab", "8", { "microslab", "8",
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5} {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5} },
},
{ "panel", "4", { "panel", "4",
{-0.5, -0.5, -0.5, 0.5, 0, 0} {-0.5, -0.5, -0.5, 0.5, 0, 0} },
},
{ "slab", "2", { "slab", "2",
{-0.5, -0.5, -0.5, 0.5, 0, 0.5} {-0.5, -0.5, -0.5, 0.5, 0, 0.5} },
},
{ "outerstair", "1", { { "outerstair", "1", {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0, 0.5, 0.5} {-0.5, 0, 0, 0, 0.5, 0.5} } },
}
},
{ "stair", "1", { { "stair", "1", {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5} {-0.5, 0, 0, 0.5, 0.5, 0.5} } },
}
},
{ "innerstair", "1", { { "innerstair", "1", {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5}, {-0.5, 0, 0, 0.5, 0.5, 0.5},
{-0.5, 0, -0.5, 0, 0.5, 0} {-0.5, 0, -0.5, 0, 0.5, 0} } }
}
}
} }
local function xconstruct(pos) local function xconstruct(pos)
@ -113,13 +102,14 @@ local function xdig(pos, player)
or not inv:is_empty("fuel") or not inv:is_empty("src") then or not inv:is_empty("fuel") or not inv:is_empty("src") then
return false return false
end end
return true return true
end end
xdecor.register("worktable", { xdecor.register("worktable", {
description = "Work Table", description = "Work Table",
groups = {snappy=3}, groups = {snappy=3},
sounds = default.node_sound_wood_defaults(), sounds = xdecor.wood,
tiles = { tiles = {
"xdecor_worktable_top.png", "xdecor_worktable_top.png", "xdecor_worktable_top.png", "xdecor_worktable_top.png",
"xdecor_worktable_sides.png", "xdecor_worktable_sides.png", "xdecor_worktable_sides.png", "xdecor_worktable_sides.png",
@ -130,7 +120,7 @@ xdecor.register("worktable", {
can_dig = xdig can_dig = xdig
}) })
local function lightlvl(mat) local function light(mat)
if (mat == "meselamp") then if (mat == "meselamp") then
return 12 return 12
else else
@ -138,7 +128,7 @@ local function lightlvl(mat)
end end
end end
local function stype(mat) local function sound(mat)
if string.find(mat, "glass") or string.find(mat, "lamp") if string.find(mat, "glass") or string.find(mat, "lamp")
or string.find(mat, "ice") then or string.find(mat, "ice") then
return default.node_sound_glass_defaults() return default.node_sound_glass_defaults()
@ -149,7 +139,7 @@ local function stype(mat)
end end
end end
local function tnaming(mat) local function name(mat)
if string.find(mat, "block") then if string.find(mat, "block") then
local newname = string.gsub(mat, "(block)", "_%1") local newname = string.gsub(mat, "(block)", "_%1")
return "default_"..newname..".png" return "default_"..newname..".png"
@ -163,9 +153,9 @@ end
for m=1, #material do for m=1, #material do
local v = material[m] local v = material[m]
local light = lightlvl(v) local light = light(v)
local sound = stype(v) local sound = sound(v)
local tile = tnaming(v) local tile = name(v)
for n=1, #def do for n=1, #def do
local w = def[n] local w = def[n]
@ -185,7 +175,7 @@ for m=1, #material do
end end
end end
minetest.register_abm({ -- Repair Tool's code by Krock, modified by kilbith minetest.register_abm({ -- Repair Tool's code by Krock, modified by kilbith.
nodenames = {"xdecor:worktable"}, nodenames = {"xdecor:worktable"},
interval = 5, chance = 1, interval = 5, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)