unified_inventory needs 'description' to show nodes

master
Och Noe 2019-05-27 15:18:44 +02:00
parent 5694bb1dfb
commit 62ffd2258b
2 changed files with 101 additions and 100 deletions

201
init.lua
View File

@ -181,113 +181,114 @@ end
for nr = 1,#path_names do
for _,lengths in pairs(woodpath_lengths) do
local b = lengths[1] -- "back" in 1/10 nodes
local f = lengths[2] -- "front" in 1/10 nodes
local h = string.format(":"..path_names[nr] .."path_track_%02d%02d",b,f)
local h2 = string.format(":"..path_names[nr] .."path_track_narrow_%02d%02d",b,f)
for _,lengths in pairs(woodpath_lengths) do
local b = lengths[1] -- "back" in 1/10 nodes
local f = lengths[2] -- "front" in 1/10 nodes
local h = string.format(":"..path_names[nr] .."path_track_%02d%02d",b,f)
local h2 = string.format(":"..path_names[nr] .."path_track_narrow_%02d%02d",b,f)
minetest.register_node(own_name..h,
{
tiles = { tile_name[nr], },
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box =
{
type = "fixed",
fixed = {
-- schmal {-0.4, -0.5, b/-10, 0.4, -0.4, f/10},
{-0.5, -0.5, b/-10, 0.5, -0.4, f/10},
}
},
groups = {choppy = 2, oddly_breakable_by_hand = 2,
not_blocking_trains = 1},
sounds = sound_name[nr],
on_place = minetest.rotate_node,
})
minetest.register_node(own_name..h,
{
tiles = { tile_name[nr], },
description = h,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box =
{
type = "fixed",
fixed = {
{-0.5, -0.5, b/-10, 0.5, -0.4, f/10},
}
},
groups = {choppy = 2, oddly_breakable_by_hand = 2,
not_blocking_trains = 1},
sounds = sound_name[nr],
on_place = minetest.rotate_node,
})
minetest.register_node(own_name..h2,
{
tiles = { tile_name[nr], },
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box =
{
type = "fixed",
fixed = {
{-0.4, -0.5, b/-10, 0.4, -0.4, f/10},
}
},
groups = {choppy = 2, oddly_breakable_by_hand = 2,
not_blocking_trains = 1},
sounds = sound_name[nr],
on_place = minetest.rotate_node,
})
minetest.register_node(own_name..h2,
{
tiles = { tile_name[nr], },
description = h2,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box =
{
type = "fixed",
fixed = {
{-0.4, -0.5, b/-10, 0.4, -0.4, f/10},
}
},
groups = {choppy = 2, oddly_breakable_by_hand = 2,
not_blocking_trains = 1},
sounds = sound_name[nr],
on_place = minetest.rotate_node,
})
local craft = { { "","","" } , { "","","" } , { "","","" } }
craft[3][2] = adv_track
for y = 2,1,-1
do
if (b>=5) and (f>=5) then
b = b-5
f = f-5
craft[y][2] = full_wood[nr]
local craft = { { "","","" } , { "","","" } , { "","","" } }
craft[3][2] = adv_track
for y = 2,1,-1
do
if (b>=5) and (f>=5) then
b = b-5
f = f-5
craft[y][2] = full_wood[nr]
end
end
for y = 2,1,-1
do
if (b>=10) then
b = b-10
craft[y][1] = full_wood[nr]
elseif (b>=5) then
b = b-5
craft[y][1] = half_wood[nr]
end
if (f>=10) then
f = f-10
craft[y][3] = full_wood[nr]
elseif (f>=5) then
f = f-5
craft[y][3] = half_wood[nr]
end
end
-- if (b>0) or (f>0) then
-- print(h.." b: "..b.." f: "..f)
-- else
-- t_aus = ""
-- for y=1,3 do
-- for x=1,3 do
-- t_aus = t_aus .. craft[y][x] .. ", "
-- end
-- end
-- print(h..t_aus)
-- end
minetest.register_craft({
output = own_name..h,
recipe = craft,
replacements = { {adv_track,adv_track}, }
})
minetest.register_craft({
output = own_name..h2,
recipe = { { own_name..h } },
})
end
for y = 2,1,-1
do
if (b>=10) then
b = b-10
craft[y][1] = full_wood[nr]
elseif (b>=5) then
b = b-5
craft[y][1] = half_wood[nr]
end
if (f>=10) then
f = f-10
craft[y][3] = full_wood[nr]
elseif (f>=5) then
f = f-5
craft[y][3] = half_wood[nr]
end
end
-- if (b>0) or (f>0) then
-- print(h.." b: "..b.." f: "..f)
-- else
-- t_aus = ""
-- for y=1,3 do
-- for x=1,3 do
-- t_aus = t_aus .. craft[y][x] .. ", "
-- end
-- end
-- print(h..t_aus)
-- end
minetest.register_craft({
output = own_name..h,
recipe = craft,
replacements = { {adv_track,adv_track}, }
})
minetest.register_craft({
output = own_name..h2,
recipe = { { own_name..h } },
})
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 691 B