moreblocks/stairsplus/registrations.lua
Auke Kok f92a938d75 Prevent glass slabs from becoming transparent on sides/bottom.
For all glasslike drawtype nodes, the tiles contain up to 2
textures. The second texture is for "connected" glass, but that
likely is a transparent texture. If we use the `tiles` def without
modification, we will make all those slabs/slopes transparent on all
sides except the top.

To fix, we remove the tiles[2] from the tiledef in case the node is
a glasslike drawtype.
2016-02-19 13:35:36 -08:00

64 lines
1.2 KiB
Lua

--[[
More Blocks: registrations
Copyright (c) 2011-2015 Calinou and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]
local default_nodes = { -- Default stairs/slabs/panels/microblocks:
"stone",
"cobble",
"mossycobble",
"brick",
"sandstone",
"steelblock",
"goldblock",
"copperblock",
"bronzeblock",
"diamondblock",
"desert_stone",
"desert_cobble",
"meselamp",
"glass",
"tree",
"wood",
"jungletree",
"junglewood",
"pine_tree",
"pine_wood",
"acacia_tree",
"acacia_wood",
"obsidian",
"obsidian_glass",
"stonebrick",
"desert_stonebrick",
"sandstonebrick",
"obsidianbrick",
}
for _, name in pairs(default_nodes) do
local nodename = "default:" .. name
local ndef = minetest.registered_nodes[nodename]
if ndef then
local drop
if type(ndef.drop) == "string" then
drop = ndef.drop:sub(9)
end
local tiles = ndef.tiles
if #ndef.tiles > 1 and ndef.drawtype:find("glass") then
tiles = { ndef.tiles[1] }
end
stairsplus:register_all("moreblocks", name, nodename, {
description = ndef.description,
drop = drop,
groups = ndef.groups,
sounds = ndef.sounds,
tiles = tiles,
sunlight_propagates = true,
light_source = ndef.light_source
})
end
end