function btmt.register_stained_glass (name_glass,desc_glass,tiles_glass,material_dye)
core.register_node(name_glass, {
    description = desc_glass.." Stained Glass",
    --inventory_image = tiles_glass.."^frame_color_glasses.png",
    tiles = {tiles_glass.."^frame_color_glasses.png"},   
    drawtype = "nodebox",
    walkable = true,
    paramtype = "light",
    sunlight_propagates = true,  
    use_texture_alpha = "blend",
    is_ground_content = false,
    paramtype2 = "wallmounted", 
    groups = {cracky = 3, oddly_breakable_by_hand = 3,glass=1},
    sounds = default.node_sound_glass_defaults(),
    node_box = {
        type = "fixed",
        fixed = {        
            {-0.5, -0.5, -0.5, 0.5, 0.5 ,0.5}, 
         }}      
})
 
core.register_craft({
    --type = "shaped",
    output = name_glass.." 8",
    recipe = {
        {"default:glass","default:glass","default:glass"},
        {"default:glass",material_dye,"default:glass"},
        {"default:glass","default:glass","default:glass"},
    }
})
end

btmt.register_stained_glass("btmt:white_glass","White","white_glass.png","dye:white")
btmt.register_stained_glass("btmt:grey_glass","Grey","grey_glass.png","dye:grey")
btmt.register_stained_glass("btmt:dark_grey_glass","Dark Grey","dark_grey_glass.png","dye:dark_grey")
btmt.register_stained_glass("btmt:black_glass","Black","black_glass.png","dye:black")
btmt.register_stained_glass("btmt:violet_glass","Violet","violet_glass.png","dye:violet")
btmt.register_stained_glass("btmt:blue_glass","Blue","blue_glass.png","dye:blue")
btmt.register_stained_glass("btmt:cyan_glass","Cyan","cyan_glass.png","dye:cyan")
btmt.register_stained_glass("btmt:dark_green_glass","Dark Green","dark_green_glass.png","dye:dark_green")
btmt.register_stained_glass("btmt:green_glass","Green","green_glass.png","dye:green")
btmt.register_stained_glass("btmt:yellow_glass","Yellow","yellow_glass.png","dye:yellow")
btmt.register_stained_glass("btmt:brown_glass","Brown","brown_glass.png","dye:brown")
btmt.register_stained_glass("btmt:orange_glass","Orange","orange_glass.png","dye:orange")
btmt.register_stained_glass("btmt:red_glass","Red","red_glass.png","dye:red")
btmt.register_stained_glass("btmt:magenta_glass","Magenta","magenta_glass.png","dye:magenta")
btmt.register_stained_glass("btmt:pink_glass","Pink","pink_glass.png","dye:pink")

---- PANE:
function btmt.register_pane_glass (name_glass,desc_glass,tiles_glass,material_glass)
core.register_node(name_glass.."_pane", {
    description = desc_glass.." Stained Glass Pane",
    inventory_image = tiles_glass.."^frame_color_glasses.png",
    wield_image = tiles_glass.."^frame_color_glasses.png",
    tiles = {tiles_glass.."^frame_color_glasses.png"},   
    drawtype = "nodebox",
    walkable = true,
    paramtype = "light",
    paramtype2 = "facedir",
    sunlight_propagates = true,  
    use_texture_alpha = "blend",
    is_ground_content = false,
    paramtype2 = "wallmounted", 
    groups = {cracky = 3, oddly_breakable_by_hand = 3,glass=1},
    sounds = default.node_sound_glass_defaults(),
    node_box = {
        type = "fixed",
        fixed = {        
            {-0.5, -0.5, -0.05, 0.5, 0.5 ,0.05}, 
         }}      
})
 
core.register_craft({
    --type = "shaped",
    output = name_glass.."_pane 6",
    recipe = {
        {material_glass,material_glass,material_glass},
        {material_glass,material_glass,material_glass},
    }
})
end

 btmt.register_pane_glass("btmt:white_glass","White","white_glass.png","btmt:white_glass")
 btmt.register_pane_glass("btmt:grey_glass","Grey","grey_glass.png","btmt:grey_glass")
 btmt.register_pane_glass("btmt:dark_grey_glass","Dark Grey","dark_grey_glass.png","btmt:dark_grey_glass")
 btmt.register_pane_glass("btmt:black_glass","Black","black_glass.png","btmt:black_glass")
 btmt.register_pane_glass("btmt:violet_glass","Violet","violet_glass.png","btmt:violet_glass")
 btmt.register_pane_glass("btmt:blue_glass","Blue","blue_glass.png","btmt:blue_glass")
 btmt.register_pane_glass("btmt:cyan_glass","Cyan","cyan_glass.png","btmt:cyan_glass")
 btmt.register_pane_glass("btmt:dark_green_glass","Dark Green","dark_green_glass.png","btmt:dark_green_glass")
 btmt.register_pane_glass("btmt:green_glass","Green","green_glass.png","btmt:green_glass")
 btmt.register_pane_glass("btmt:yellow_glass","Yellow","yellow_glass.png","btmt:yellow_glass")
 btmt.register_pane_glass("btmt:brown_glass","Brown","brown_glass.png","btmt:brown_glass")
 btmt.register_pane_glass("btmt:orange_glass","Orange","orange_glass.png","btmt:orange_glass")
 btmt.register_pane_glass("btmt:red_glass","Red","red_glass.png","btmt:red_glass")
 btmt.register_pane_glass("btmt:magenta_glass","Magenta","magenta_glass.png","btmt:magenta_glass")
 btmt.register_pane_glass("btmt:pink_glass","Pink","pink_glass.png","btmt:pink_glass")
 
 
