More accurate worktable's nodeboxes definitions
This commit is contained in:
parent
e7b6e7660d
commit
c55e098c54
@ -462,8 +462,8 @@ for mod, n in pairs(nodes) do
|
|||||||
for _, name in pairs(n) do
|
for _, name in pairs(n) do
|
||||||
local ndef = minetest.registered_nodes[mod..":"..name]
|
local ndef = minetest.registered_nodes[mod..":"..name]
|
||||||
if ndef then
|
if ndef then
|
||||||
local groups = {}
|
local groups, tiles, light = {}, {}
|
||||||
groups.not_in_creative_inventory=1
|
groups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
for k, v in pairs(ndef.groups) do
|
for k, v in pairs(ndef.groups) do
|
||||||
if k ~= "wood" and k ~= "stone" and k ~= "level" then
|
if k ~= "wood" and k ~= "stone" and k ~= "level" then
|
||||||
@ -471,14 +471,24 @@ for _, name in pairs(n) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if #ndef.tiles > 1 and not ndef.drawtype:find("glass") then
|
||||||
|
tiles = ndef.tiles
|
||||||
|
else
|
||||||
|
tiles = {ndef.tiles[1]}
|
||||||
|
end
|
||||||
|
|
||||||
|
if ndef.light_source > 3 then
|
||||||
|
light = ndef.light_source - 1
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_node(":"..mod..":"..name.."_"..d[1], {
|
minetest.register_node(":"..mod..":"..name.."_"..d[1], {
|
||||||
description = ndef.description.." "..d[1]:gsub("^%l", string.upper),
|
description = ndef.description.." "..d[1]:gsub("^%l", string.upper),
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
light_source = ndef.light_source,
|
light_source = light,
|
||||||
sounds = ndef.sounds,
|
sounds = ndef.sounds,
|
||||||
tiles = {ndef.tiles[1]},
|
tiles = tiles,
|
||||||
groups = groups,
|
groups = groups,
|
||||||
node_box = {type = "fixed", fixed = d[3]},
|
node_box = {type = "fixed", fixed = d[3]},
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
|
Loading…
Reference in New Issue
Block a user