--[[Migrate to the levels mod. Use an ABM or LBM to convert all the nodes to the new versions.]]
minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:floor'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:floor_1'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:floor_two'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:floor_2'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:floor_three'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:floor_3'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:floor_four'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:floor_4'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:floor_five'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:floor_5'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:floor_six'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:floor_6'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:floor_seven'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:floor_7'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:vent'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:metal_17'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:caution_block'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:floor_8'})
   end
})

minetest.register_abm({
   label = 'buildingblock transformation',
   nodenames = {'buildingblocks:wall'},
   interval = 10,
   chance = 1,
   action = function(pos)
      minetest.set_node(pos, {name='levels:scifi_20'})
   end
})




minetest.register_node('buildingblocks:blue_box', {
   description = 'Blue Box',
   tiles = {'bb_blue_box_top.png',
      'bb_blue_box_top.png',
      'bb_blue_box_side.png'},
   groups = {breakable=1},
})

minetest.register_node('buildingblocks:green_box', {
   description = 'Green Box',
   tiles = {'bb_green_box_top.png',
      'bb_green_box_top.png',
      'bb_green_box_side.png',},
   groups = {breakable=1},
})

minetest.register_node('buildingblocks:red_box', {
   description = 'Red Box',
   tiles = {'bb_red_box_top.png',
      'bb_red_box_top.png',
      'bb_red_box_side.png'},
   groups = {breakable=1},
})
