local glazier_table_functions = simplecrafting_lib.generate_table_functions('glazier', {
   show_guides = true,
   alphabetize_items = true})

local glazier_table_def = {
   description = 'Glazier Station',
   drawtype = 'mesh',
   mesh = 'stations_glazier.obj',
   tiles = {'stations_glazier.png'},
   use_texture_alpha = 'opaque',
   sounds = default.node_sound_wood_defaults(),
   paramtype2 = 'facedir',
   paramtype = 'light',
   selection_box = {
      type = 'fixed',
      fixed = {-.4, -.5, -.4, .4, .25, .4},
      },
   collision_box = {
      type = 'fixed',
      fixed = {-.4, -.5, -.4, .4, .25, .4},
      },
   groups = {oddly_breakable_by_hand = 1, choppy=3},
   after_place_node = function(pos)
      local meta = minetest.get_meta(pos)
      meta:set_string('infotext', 'Glazier Workshop')
   end,
}
for k, v in pairs(glazier_table_functions) do
   glazier_table_def[k] = v
end

minetest.register_node('stations:glazier_workshop', glazier_table_def)


local glazier_table_locked_functions = simplecrafting_lib.generate_table_functions('glazier', {
   show_guides = true,
   alphabetize_items = true,
   protect_inventory = true})

local glazier_table_locked_def = {
   description = 'Glazier Station (locked)',
   drawtype = 'mesh',
   mesh = 'stations_glazier.obj',
   tiles = {'stations_glazier.png'},
   use_texture_alpha = 'opaque',
   sounds = default.node_sound_wood_defaults(),
   paramtype2 = 'facedir',
   paramtype = 'light',
   selection_box = {
      type = 'fixed',
      fixed = {-.4, -.5, -.4, .4, .25, .4},
      },
   collision_box = {
      type = 'fixed',
      fixed = {-.4, -.5, -.4, .4, .25, .4},
      },
   groups = {oddly_breakable_by_hand = 1, choppy=3},
   after_place_node = function(pos)
      local meta = minetest.get_meta(pos)
      meta:set_string('infotext', 'Glazier Workshop (locked)')
   end,
}
for k, v in pairs(glazier_table_locked_functions) do
   glazier_table_locked_def[k] = v
end

minetest.register_node('stations:glazier_workshop_locked', glazier_table_locked_def)

local is_uninv = minetest.global_exists("unified_inventory") or false
if is_uninv then
   unified_inventory.register_craft_type("glazier", {
      description = "Glazier Station",
      icon = 'stations_glazier_icon.png',
      width = 4,
      height = 2,
      uses_crafting_grid = false
   })
end
