code:
-- Geomoria plans.lua
-- Copyright Duane Robertson (duane@duanerobertson.com), 2017
-- Distributed under the LGPLv2.1 (https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)

-- Rotation:
-- 0 Z+   1 X+   2 Z-   3 X-
-- ladders:  2 X+   3 X-   4 Z+   5 Z-

local placeholder_y51 = {
  {act = 'fill', node = 'air', coords = {0, 80, 51, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 51, 3, 0, 80}},
}

local p = {
  {act = 'fill', node = 'air', line = 'default:stone_block', treasure = 1, coords = {1, 78, 21, 38, 1, 78}},
  {act = 'fill', node = 'default:stone_block', coords = {1, 78, 50, 1, 1, 78}},
  {act = 'fill', node = 'air', coords = {5, 70, 50, 1, 5, 70}},
  {act = 'stair', node = 'moreblocks:stair_stone', depth = 3, height = 4, param2 = 2, coords = {1, 2, 21, 30, 25, 30}},
  {act = 'stair', node = 'moreblocks:stair_stone', depth = 3, height = 4, param2 = 0, coords = {77, 2, 21, 30, 25, 30}},
}

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

for z = 7, 78, 9 do
  for x = 7, 78, 9 do
    local i = {act = 'fill', node = 'default:stone_block', coords = {z, 2, 21, 38, x, 2}}
    table.insert(p, i)
    if geomoria_mod.cheap_lighting then
      for y = 25, 57, 9 do
        i = {act = 'fill', node = 'default:meselamp', coords = {z, 2, y, 1, x, 2}}
        table.insert(p, i)
      end
    end
  end
end

geomoria_mod.plans['pillared room'] = table.copy(p)

p = {
  {param = 'wet'},
  {act = 'fill', node = 'air', coords = {20, 51, 12, 36, 11, 50}},
  {act = 'fill', node = 'default:water_source', treasure = 5, coords = {20, 51, 11, 10, 11, 50}},
  {act = 'fill', node = 'default:stone', coords = {38, 17, 11, 10, 30, 16}},
  {act = 'fill', node = 'default:stone', coords = {39, 2, 11, 10, 11, 19}},
  {act = 'fill', node = 'default:water_source', treasure = 3, coords = {49, 30, 11, 5, 62, 17}},
  {act = 'fill', node = 'default:water_source', coords = {17, 32, 11, 2, 69, 2}},
  {act = 'fill', node = 'default:water_source', coords = {43, 2, 11, 2, 61, 10}},
  {act = 'fill', node = 'default:water_source', coords = {17, 2, 11, 2, 23, 46}},
  {act = 'fill', node = 'default:water_source', treasure = 1, coords = {1, 18, 11, 5, 1, 22}},
  {act = 'fill', node = 'air', coords = {56, 8, 21, 5, 1, 5}},
  {act = 'fill', node = 'air', coords = {16, 8, 21, 5, 1, 5}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 0, 11}},
  {act = 'fill', node = 'air', coords = {1, 15, 21, 6, 42, 16}},
  {act = 'fill', node = 'air', coords = {9, 7, 21, 6, 22, 19}},
  {act = 'fill', node = 'air', coords = {1, 4, 21, 4, 31, 7}},
  {act = 'fill', node = 'air', coords = {1, 4, 21, 4, 22, 8}},
  {act = 'fill', node = 'air', coords = {0, 9, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {6, 10, 21, 3, 10, 2}},
  {act = 'fill', node = 'air', coords = {0, 16, 21, 3, 10, 2}},
  {act = 'fill', node = 'air', coords = {72, 7, 21, 4, 47, 11}},
  {act = 'fill', node = 'air', coords = {71, 8, 21, 6, 34, 12}},
  {act = 'fill', node = 'air', coords = {72, 7, 21, 5, 1, 32}},
  {act = 'fill', node = 'air', coords = {71, 9, 21, 2, 19, 2}},
  {act = 'fill', node = 'air', coords = {49, 30, 21, 6, 62, 17}},
  {act = 'fill', node = 'air', coords = {1, 30, 21, 6, 62, 17}},
  {act = 'fill', node = 'air', coords = {37, 6, 21, 4, 75, 4}},
  {act = 'fill', node = 'air', coords = {0, 20, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {71, 9, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {6, 2, 21, 3, 10, 32}},
  {act = 'fill', node = 'air', coords = {0, 16, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {5, 1, 21, 2, 34, 2}},
  {act = 'fill', node = 'air', coords = {5, 1, 21, 2, 26, 2}},
  {act = 'fill', node = 'air', coords = {1, 14, 21, 3, 1, 9}},
  {act = 'fill', node = 'air', coords = {1, 4, 21, 3, 10, 8}},
  {act = 'fill', node = 'air', coords = {9, 7, 21, 3, 7, 11}},
  {act = 'fill', node = 'air', coords = {16, 44, 21, 3, 7, 2}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 5, 2}},
  {act = 'fill', node = 'air', coords = {58, 2, 21, 3, 5, 2}},
  {act = 'fill', node = 'air', coords = {21, 28, 21, 3, 73, 2}},
  {act = 'fill', node = 'air', coords = {16, 2, 21, 3, 56, 6}},
  {act = 'ladder', node = 'default:ladder_steel', param2 = 5, coords = {78, 1, 11, 10, 62, 1}},
  {act = 'ladder', node = 'default:ladder_steel', param2 = 4, coords = {20, 1, 21, 20, 60, 1}},

  {act = 'fill', node = 'air', coords = {20, 51, 41, 5, 61, 9}},
  {act = 'fill', node = 'air', coords = {11, 9, 41, 5, 11, 59}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 2, coords = {16, 2, 21, 20, 36, 20}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {1, 10, 41, 10, 39, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 0, coords = {39, 2, 41, 10, 69, 10}},

  {act = 'fill', node = 'air', coords = {71, 8, 51, 3, 39, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', depth = 2, param2 = 2, coords = {69, 2, 41, 10, 51, 10}},
  {act = 'fill', node = 'air', coords = {69, 2, 51, 3, 13, 38}},
  {act = 'fill', node = 'air', coords = {61, 8, 51, 3, 13, 2}},
  {act = 'fill', node = 'air', coords = {61, 2, 31, 20, 13, 2}},
  {act = 'fill', node = 'default:stone', coords = {61, 2, 50, 1, 13, 2}},
  {act = 'fill', node = 'air', coords = {60, 8, 51, 4, 41, 10}},
  {act = 'fill', node = 'air', coords = {60, 8, 51, 4, 29, 10}},
  {act = 'fill', node = 'air', coords = {28, 24, 51, 6, 30, 25}},
  {act = 'fill', node = 'air', coords = {52, 8, 51, 3, 41, 3}},
  {act = 'fill', node = 'air', coords = {44, 8, 51, 3, 27, 3}},
  {act = 'fill', node = 'air', coords = {28, 8, 51, 3, 27, 3}},
  {act = 'fill', node = 'air', coords = {44, 8, 51, 3, 55, 3}},
  {act = 'fill', node = 'air', coords = {28, 8, 51, 3, 55, 3}},
  {act = 'fill', node = 'default:stone', coords = {37, 5, 51, 6, 40, 5}},
  {act = 'fill', node = 'air', coords = {68, 1, 51, 3, 34, 2}},
  {act = 'fill', node = 'air', coords = {68, 1, 51, 3, 44, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 51, 3, 1, 29}},
}

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['reservoir'] = table.copy(p)

p = {
  {act = 'fill', node = 'air', coords = {1, 2, 21, 3, 21, 40}},
  {act = 'fill', node = 'air', coords = {0, 7, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {5, 70, 21, 3, 17, 2}},
  {act = 'fill', node = 'air', coords = {73, 7, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {19, 42, 21, 6, 1, 14}},
  {act = 'fill', node = 'air', coords = {73, 5, 21, 3, 46, 11}},
  {act = 'fill', node = 'air', coords = {73, 5, 21, 3, 23, 11}},
  {act = 'fill', node = 'air', coords = {75, 5, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {71, 9, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {69, 2, 21, 3, 23, 38}},
  {act = 'fill', node = 'air', coords = {21, 50, 21, 3, 21, 2}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 21, 59}},
  {act = 'fill', node = 'air', coords = {39, 22, 21, 3, 77, 2}},
  {act = 'fill', node = 'air', coords = {44, 2, 21, 3, 75, 2}},
  {act = 'cylinder', node = 'air', axis = 'z', coords = {30, 10, 25, 10, 25, 50}},
  {act = 'cylinder', node = 'air', axis = 'z', coords = {40, 10, 25, 10, 25, 50}},
  {act = 'cylinder', node = 'air', axis = 'z', coords = {50, 10, 25, 10, 25, 50}},
  {act = 'fill', node = 'air', coords = {30, 30, 21, 8, 25, 50}},

  {act = 'fill', node = 'air', treasure = 8, coords = {24, 5, 21, 3, 64, 12}},
  {act = 'fill', node = 'air', treasure = 8, coords = {24, 5, 21, 3, 51, 12}},
  {act = 'fill', node = 'air', treasure = 8, coords = {24, 5, 21, 3, 38, 12}},
  {act = 'fill', node = 'air', treasure = 8, coords = {24, 5, 21, 3, 25, 12}},
  {act = 'fill', node = 'air', treasure = 8, coords = {61, 14, 21, 3, 64, 11}},
  {act = 'fill', node = 'air', treasure = 8, coords = {61, 5, 21, 3, 51, 12}},
  {act = 'fill', node = 'air', treasure = 8, coords = {61, 5, 21, 3, 38, 12}},
  {act = 'fill', node = 'air', treasure = 8, coords = {61, 5, 21, 3, 25, 12}},
  {act = 'fill', node = 'air', coords = {29, 1, 21, 3, 68, 2}},
  {act = 'fill', node = 'air', coords = {29, 1, 21, 3, 56, 2}},
  {act = 'fill', node = 'air', coords = {29, 1, 21, 3, 43, 2}},
  {act = 'fill', node = 'air', coords = {29, 1, 21, 3, 30, 2}},
  {act = 'fill', node = 'air', coords = {60, 1, 21, 3, 68, 2}},
  {act = 'fill', node = 'air', coords = {60, 1, 21, 3, 56, 2}},
  {act = 'fill', node = 'air', coords = {60, 1, 21, 3, 43, 2}},
  {act = 'fill', node = 'air', coords = {60, 1, 21, 3, 30, 2}},
  {act = 'fill', node = 'air', coords = {73, 2, 21, 3, 34, 12}},
  {act = 'fill', node = 'air', coords = {3, 16, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {11, 25, 31, 4, 13, 11}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {33, 10, 21, 10, 14, 1}},
  {act = 'fill', node = 'air', coords = {61, 14, 31, 4, 56, 19}},
  {act = 'ladder', node = 'default:ladder_steel', param2 = 4, coords = {63, 1, 21, 10, 74, 1}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 0, coords = {73, 2, 21, 10, 49, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {6, 10, 21, 10, 57, 2}},
  {act = 'fill', node = 'air', coords = {16, 2, 31, 4, 24, 35}},
  {act = 'fill', node = 'air', treasure = 1, coords = {61, 2, 31, 4, 22, 34}},
  {act = 'fill', node = 'air', treasure = 3, coords = {36, 25, 31, 4, 22, 2}},
  {act = 'fill', node = 'air', coords = {3, 3, 21, 3, 57, 2}},
  {act = 'fill', node = 'default:stone', coords = {61, 2, 31, 4, 55, 1}},
  {act = 'fill', node = 'default:stone', coords = {36, 1, 31, 4, 22, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {67, 2, 31, 10, 46, 10}},

  {act = 'fill', node = 'air', coords = {55, 10, 41, 4, 37, 10}},
  {act = 'fill', node = 'air', coords = {13, 53, 41, 6, 16, 15}},
  {act = 'fill', node = 'air', treasure = 8, coords = {12, 9, 41, 4, 31, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {23, 9, 41, 4, 31, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {34, 9, 41, 4, 31, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {45, 9, 41, 4, 31, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {56, 9, 41, 4, 31, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {12, 9, 41, 4, 11, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {23, 9, 41, 4, 11, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {34, 9, 41, 4, 11, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {45, 9, 41, 4, 11, 5}},
  {act = 'fill', node = 'air', treasure = 8, coords = {56, 9, 41, 4, 11, 5}},
  {act = 'fill', node = 'air', coords = {67, 2, 41, 3, 25, 21}},
  {act = 'fill', node = 'air', coords = {65, 4, 41, 3, 22, 3}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {67, 10, 41, 10, 11, 2}},
  {act = 'fill', node = 'air', coords = {65, 2, 41, 3, 41, 2}},
  {act = 'fill', node = 'air', coords = {65, 2, 41, 3, 11, 2}},

  {act = 'fill', node = 'air', coords = {77, 2, 51, 3, 3, 38}},
  {act = 'fill', node = 'air', coords = {1, 76, 51, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {1, 78, 51, 3, 1, 2}},
  {act = 'fill', node = 'air', coords = {1, 2, 51, 3, 3, 36}},
  {act = 'fill', node = 'air', coords = {39, 2, 51, 3, 75, 4}},
}

for x = 9, 69, 15 do
  table.insert(p, {act = 'fill', node = 'air', coords = {x, 2, 51, 3, 41, 34}})
  for z = 44, 74, 6 do
    table.insert(p, {act = 'fill', node = 'air', treasure = 20, coords = {x - 6, 5, 51, 3, z - 2, 5}})
    table.insert(p, {act = 'fill', node = 'air', treasure = 20, coords = {x + 3, 5, 51, 3, z - 2, 5}})
    table.insert(p, {act = 'fill', node = 'air', coords = {x - 1, 1, 51, 2, z, 1}})
    table.insert(p, {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {x - 1, 1, 51, 1, z, 1}})
    table.insert(p, {act = 'fill', node = 'air', coords = {x + 2, 1, 51, 2, z, 1}})
    table.insert(p, {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {x + 2, 1, 51, 1, z, 1}})
  end
end

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['market'] = table.copy(p)

p = {
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 76, 4}},
  {act = 'fill', node = 'air', coords = {5, 16, 21, 3, 74, 2}},
  {act = 'fill', node = 'air', coords = {3, 2, 21, 3, 70, 6}},
  {act = 'fill', node = 'air', coords = {5, 20, 21, 3, 70, 2}},
  {act = 'fill', node = 'air', coords = {23, 2, 21, 3, 72, 6}},
  {act = 'fill', node = 'air', coords = {25, 5, 21, 3, 76, 2}},
  {act = 'fill', node = 'air', coords = {28, 2, 21, 3, 60, 16}},
  {act = 'fill', node = 'air', coords = {28, 27, 21, 3, 58, 2}},
  {act = 'fill', node = 'air', coords = {53, 2, 21, 3, 41, 17}},
  {act = 'fill', node = 'air', coords = {50, 5, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 73, 6}},
  {act = 'fill', node = 'air', coords = {32, 20, 21, 3, 71, 2}},
  {act = 'fill', node = 'air', coords = {52, 16, 21, 15, 63, 16}},
  {act = 'fill', node = 'air', coords = {75, 5, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {1, 2, 21, 3, 52, 15}},
  {act = 'fill', node = 'air', coords = {3, 8, 21, 3, 52, 2}},
  {act = 'fill', node = 'air', coords = {9, 2, 21, 3, 54, 9}},
  {act = 'fill', node = 'air', coords = {11, 14, 21, 3, 61, 2}},
  {act = 'fill', node = 'air', coords = {23, 2, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {13, 12, 21, 3, 57, 2}},
  {act = 'fill', node = 'air', coords = {13, 2, 21, 3, 55, 2}},
  {act = 'fill', node = 'air', coords = {13, 37, 21, 3, 53, 2}},
  {act = 'fill', node = 'air', coords = {48, 2, 21, 3, 50, 3}},
  {act = 'fill', node = 'air', coords = {0, 5, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {3, 2, 21, 3, 41, 9}},
  {act = 'fill', node = 'air', coords = {5, 25, 21, 3, 48, 2}},
  {act = 'fill', node = 'air', coords = {4, 4, 21, 3, 25, 2}},
  {act = 'fill', node = 'air', coords = {8, 2, 21, 3, 25, 19}},
  {act = 'fill', node = 'air', coords = {8, 13, 21, 3, 44, 2}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 23, 21}},
  {act = 'fill', node = 'air', coords = {21, 9, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', floor = 'default:stone_block', coords = {1, 78, 21, 15, 17, 6}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 0, 5}},
  {act = 'fill', node = 'air', coords = {2, 17, 21, 3, 3, 2}},
  {act = 'fill', node = 'air', coords = {2, 2, 21, 3, 5, 10}},
  {act = 'fill', node = 'air', coords = {4, 33, 21, 3, 13, 2}},
  {act = 'fill', node = 'air', coords = {6, 6, 21, 3, 9, 2}},
  {act = 'fill', node = 'air', coords = {6, 2, 21, 3, 11, 2}},
  {act = 'fill', node = 'air', coords = {35, 2, 21, 3, 11, 2}},
  {act = 'fill', node = 'air', coords = {35, 15, 21, 3, 9, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 0, 17}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 3, 23, 13}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 3, 0, 17}},
  {act = 'fill', node = 'air', treasure = 3, coords = {59, 20, 21, 3, 36, 8}},
  {act = 'fill', node = 'air', treasure = 3, floor = 'default:stone_block', coords = {30, 20, 21, 15, 30, 20}},

  {act = 'fill', node = 'air', coords = {13, 2, 31, 3, 55, 22}},
  {act = 'fill', node = 'air', coords = {15, 2, 31, 3, 75, 2}},
  {act = 'fill', node = 'air', coords = {17, 2, 31, 3, 45, 32}},
  {act = 'fill', node = 'air', coords = {4, 11, 31, 3, 53, 2}},
  {act = 'fill', node = 'air', coords = {4, 2, 31, 3, 25, 28}},
  {act = 'fill', node = 'air', treasure = 1, coords = {8, 11, 31, 3, 35, 10}},
  {act = 'fill', node = 'air', treasure = 1, coords = {8, 11, 31, 3, 24, 10}},
  {act = 'fill', node = 'air', coords = {20, 2, 31, 3, 11, 6}},
  {act = 'fill', node = 'air', coords = {20, 2, 31, 3, 23, 18}},
  {act = 'fill', node = 'air', coords = {22, 8, 31, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {32, 2, 31, 3, 52, 9}},
  {act = 'fill', node = 'air', coords = {34, 7, 31, 3, 52, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 31, 3, 50, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 31, 3, 23, 7}},
  {act = 'fill', node = 'air', coords = {39, 2, 31, 3, 5, 12}},
  {act = 'fill', node = 'air', coords = {41, 24, 31, 3, 5, 2}},
  {act = 'fill', node = 'air', coords = {58, 2, 31, 3, 11, 6}},
  {act = 'fill', node = 'air', coords = {58, 2, 31, 3, 23, 40}},
  {act = 'fill', node = 'air', coords = {50, 8, 31, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {63, 2, 31, 3, 58, 3}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {3, 10, 21, 10, 65, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {12, 10, 21, 10, 9, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {50, 10, 21, 10, 9, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {65, 10, 21, 10, 59, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {32, 2, 21, 10, 61, 10}},
  {act = 'ladder', node = 'default:ladder_steel', param2 = 3, coords = {4, 1, 21, 10, 25, 1}},
  {act = 'fill', node = 'air', coords = {59, 1, 21, 3, 9, 2}},

  {act = 'fill', node = 'air', coords = {63, 2, 41, 3, 17, 31}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {63, 2, 31, 10, 48, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 0, coords = {63, 2, 31, 10, 7, 10}},

  {act = 'fill', node = 'default:stone', coords = {20, 2, 30, 1, 17, 6}},
  {act = 'fill', node = 'default:stone', coords = {39, 2, 30, 1, 17, 6}},
  {act = 'fill', node = 'default:stone', coords = {58, 2, 30, 1, 17, 6}},
  {act = 'fill', node = 'default:stone', coords = {56, 6, 30, 1, 63, 3}},
  {act = 'fill', node = 'default:stone', coords = {39, 2, 30, 1, 30, 20}},
  {act = 'fill', node = 'default:stone', coords = {30, 20, 30, 1, 39, 2}},

  {act = 'fill', node = 'default:stone', coords = {1, 2, 21, 3, 58, 1}},
  {act = 'fill', node = 'default:stone', coords = {21, 1, 21, 3, 39, 2}},
  {act = 'fill', node = 'default:stone', coords = {6, 2, 21, 3, 12, 1}},
  {act = 'fill', node = 'default:stone', coords = {38, 1, 21, 3, 9, 2}},
  {act = 'fill', node = 'default:stone', coords = {41, 1, 21, 3, 9, 2}},
  {act = 'fill', node = 'default:stone', coords = {59, 2, 21, 3, 23, 1}},
  {act = 'fill', node = 'default:stone', coords = {13, 2, 31, 3, 67, 1}},
  {act = 'fill', node = 'default:stone', coords = {13, 2, 31, 3, 34, 1}},
}

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

for _, item in pairs(placeholder_y51) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['silly straw'] = table.copy(p)

p = {
  {param = 'dry'},
  {act = 'fill', node = 'air', floor = 'default:stone_block', coords = {1, 78, 21, 5, 1, 78}},
  {act = 'fill', node = 'default:stone', coords = {9, 62, 21, 1, 9, 62}},
  {act = 'fill', node = 'default:stone', coords = {9, 62, 23, 5, 9, 62}},
  {act = 'fill', node = 'air', coords = {10, 60, 11, 25, 10, 60}},
  {act = 'fill', node = 'default:lava_source', coords = {10, 60, 11, 5, 10, 60}},
  {act = 'fill', node = 'default:stone', coords = {25, 30, 11, 9, 25, 30}},
  {act = 'fill', node = 'default:stone_block', coords = {25, 30, 20, 1, 25, 30}},
  {act = 'fill', node = 'default:stone', coords = {39, 2, 20, 1, 55, 15}},
  {act = 'fill', node = 'default:stone', coords = {39, 2, 20, 1, 10, 15}},
  {act = 'fill', node = 'default:stone', coords = {10, 15, 20, 1, 39, 2}},
  {act = 'fill', node = 'default:stone', coords = {55, 15, 20, 1, 39, 2}},
  {act = 'fill', node = 'air', coords = {70, 1, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {9, 1, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 70, 1}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 9, 1}},
  {act = 'fill', node = 'default:stone', coords = {37, 6, 20, 2, 37, 6}},
  {act = 'fill', node = 'default:lava_source', coords = {38, 4, 20, 2, 38, 4}},
}

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

for _, item in pairs(placeholder_y51) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['lake of fire'] = table.copy(p)

p = {
  {param = 'wet'},
  {act = 'fill', node = 'air', coords = {29, 2, 11, 3, 55, 16}},
  {act = 'fill', node = 'air', coords = {25, 4, 11, 3, 69, 2}},
  {act = 'fill', node = 'air', coords = {25, 4, 11, 3, 9, 2}},
  {act = 'fill', node = 'air', coords = {9, 2, 11, 3, 9, 62}},
  {act = 'fill', node = 'air', coords = {11, 4, 11, 3, 9, 2}},
  {act = 'fill', node = 'air', coords = {11, 4, 11, 3, 24, 2}},
  {act = 'fill', node = 'air', coords = {11, 4, 11, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {11, 4, 11, 3, 54, 2}},
  {act = 'fill', node = 'air', coords = {11, 4, 11, 3, 69, 2}},
  {act = 'fill', node = 'air', coords = {49, 12, 11, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {49, 2, 11, 3, 55, 4}},
  {act = 'fill', node = 'air', coords = {26, 30, 11, 6, 25, 30}},
  {act = 'fill', node = 'air', coords = {49, 2, 11, 3, 19, 6}},
  {act = 'fill', node = 'air', coords = {29, 2, 11, 3, 9, 16}},
  {act = 'fill', node = 'air', treasure = 3, coords = {15, 10, 11, 6, 5, 10}},
  {act = 'fill', node = 'air', treasure = 3, coords = {15, 10, 11, 6, 20, 10}},
  {act = 'fill', node = 'air', treasure = 3, coords = {15, 10, 11, 6, 35, 10}},
  {act = 'fill', node = 'air', treasure = 3, coords = {15, 10, 11, 6, 50, 10}},
  {act = 'fill', node = 'air', treasure = 3, coords = {15, 10, 11, 6, 65, 10}},
  {act = 'fill', node = 'default:stone', coords = {18, 4, 11, 6, 8, 4}},
  {act = 'fill', node = 'default:stone', coords = {18, 4, 11, 6, 23, 4}},
  {act = 'fill', node = 'default:stone', coords = {18, 4, 11, 6, 38, 4}},
  {act = 'fill', node = 'default:stone', coords = {18, 4, 11, 6, 53, 4}},
  {act = 'fill', node = 'default:stone', coords = {18, 4, 11, 6, 68, 4}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 11, 10, 9, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 11, 10, 24, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 11, 10, 39, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 11, 10, 54, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 11, 10, 69, 2}},

  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {61, 10, 11, 10, 59, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {39, 2, 11, 10, 1, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {39, 10, 11, 10, 19, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 11, 3, 11, 14}},
  {act = 'fill', node = 'default:stone', coords = {61, 1, 21, 6, 59, 2}},

  {act = 'cylinder', node = 'air', axis = 'z', coords = {10, 20, 15, 20, 1, 79}},
  {act = 'fill', node = 'default:stone', coords = {10, 20, 15, 6, 1, 79}},
  {act = 'fill', node = 'air', floor = 'default:stone_block', coords = {10, 20, 21, 4, 1, 79}},
  {act = 'fill', node = 'air', coords = {1, 8, 21, 4, 56, 8}},
  {act = 'fill', node = 'air', coords = {1, 8, 21, 4, 36, 8}},
  {act = 'fill', node = 'air', coords = {1, 8, 21, 4, 16, 8}},
  {act = 'fill', node = 'air', coords = {4, 2, 21, 3, 64, 7}},
  {act = 'fill', node = 'air', coords = {6, 4, 21, 3, 69, 2}},
  {act = 'fill', node = 'air', coords = {4, 2, 21, 3, 44, 12}},
  {act = 'fill', node = 'air', coords = {6, 4, 21, 3, 49, 2}},
  {act = 'fill', node = 'air', coords = {4, 2, 21, 3, 24, 12}},
  {act = 'fill', node = 'air', coords = {6, 4, 21, 3, 29, 2}},
  {act = 'fill', node = 'air', coords = {4, 2, 21, 3, 9, 7}},
  {act = 'fill', node = 'air', coords = {6, 4, 21, 3, 9, 2}},
  {act = 'fill', node = 'air', coords = {31, 8, 21, 4, 56, 8}},
  {act = 'fill', node = 'air', coords = {31, 8, 21, 4, 36, 8}},
  {act = 'fill', node = 'air', coords = {31, 8, 21, 4, 16, 8}},
  {act = 'fill', node = 'air', coords = {34, 2, 21, 3, 64, 5}},
  {act = 'fill', node = 'air', coords = {30, 9, 21, 3, 69, 2}},
  {act = 'fill', node = 'air', coords = {34, 2, 21, 3, 44, 12}},
  {act = 'fill', node = 'air', coords = {30, 4, 21, 3, 49, 2}},
  {act = 'fill', node = 'air', coords = {34, 2, 21, 3, 24, 12}},
  {act = 'fill', node = 'air', coords = {30, 4, 21, 3, 29, 2}},
  {act = 'fill', node = 'air', coords = {34, 2, 21, 3, 9, 7}},
  {act = 'fill', node = 'air', coords = {30, 4, 21, 3, 9, 2}},
  {act = 'fill', node = 'air', coords = {71, 9, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {39, 41, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {71, 9, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 3, 1, 79}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 69, 11}},

  {act = 'fill', node = 'default:stone', coords = {15, 10, 21, 1, 5, 10}},
  {act = 'fill', node = 'default:water_source', coords = {16, 8, 21, 1, 6, 8}},
  {act = 'fill', node = 'default:stone', coords = {19, 2, 21, 2, 9, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 23, 1, 9, 2}},
  {act = 'fill', node = 'default:stone', coords = {15, 10, 21, 1, 20, 10}},
  {act = 'fill', node = 'default:water_source', coords = {16, 8, 21, 1, 21, 8}},
  {act = 'fill', node = 'default:stone', coords = {19, 2, 21, 2, 24, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 23, 1, 24, 2}},
  {act = 'fill', node = 'default:stone', coords = {15, 10, 21, 1, 35, 10}},
  {act = 'fill', node = 'default:water_source', coords = {16, 8, 21, 1, 36, 8}},
  {act = 'fill', node = 'default:stone', coords = {19, 2, 21, 2, 39, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 23, 1, 39, 2}},
  {act = 'fill', node = 'default:stone', coords = {15, 10, 21, 1, 50, 10}},
  {act = 'fill', node = 'default:water_source', coords = {16, 8, 21, 1, 51, 8}},
  {act = 'fill', node = 'default:stone', coords = {19, 2, 21, 2, 54, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 23, 1, 54, 2}},
  {act = 'fill', node = 'default:stone', coords = {15, 10, 21, 1, 65, 10}},
  {act = 'fill', node = 'default:water_source', coords = {16, 8, 21, 1, 66, 8}},
  {act = 'fill', node = 'default:stone', coords = {19, 2, 21, 2, 69, 2}},
  {act = 'fill', node = 'default:water_source', coords = {19, 2, 23, 1, 69, 2}},

  {act = 'fill', node = 'air', coords = {51, 20, 31, 5, 65, 10}},
  {act = 'fill', node = 'air', coords = {51, 10, 31, 5, 15, 10}},
  {act = 'fill', node = 'air', coords = {55, 2, 31, 3, 25, 27}},
  {act = 'fill', node = 'air', coords = {60, 2, 31, 3, 41, 24}},
  {act = 'fill', node = 'air', coords = {57, 8, 31, 3, 39, 2}},
  {act = 'fill', node = 'default:stone', coords = {54, 4, 11, 6, 49, 4}},
  {act = 'fill', node = 'air', coords = {55, 2, 6, 25, 50, 2}},
  {act = 'fill', node = 'default:stone', coords = {55, 2, 30, 1, 50, 2}},
  {act = 'fill', node = 'air', treasure = 1, coords = {65, 10, 31, 5, 35, 10}},
  {act = 'fill', node = 'air', coords = {69, 2, 31, 3, 45, 5}},
  {act = 'fill', node = 'air', treasure = 1, coords = {65, 10, 31, 5, 50, 10}},
  {act = 'fill', node = 'default:stone', coords = {57, 1, 31, 3, 39, 2}},

  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {61, 10, 21, 10, 19, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {41, 10, 21, 10, 69, 2}},
}

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

for _, item in pairs(placeholder_y51) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['fountain court'] = table.copy(p)

p = {
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 1, 79}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 1, 79}},
  {act = 'fill', node = 'air', coords = {1, 79, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 3, 1, 79}},
  {act = 'fill', node = 'air', coords = {1, 79, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {1, 79, 21, 3, 19, 2}},
}

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

for _, item in pairs(placeholder_y51) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['crossroads'] = table.copy(p)

p = {
  {act = 'fill', node = 'default:dirt', coords = {5, 70, 19, 2, 5, 70}},
  {act = 'fill', node = geomoria_mod.treasure_chest, random = 200, coords = {5, 70, 19, 1, 5, 70}},
  {act = 'fill', node = 'air', coords = {5, 70, 21, 7, 5, 70}},
  {act = 'fill', node = 'flowers:mushroom_brown', random = 4, coords = {5, 70, 21, 1, 5, 70}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 75, 5}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 75, 5}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 3, 75, 5}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 0, 5}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 0, 5}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 3, 0, 5}},
  {act = 'fill', node = 'air', coords = {0, 5, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {0, 5, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {0, 5, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {75, 5, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {75, 5, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {75, 5, 21, 3, 59, 2}},

  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {61, 10, 21, 10, 75, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {9, 10, 21, 10, 3, 2}},
  {act = 'fill', node = 'default:dirt', coords = {5, 70, 29, 2, 5, 70}},
  {act = 'fill', node = geomoria_mod.treasure_chest, random = 200, coords = {5, 70, 29, 1, 5, 70}},
  {act = 'fill', node = 'air', coords = {5, 70, 31, 7, 5, 70}},
  {act = 'fill', node = 'flowers:mushroom_brown', random = 4, coords = {5, 70, 31, 1, 5, 70}},
  {act = 'fill', node = 'air', coords = {71, 6, 31, 3, 75, 2}},
  {act = 'fill', node = 'air', coords = {3, 6, 31, 3, 3, 2}},

  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {75, 2, 31, 10, 65, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 0, coords = {3, 2, 31, 10, 5, 10}},

  {act = 'fill', node = 'default:dirt', coords = {5, 70, 39, 2, 5, 70}},
  {act = 'fill', node = geomoria_mod.treasure_chest, random = 200, coords = {5, 70, 39, 1, 5, 70}},
  {act = 'fill', node = 'air', coords = {5, 70, 41, 7, 5, 70}},
  {act = 'fill', node = 'flowers:mushroom_brown', random = 4, coords = {5, 70, 41, 1, 5, 70}},
  {act = 'fill', node = 'air', coords = {75, 2, 41, 3, 60, 5}},
  {act = 'fill', node = 'air', coords = {3, 2, 41, 3, 15, 5}},
}

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

for _, item in pairs(placeholder_y51) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['mushroom garden'] = table.copy(p)

p = {
  {act = 'fill', node = 'air', coords = {15, 50, 39, 6, 15, 50}},
  {act = 'fill', node = 'air', coords = {16, 48, 38, 7, 16, 48}},
  {act = 'fill', node = 'air', coords = {17, 46, 37, 8, 17, 46}},
  {act = 'fill', node = 'air', coords = {18, 44, 36, 9, 18, 44}},
  {act = 'fill', node = 'air', coords = {19, 42, 35, 10, 19, 42}},
  {act = 'fill', node = 'air', coords = {20, 40, 34, 11, 20, 40}},
  {act = 'fill', node = 'air', coords = {21, 38, 33, 12, 21, 38}},
  {act = 'fill', node = 'air', coords = {22, 36, 32, 13, 22, 36}},
  {act = 'fill', node = 'air', treasure = 1, coords = {24, 32, 21, 24, 24, 32}},

  {act = 'fill', node = 'air', treasure = 4, coords = {30, 20, 21, 5, 65, 10}},
  {act = 'fill', node = 'air', treasure = 4, coords = {30, 20, 21, 5, 5, 10}},
  {act = 'fill', node = 'air', treasure = 4, coords = {65, 10, 21, 5, 30, 20}},
  {act = 'fill', node = 'air', treasure = 4, coords = {5, 10, 21, 5, 30, 20}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 56, 24}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 0, 24}},
  {act = 'fill', node = 'air', coords = {77, 3, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {77, 3, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {0, 3, 21, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {0, 3, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 77, 3}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 3, 77, 3}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 3, 0, 3}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 0, 3}},
  {act = 'fill', node = 'air', coords = {0, 24, 21, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {56, 24, 21, 3, 39, 2}},

  {act = 'fill', node = 'air', coords = {19, 2, 31, 3, 65, 2}},
  {act = 'fill', node = 'air', coords = {59, 2, 31, 3, 65, 2}},
  {act = 'fill', node = 'air', coords = {59, 2, 31, 3, 13, 2}},
  {act = 'fill', node = 'air', coords = {19, 2, 31, 3, 13, 2}},
  {act = 'fill', node = 'air', coords = {65, 2, 31, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {65, 2, 31, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {13, 2, 31, 3, 59, 2}},
  {act = 'fill', node = 'air', coords = {13, 2, 31, 3, 19, 2}},

  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {59, 2, 21, 10, 67, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 0, coords = {59, 2, 21, 10, 3, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 0, coords = {19, 2, 21, 10, 3, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {67, 10, 21, 10, 19, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {67, 10, 21, 10, 59, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {3, 10, 21, 10, 59, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {3, 10, 21, 10, 19, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {19, 2, 21, 10, 67, 10}},

  {act = 'fill', node = 'air', coords = {65, 2, 39, 3, 29, 22}},
  {act = 'fill', node = 'air', coords = {13, 2, 39, 3, 29, 22}},
  {act = 'fill', node = 'air', coords = {29, 22, 39, 3, 65, 2}},
  {act = 'fill', node = 'air', coords = {29, 22, 39, 3, 13, 2}},

  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {65, 2, 31, 8, 51, 8}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 0, coords = {65, 2, 31, 8, 21, 8}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 2, coords = {13, 2, 31, 8, 51, 8}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 0, coords = {13, 2, 31, 8, 21, 8}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {51, 8, 31, 8, 65, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {21, 8, 31, 8, 65, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 3, coords = {51, 8, 31, 8, 13, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', param2 = 1, coords = {21, 8, 31, 8, 13, 2}},
}

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

for _, item in pairs(placeholder_y51) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['arena'] = table.copy(p)

p = {
  {act = 'fill', node = 'air', coords = {0, 1, 21, 2, 19, 2}},
  {act = 'fill', node = 'air', coords = {0, 1, 21, 2, 39, 2}},
  {act = 'fill', node = 'air', coords = {0, 1, 21, 2, 59, 2}},
  {act = 'fill', node = 'air', coords = {79, 1, 21, 2, 19, 2}},
  {act = 'fill', node = 'air', coords = {79, 1, 21, 2, 39, 2}},
  {act = 'fill', node = 'air', coords = {79, 1, 21, 2, 59, 2}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 2, 0, 1}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 2, 0, 1}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 2, 0, 1}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 2, 79, 1}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 2, 79, 1}},
  {act = 'fill', node = 'air', coords = {59, 2, 21, 2, 79, 1}},

  {act = 'fill', node = 'air', coords = {38, 4, 21, 3, 1, 78}},
  {act = 'fill', node = 'air', coords = {1, 78, 21, 3, 58, 4}},
  {act = 'fill', node = 'air', coords = {1, 78, 21, 3, 18, 4}},
  {act = 'fill', node = 'air', coords = {1, 8, 21, 3, 37, 6}},
  {act = 'fill', node = 'air', coords = {10, 25, 21, 5, 30, 20}},
  {act = 'fill', node = 'air', coords = {35, 3, 21, 3, 38, 4}},
  {act = 'fill', node = 'air', coords = {42, 37, 21, 3, 38, 4}},
  {act = 'fill', node = 'air', coords = {51, 2, 21, 3, 42, 1}},
  {act = 'fill', node = 'air', coords = {51, 2, 21, 3, 37, 1}},
  {act = 'fill', node = 'air', coords = {69, 2, 21, 3, 42, 1}},
  {act = 'fill', node = 'air', coords = {69, 2, 21, 3, 37, 1}},
  {act = 'fill', node = 'air', coords = {44, 16, 21, 6, 43, 9}},
  {act = 'fill', node = 'air', coords = {44, 16, 21, 6, 28, 9}},
  {act = 'fill', node = 'air', coords = {62, 16, 21, 6, 43, 9}},
  {act = 'fill', node = 'air', coords = {62, 16, 21, 6, 28, 9}},

  {act = 'fill', node = 'air', coords = {24, 13, 21, 3, 71, 2}},
  {act = 'fill', node = 'air', coords = {43, 13, 21, 3, 71, 2}},
  {act = 'fill', node = 'air', coords = {24, 13, 21, 3, 7, 2}},
  {act = 'fill', node = 'air', coords = {43, 13, 21, 3, 7, 2}},
  {act = 'fill', node = 'air', coords = {16, 8, 21, 3, 71, 8}},
  {act = 'fill', node = 'air', coords = {56, 8, 21, 3, 71, 8}},
  {act = 'fill', node = 'air', coords = {16, 8, 21, 3, 1, 8}},
  {act = 'fill', node = 'air', coords = {56, 8, 21, 3, 1, 8}},

  {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {0, 1, 21, 1, 59, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {0, 1, 21, 1, 60, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {79, 1, 21, 1, 59, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {79, 1, 21, 1, 60, 1}},

  {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {0, 1, 21, 1, 19, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {0, 1, 21, 1, 20, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {79, 1, 21, 1, 19, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {79, 1, 21, 1, 20, 1}},

  {act = 'fill', node = 'doors:door_steel_a', param2 = 0, coords = {39, 1, 21, 1, 79, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 0, coords = {40, 1, 21, 1, 79, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 2, coords = {39, 1, 21, 1, 0, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 2, coords = {40, 1, 21, 1, 0, 1}},

  {act = 'fill', node = 'air', coords = {37, 1, 21, 2, 71, 2}},
  {act = 'fill', node = 'air', coords = {42, 1, 21, 2, 71, 2}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {37, 1, 21, 1, 71, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {37, 1, 21, 1, 72, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {42, 1, 21, 1, 71, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {42, 1, 21, 1, 72, 1}},

  {act = 'fill', node = 'air', coords = {37, 1, 21, 2, 7, 2}},
  {act = 'fill', node = 'air', coords = {42, 1, 21, 2, 7, 2}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {37, 1, 21, 1, 7, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {37, 1, 21, 1, 8, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {42, 1, 21, 1, 7, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {42, 1, 21, 1, 8, 1}},

  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {79, 1, 21, 1, 39, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {79, 1, 21, 1, 40, 1}},

  {act = 'fill', node = 'air', coords = {9, 1, 21, 2, 39, 2}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {9, 1, 21, 1, 39, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {9, 1, 21, 1, 40, 1}},

  {act = 'fill', node = 'default:stone', coords = {28, 1, 21, 2, 26, 1}},
  {act = 'fill', node = 'air', coords = {27, 3, 31, 3, 26, 3}},
  {act = 'fill', node = 'air', coords = {28, 1, 31, 3, 29, 10}},
  {act = 'fill', node = 'air', coords = {3, 74, 31, 3, 39, 2}},
  {act = 'fill', node = 'air', treasure = 3, coords = {3, 9, 31, 4, 42, 6}},
  {act = 'fill', node = 'air', treasure = 3, coords = {47, 9, 31, 4, 42, 6}},
  {act = 'fill', node = 'air', treasure = 3, coords = {32, 9, 31, 4, 32, 6}},
  {act = 'fill', node = 'air', treasure = 3, coords = {64, 9, 31, 4, 32, 6}},
  {act = 'fill', node = 'air', treasure = 3, coords = {11, 9, 31, 4, 32, 6}},
  {act = 'fill', node = 'air', coords = {6, 2, 31, 3, 41, 1}},
  {act = 'fill', node = 'air', coords = {51, 2, 31, 3, 41, 1}},
  {act = 'fill', node = 'air', coords = {14, 2, 31, 3, 38, 1}},
  {act = 'fill', node = 'air', coords = {36, 2, 31, 3, 38, 1}},
  {act = 'fill', node = 'air', coords = {66, 2, 31, 3, 38, 1}},
  {act = 'ladder', node = 'default:ladder_steel', param2 = 2, coords = {28, 1, 21, 10, 27, 1}},
}

for _, o in pairs({0, 43}) do
  for x = 4 + o, 32 + o, 4 do
    for _, y in pairs({57, 17}) do
      local i = {act = 'fill', node = 'air', coords = {x, 1, 21, 2, y + 5, 1}}
      table.insert(p, i)
      i = {act = 'fill', node = 'doors:door_steel_a', param2 = 0, coords = {x, 1, 21, 1, y + 5, 1}}
      table.insert(p, i)
      i = {act = 'fill', node = 'air', coords = {x - 1, 3, 21, 3, y + 6, 3}}
      table.insert(p, i)

      i = {act = 'fill', node = 'air', coords = {x, 1, 21, 2, y, 1}}
      table.insert(p, i)
      i = {act = 'fill', node = 'doors:door_steel_a', param2 = 2, coords = {x, 1, 21, 1, y, 1}}
      table.insert(p, i)
      i = {act = 'fill', node = 'air', coords = {x - 1, 3, 21, 3, y - 3, 3}}
      table.insert(p, i)
    end
  end
end

for _, item in pairs(placeholder_y51) do
  table.insert(p, 2, table.copy(item))
end

geomoria_mod.plans['prison'] = table.copy(p)

p = {
  {act = 'sphere', node = 'air', coords = {1, 78, -18, 78, 1, 78}},
  {act = 'fill', node = 'default:stone', coords = {1, 78, 0, 21, 1, 78}},
  {act = 'fill', node = 'default:stone_block', coords = {1, 78, 20, 1, 1, 78}},
}

geomoria_mod.stair_height = {
  {act = 'fill', node = 'default:stone', coords = {26, 5, 0, 5, 23, 31}},
  {act = 'fill', node = 'default:stone', coords = {26, 28, 0, 26, 49, 5}},
  {act = 'fill', node = 'default:stone', coords = {49, 5, 19, 27, 29, 28}},
  {act = 'fill', node = 'default:stone', coords = {29, 25, 39, 27, 26, 5}},
  {act = 'fill', node = 'default:stone', coords = {26, 5, 59, 21, 26, 28}},
  {act = 'fill', node = 'air', coords = {27, 3, 0, 4, 47, 6}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, depth = 3, param2 = 1, coords = {30, 20, 0, 20, 50, 3}},
  {act = 'fill', node = 'air', coords = {47, 6, 20, 4, 50, 3}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, depth = 3, param2 = 2, coords = {50, 3, 20, 20, 30, 20}},
  {act = 'fill', node = 'air', coords = {50, 3, 40, 4, 27, 6}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, depth = 3, param2 = 3, coords = {30, 20, 40, 20, 27, 3}},
  {act = 'fill', node = 'air', coords = {27, 6, 60, 4, 27, 3}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, depth = 3, param2 = 0, coords = {27, 3, 60, 21, 30, 20}},
}

geomoria_mod.stair_base = table.copy(geomoria_mod.stair_height)
--table.insert(geomoria_mod.stair_base, {})
p = {
  {act = 'sphere', node = 'air', coords = {35, 40, 31, 40, 35, 40}},
  {act = 'fill', node = 'default:stone', coords = {35, 40, 31, 20, 35, 40}},
  {act = 'fill', node = 'default:stone_block', coords = {35, 40, 50, 1, 35, 40}},

  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 3, coords = {50, 10, 41, 10, 10, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 0, coords = {10, 2, 41, 10, 25, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 3, coords = {20, 10, 41, 10, 55, 2}},
  {act = 'fill', node = 'air', coords = {55, 15, 41, 5, 20, 50}},
  {act = 'fill', node = 'air', coords = {60, 5, 46, 1, 25, 40}},
  {act = 'fill', node = 'air', coords = {60, 2, 41, 3, 15, 5}},
  {act = 'fill', node = 'air', coords = {30, 2, 41, 3, 55, 10}},
  {act = 'fill', node = 'air', coords = {60, 10, 41, 3, 10, 5}},
  {act = 'fill', node = 'air', coords = {33, 22, 41, 3, 20, 2}},
  {act = 'fill', node = 'air', coords = {23, 12, 41, 4, 9, 11}},
  {act = 'fill', node = 'air', coords = {12, 11, 41, 3, 9, 2}},
  {act = 'fill', node = 'air', coords = {10, 2, 41, 3, 9, 16}},

  {act = 'fill', node = 'air', coords = {66, 13, 51, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 51, 3, 66, 13}},
  {act = 'fill', node = 'air', coords = {1, 4, 51, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {5, 2, 51, 3, 10, 55}},
  {act = 'fill', node = 'air', coords = {7, 43, 51, 3, 10, 2}},
  {act = 'fill', node = 'air', coords = {25, 11, 51, 4, 14, 11}},
  {act = 'fill', node = 'air', coords = {38, 11, 51, 4, 14, 11}},
  {act = 'fill', node = 'air', coords = {51, 11, 51, 4, 14, 11}},
  {act = 'fill', node = 'air', coords = {64, 11, 51, 4, 14, 11}},
  {act = 'fill', node = 'air', coords = {36, 8, 51, 4, 1, 8}},
  {act = 'fill', node = 'air', coords = {39, 2, 51, 3, 9, 1}},
  {act = 'fill', node = 'air', coords = {29, 2, 51, 3, 12, 2}},
  {act = 'fill', node = 'air', coords = {36, 2, 51, 3, 14, 2}},
  {act = 'fill', node = 'air', coords = {49, 2, 51, 3, 23, 2}},
  {act = 'fill', node = 'air', coords = {62, 2, 51, 3, 14, 2}},
  {act = 'fill', node = 'air', coords = {5, 15, 51, 3, 65, 2}},
  {act = 'fill', node = 'air', coords = {10, 2, 51, 3, 35, 30}},
  {act = 'fill', node = 'air', coords = {18, 2, 51, 3, 55, 10}},
  {act = 'fill', node = 'air', coords = {14, 2, 51, 3, 55, 10}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 2, coords = {14, 2, 51, 10, 45, 10}},

  {act = 'fill', node = 'air', coords = {14, 2, 61, 3, 22, 23}},
  {act = 'fill', node = 'air', coords = {14, 61, 61, 5, 4, 18}},
  {act = 'fill', node = 'air', coords = {16, 14, 66, 1, 6, 14}},
  {act = 'fill', node = 'air', coords = {36, 14, 66, 1, 6, 14}},
  {act = 'fill', node = 'air', coords = {56, 14, 66, 1, 6, 14}},
  {act = 'fill', node = 'air', coords = {50, 10, 61, 5, 22, 21}},
  {act = 'fill', node = 'default:stone', coords = {48, 14, 60, 1, 34, 42}},
  {act = 'fill', node = 'default:stone', coords = {34, 14, 60, 1, 54, 2}},
  {act = 'fill', node = 'air', coords = {23, 17, 61, 3, 54, 2}},
  {act = 'fill', node = 'air', coords = {13, 12, 61, 4, 56, 16}},
  {act = 'fill', node = 'air', coords = {25, 9, 61, 4, 70, 9}},

  {act = 'fill', node = 'air', coords = {65, 7, 31, 3, 70, 9}},
  {act = 'fill', node = 'air', coords = {57, 12, 31, 3, 39, 2}},
  {act = 'fill', node = 'air', coords = {57, 2, 31, 3, 11, 28}},
  {act = 'fill', node = 'air', coords = {35, 10, 31, 3, 70, 9}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 2, coords = {30, 2, 31, 10, 65, 10}},
  {act = 'fill', node = 'air', coords = {30, 5, 31, 3, 75, 2}},
  {act = 'fill', node = 'air', coords = {45, 8, 31, 3, 75, 2}},

  {act = 'fill', node = 'air', coords = {57, 6, 21, 6, 1, 78}},
  {act = 'fill', node = 'air', coords = {63, 9, 21, 3, 58, 2}},
  {act = 'fill', node = 'air', coords = {72, 7, 21, 3, 56, 8}},
  {act = 'stair', node = 'moreblocks:stair_stone', depth = 2, height = 4, param2 = 3, coords = {69, 10, 21, 10, 39, 2}},
  {act = 'sphere', node = 'air', coords = {10, 20, 11, 20, 2, 20}},
  {act = 'fill', node = 'default:stone', coords = {10, 20, 11, 10, 2, 20}},
  {act = 'fill', node = 'default:stone_block', coords = {10, 20, 20, 1, 2, 20}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 1, 2}},
  {act = 'fill', node = 'air', coords = {35, 13, 21, 5, 21, 27}},
  {act = 'fill', node = 'air', coords = {37, 16, 21, 5, 55, 10}},
  {act = 'fill', node = 'air', coords = {51, 2, 21, 3, 53, 2}},
  {act = 'fill', node = 'air', coords = {35, 2, 21, 3, 48, 9}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 0, coords = {51, 2, 21, 10, 65, 10}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 65, 14}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 0, coords = {65, 2, 21, 10, 60, 10}},

  {act = 'fill', node = 'moreblocks:stair_stone', param2 = 0, coords = {51, 2, 20, 1, 53, 1}},

  {act = 'fill', node = 'air', coords = {5, 4, 26, 3, 5, 6}},
  {act = 'fill', node = 'air', coords = {45, 12, 31, 3, 11, 2}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 5, param2 = 1, coords = {40, 5, 26, 5, 11, 2}},
  {act = 'fill', node = 'air', coords = {5, 35, 26, 3, 11, 2}},
  {act = 'fill', node = 'default:stone', coords = {9, 22, 25, 1, 11, 2}},

  {act = 'fill', node = 'air', coords = {64, 7, 21, 3, 20, 1}},
  {act = 'fill', node = 'default:stone', coords = {64, 1, 21, 3, 20, 1}},
  {act = 'fill', node = 'air', coords = {41, 16, 21, 3, 11, 2}},
  {act = 'fill', node = 'air', coords = {71, 2, 21, 3, 3, 52}},
  {act = 'fill', node = 'air', coords = {73, 6, 21, 3, 19, 2}},
  {act = 'fill', node = 'air', coords = {74, 5, 21, 4, 42, 13}},
  {act = 'fill', node = 'air', coords = {73, 1, 21, 2, 48, 1}},
  {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {73, 1, 21, 1, 48, 1}},

  {act = 'fill', node = 'air', coords = {29, 10, 21, 3, 11, 2}},
  {act = 'fill', node = 'air', coords = {39, 2, 21, 3, 1, 12}},
  {act = 'fill', node = 'air', coords = {1, 10, 21, 3, 11, 2}},
  {act = 'fill', node = 'air', coords = {1, 2, 21, 3, 13, 8}},
  {act = 'fill', node = 'air', coords = {19, 2, 21, 3, 21, 58}},
  {act = 'fill', node = 'air', coords = {21, 14, 21, 3, 55, 2}},
  {act = 'fill', node = 'air', floor = 'default:stone_block', coords = {1, 14, 21, 4, 25, 50}},
  {act = 'fill', node = 'air', coords = {2, 12, 25, 1, 26, 48}},
  {act = 'fill', node = 'air', coords = {3, 10, 26, 1, 27, 46}},
  {act = 'fill', node = 'air', coords = {4, 8, 27, 1, 28, 44}},
  {act = 'fill', node = 'air', coords = {15, 4, 21, 3, 49, 2}},
  {act = 'fill', node = 'default:stone_block', coords = {5, 5, 21, 1, 30, 40}},
  {act = 'fill', node = 'default:water_source', coords = {6, 3, 21, 1, 31, 38}},
  {act = 'stair', node = 'moreblocks:stair_stone', height = 4, param2 = 2, coords = {70, 2, 31, 10, 60, 10}},
}

for y = 2, 78, 3 do
  for x = 56, 63, 7 do
    table.insert(p, {act = 'fill', node = 'air', coords = {x, 1, 21, 3, y, 1}})
  end
end

for _, y in pairs({1, 7, 13, 22, 28, 34, 40, 46, 52}) do
  table.insert(p, {act = 'fill', node = 'air', coords = {65, 5, 21, 3, y, 5}})
  table.insert(p, {act = 'fill', node = 'air', coords = {70, 1, 21, 2, y + 2, 1}})
  table.insert(p, {act = 'fill', node = 'doors:door_steel_a', param2 = 3, coords = {70, 1, 21, 1, y + 2, 1}})
end

for _, y in pairs({1, 7, 13, 22, 28}) do
  table.insert(p, {act = 'fill', node = 'air', coords = {74, 5, 21, 3, y, 5}})
  table.insert(p, {act = 'fill', node = 'air', coords = {73, 1, 21, 2, y + 2, 1}})
  table.insert(p, {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {73, 1, 21, 1, y + 2, 1}})
end

for _, y in pairs({24, 30, 36, 42, 48, 59, 65, 71}) do
  table.insert(p, {act = 'fill', node = 'air', coords = {22, 5, 21, 3, y, 5}})
  table.insert(p, {act = 'fill', node = 'air', coords = {21, 1, 21, 2, y + 2, 1}})
  table.insert(p, {act = 'fill', node = 'doors:door_steel_a', param2 = 1, coords = {21, 1, 21, 1, y + 2, 1}})
end

for _, item in pairs(geomoria_mod.default_exits) do
  table.insert(p, 2, table.copy(item))
end

for i = #p, 1, -1 do
  table.insert(geomoria_mod.stair_base, 6, p[i])
end

-- %s/\v([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)/{act = 'fill', node = 'air', coords = {\1, \2, 21, 3, \3, \4}},/


code:
# Set to true to generate ores in the walls
geomoria_generate_ores (Generate Ores) bool false

# Set to true to add fissures and chasms
geomoria_add_fissures (Add Fissures) bool false

# Set to true to place meselights (badly)
geomoria_cheap_lighting (Add Lights) bool false

# Level of damage
geomoria_damage_level (Damage Level) int 5

repo_name: korkut/MeseCraft

license: mit


code:
# Compiled Lua sources
luac.out

# luarocks build files
*.src.rock
*.zip
*.tar.gz

# Object files
*.o
*.os
*.ko
*.obj
*.elf

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo
*.def
*.exp

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex


code:
This mapgen mod modifies how lava is distributed and how lava interacts with neighboring nodes in a variety of ways. Its various features can be enabled or disabled independently via configuration settings.

This mod makes magma more sparsely distributed across the map, but where it is found it will be available in massive quantities. Using this mod in conjunction with the dynamic_liquid mod can result in !!fun!! lava flows when caves intersect with magma conduits.

## Lava interaction with adjacent nodes

This mod provides an ABM that causes some types of nodes adjacent to lava to slowly convert into glowing "hot" forms, and then back to cool forms again if the lava goes away. Stone is converted into hot cobble and obsidian converts to a glowing red form.

Other mods can hook into this ABM by adding the following to node definitions:

```
group:lava_heatable
_magma_conduits_heats_to = hot node name
```

and

```
group:lava_heated
_magma_conduits_cools_to = cool node name
```

so for example default:stone is added to the lava_heatable group and given _magma_conduits_heats_to = "magma_conduits:hot_cobble" and magma_conduits:hot_cobble is in the lava_heated group and is given _magma_conduits_cools_to = "default:cobble".

Also included is an ABM that causes soil adjacent to lava to be cooked into barren sand.

## Magma veins

Magma veins are magma-filled conduits that thread through the ground somewhat like a cave system. The veins have a bias toward vertical orientation but can curve and twist in any direction.

Magma veins can be optionally be lined with a layer of obsidian. The density of vein generation is configurable.

## Volcanoes

Volcanoes are large cone-shaped mountains formed from magma that rises through a central vertical pipe. This mod can scatter randomly sized and shaped volcanoes across the map, with configurable spacing and probability. Volcanoes come in "extinct", "dormant" and "active" forms, and tall volcanoes can have a mantle of snow clinging to their peaks.

If a player has the "findvolcano" priviledge he can use the "findvolcano" console command to locate nearby volcanoes.

### Namegen and named_waypoint support

If the mods [namegen](https://github.com/FaceDeer/namegen) and [named_waypoints](https://github.com/FaceDeer/named_waypoints) are installed, then names and HUD markers will be automatically generated for volcanoes.


code:
local CONFIG_FILE_PREFIX = "magma_conduits_"

magma_conduits.config = {}

local print_settingtypes = false

local function setting(stype, name, default, description)
	local value
	if stype == "bool" then
		value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default)
	elseif stype == "string" then
		value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
	elseif stype == "int" or stype == "float" then
		value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
	end
	if value == nil then
		value = default
	end
	magma_conduits.config[name] = value

	if print_settingtypes then
		minetest.debug(CONFIG_FILE_PREFIX..name.." ("..description..") "..stype.." "..tostring(default))
	end
end

setting("bool", "remove_default_lava", true, "Removes default mapgen lava")
setting("bool", "glowing_rock", true, "Cause rock adjacent to lava to convert into glowing form")
setting("bool", "cook_soil", true, "Cause soil and carbon-containing ores to be cooked into other forms by lava")

setting("bool", "magma_veins", true, "Enable magma veins")
setting("int", "spread", 400, "Approximate spacing between magma conduits")
setting("bool", "obsidian_lining", true, "Add an obsidian lining to magma conduits")
setting("bool", "ameliorate_floods", true, "Ameliorate lava floods on the surface")

-- Removing this setting on account of issue https://github.com/minetest/minetest/issues/7364
-- Fixed with commit https://github.com/minetest/minetest/commit/5c1edc58ab2abe8bc1f1bbcbb2f30a5899586968
setting("int", "upper_limit", -256, "Upper extent of magma conduits")
setting("int", "lower_limit", -31000, "Lower extent of magma conduits")

setting("bool", "volcanoes", true, "Enable volcanoes")
setting("int", "volcano_min_height", 20, "Minimum volcano peak")
setting("int", "volcano_max_height", 200, "Maximum volcano peak")
setting("float", "volcano_min_slope", 0.75, "Minimum volcano slope")
setting("float", "volcano_max_slope", 1.5, "Maximum volcano slope")
setting("int", "volcano_region_mapblocks", 16, "Map blocks per chunk")

setting("int", "volcano_min_depth", -3000, "Lowest point the magma pipe goes to")
setting("bool", "volcano_magma_chambers", true, "Enable magma chambers at the base of the magma pipe")
setting("float", "volcano_magma_chamber_radius_multiplier", 0.5, "Magma chamber radius multiplier")

setting("float", "volcano_probability_active", 0.3, "Probability that there's an active volcano in each region")
setting("float", "volcano_probability_dormant", 0.15, "Probability that there's a dormant volcano in each region")
setting("float", "volcano_probability_extinct", 0.15, "Probability that there's an extinct volcano in each region")


code:
minetest.register_abm{
    label = "soil burning",
	nodenames = {"group:soil"},
	neighbors = {"default:lava_source", "default:lava_flowing"},
	interval = 10,
	chance = 5,
	action = function(pos)
		minetest.set_node(pos, {name = "default:sand"})
		minetest.check_for_falling(pos)
	end,
}


code:
if magma_conduits.config.glowing_rock then

local modpath = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(modpath.."/intllib.lua")

local simple_copy
simple_copy = function(t)
	local r = {}
	for k, v in pairs(t) do
		if type(v) == "table" then
			r[k] = simple_copy(v)
		else
			r[k] = v
		end
	end
	return r
end

magma_conduits.make_hot_node_def = function(name, original_def)
	original_def.groups = original_def.groups or {}
	local hot_node_def = simple_copy(original_def)

	local hot_name = name .. "_glowing"
	original_def.groups.lava_heatable = 1
	original_def._magma_conduits_heats_to = hot_name

	hot_node_def.groups.lava_heated = 1
	hot_node_def.groups.not_in_creative_inventory = 1
	hot_node_def._magma_conduits_cools_to = name
	hot_node_def.description = S("Hot @1", hot_node_def.description)

	for k, v in ipairs(hot_node_def.tiles) do
		hot_node_def.tiles[k] = v .. "^magma_conduits_lava_overlay.png"
	end
	hot_node_def.light_source = 6
	if hot_node_def.drop == nil then
		hot_node_def.drop = name
	end

	return hot_name, hot_node_def
end

minetest.register_node("magma_conduits:hot_cobble", {
	description = S("Hot Cobble"),
	_doc_items_longdesc = S("Hot stone riven with cracks and seeping traces of lava."),
	_doc_items_usagehelp = S("When normal stone is heated by lava it is converted into this. Beware when digging here!"),
	tiles = {"magma_conduits_hot_cobble.png"},
	is_ground_content = false,
	groups = {cracky = 3, stone = 2, lava_heated=1, not_in_creative_inventory=1},
	_magma_conduits_cools_to = "default:cobble",
	sounds = default.node_sound_stone_defaults(),
	light_source = 6,
	drop = "default:cobble",
})

minetest.register_node("magma_conduits:glow_obsidian", {
	description = S("Hot Obsidian"),
	_doc_items_longdesc = S("Obsidian heated to a dull red glow."),
	_doc_items_usagehelp = S("When normal obsidian is heated by lava it is converted into this. Beware when digging here!"),
	tiles = {"magma_conduits_glow_obsidian.png"},
	is_ground_content = true,
	sounds = default.node_sound_stone_defaults(),
	groups = {cracky=1, lava_heated=1, level=2, not_in_creative_inventory=1},
	_magma_conduits_cools_to = "default:obsidian",
	light_source = 6,
	drop = "default:obsidian",
})

-- can't use minetest.override_item to change group memberships here due to issue https://github.com/minetest/minetest/issues/5518

local make_heatable = function(nodename, heats_to)
	local original_def = minetest.registered_nodes[nodename]
	if original_def ~= nil then
		local def = simple_copy(original_def)
		def.groups.lava_heatable = 1
		def._magma_conduits_heats_to = heats_to
		minetest.register_node(":"..nodename, def)
	end
end

make_heatable("default:obsidian", "magma_conduits:glow_obsidian")

make_heatable("default:stone", "magma_conduits:hot_cobble")
make_heatable("default:cobble", "magma_conduits:hot_cobble")
make_heatable("default:mossycobble", "magma_conduits:hot_cobble")
make_heatable("default:stone_with_coal", "magma_conduits:hot_cobble")
make_heatable("default:stone_with_diamond", "magma_conduits:hot_cobble")

make_heatable("default:permafrost", "default:dirt")
make_heatable("default:permafrost_with_stones", "default:dirt")
make_heatable("default:permafrost_with_moss", "default:dirt")

minetest.register_abm{
    label = "magma_conduits lava heating neighbors",
	nodenames = {"group:lava_heatable"},
	neighbors = {"default:lava_source", "default:lava_flowing"},
	interval = 10,
	chance = 5,
	action = function(pos)
		local name = minetest.get_node(pos).name
		local def = minetest.registered_nodes[name]

		if def.groups.lava_heatable then
			local target = def._magma_conduits_heats_to
			if target then
				minetest.set_node(pos, {name = target})
			else
				minetest.log("error", name .. " is in group lava_heatable but doesn't have a _magma_conduits_heats_to property defined in its definition")
			end
		end
	end,
}

minetest.register_abm{
    label = "magma_conduits cooling stuff heated by lava",
	nodenames = {"group:lava_heated"},
	interval = 100,
	chance = 10,
	action = function(pos)
		if not minetest.find_node_near(pos, 2, {"default:lava_source", "default:lava_flowing"}, false) then
			local name = minetest.get_node(pos).name
			local def = minetest.registered_nodes[name]
			local target = def._magma_conduits_cools_to
			if target then
				minetest.set_node(pos, {name = target})
			else
				minetest.log("error", name .. " is in group lava_heated but doesn't have a _magma_conduits_cools_to property defined in its definition")
			end
		end
	end,
}

else

minetest.register_alias("magma_conduits:hot_cobble", "default:cobble")
minetest.register_alias("magma_conduits:glow_obsidian", "default:obsidian")

end


code:
magma_conduits = {}

local modpath = minetest.get_modpath(minetest.get_current_modname())
dofile(modpath.."/config.lua")
dofile(modpath.."/voxelarea_iterator.lua")
dofile(modpath.."/hot_rock.lua")

if magma_conduits.config.remove_default_lava then
	minetest.register_alias_force("mapgen_lava_source", "air")
end

if magma_conduits.config.magma_veins then
	dofile(modpath.."/magma_veins.lua")
end
if magma_conduits.config.volcanoes then
	dofile(modpath.."/volcanoes.lua")
end
if magma_conduits.config.cook_soil then
	dofile(modpath.."/cook_soil.lua")
end


code:
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.

-- Get the latest version of this file at:
--   https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua

local function format(str, ...)
	local args = { ... }
	local function repl(escape, open, num, close)
		if escape == "" then
			local replacement = tostring(args[tonumber(num)])
			if open == "" then
				replacement = replacement..close
			end
			return replacement
		else
			return "@"..open..num..close
		end
	end
	return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end

local gettext, ngettext
if minetest.get_modpath("intllib") then
	if intllib.make_gettext_pair then
		-- New method using gettext.
		gettext, ngettext = intllib.make_gettext_pair()
	else
		-- Old method using text files.
		gettext = intllib.Getter()
	end
end

-- Fill in missing functions.

gettext = gettext or function(msgid, ...)
	return format(msgid, ...)
end

ngettext = ngettext or function(msgid, msgid_plural, n, ...)
	return format(n==1 and msgid or msgid_plural, ...)
end

return gettext, ngettext


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-22 00:26-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: hot_rock.lua:7
msgid "Hot Cobble"
msgstr ""

#: hot_rock.lua:8
msgid "Hot stone riven with cracks and seeping traces of lava."
msgstr ""

#: hot_rock.lua:9
msgid ""
"When normal stone is heated by lava it is converted into this. Beware when "
"digging here!"
msgstr ""

#: hot_rock.lua:19
msgid "Hot Obsidian"
msgstr ""

#: hot_rock.lua:20
msgid "Obsidian heated to a dull red glow."
msgstr ""

#: hot_rock.lua:21
msgid ""
"When normal obsidian is heated by lava it is converted into this. Beware "
"when digging here!"
msgstr ""


code:
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
cd ..
set LIST=
for /r %%X in (*.lua) do set LIST=!LIST! %%X
..\intllib\tools\xgettext.bat %LIST%


code:
-- Hard-coding on account of issue https://github.com/minetest/minetest/issues/7364
local height_min = magma_conduits.config.lower_limit
local height_max = magma_conduits.config.upper_limit

minetest.register_ore({
	ore_type = "vein",
	ore = "default:lava_source",
	wherein = {
		"default:stone",
		"default:desert_stone",
		"default:sandstone",
		"default:stone_with_coal",
		"default:stone_with_iron",
		"default:stone_with_copper",
		"default:stone_with_tin",
		"default:stone_with_gold",
		"default:stone_with_diamond",
		"default:dirt",
		"default:dirt_with_grass",
		"default:dirt_with_dry_grass",
		"default:dirt_with_snow",
		"default:dirt_with_rainforest_litter",
		"default:dirt_with_coniferous_litter",
		"default:sand",
		"default:desert_sand",
		"default:silver_sand",
		"default:gravel",
	},
	column_height_min = 2,
	column_height_max = 6,
	y_min = height_min,
	y_max = height_max,
	noise_threshold = 0.9,
	noise_params = {
		offset = 0,
		scale = 3,
		spread = {x=magma_conduits.config.spread, y=magma_conduits.config.spread*2, z=magma_conduits.config.spread},
		seed = 25391,
		octaves = 4,
		persist = 0.5,
		flags = "eased",
	},
	random_factor = 0,
})

-------------------------------------------------------------------------------------------------

local water_level = tonumber(minetest.get_mapgen_setting("water_level"))

local ameliorate_floods = magma_conduits.config.ameliorate_floods
local obsidian_lining = magma_conduits.config.obsidian_lining

local c_air = minetest.get_content_id("air")
local c_lava = minetest.get_content_id("default:lava_source")
local c_stone = minetest.get_content_id("default:stone")
local c_obsidian = minetest.get_content_id("default:obsidian")

local is_adjacent_to_air = function(area, data, x, y, z)
	return (data[area:index(x+1, y, z)] == c_air
		or data[area:index(x-1, y, z)] == c_air
		or data[area:index(x, y, z+1)] == c_air
		or data[area:index(x, y, z-1)] == c_air
		or data[area:index(x, y-1, z)] == c_air)
end

local remove_unsupported_lava
remove_unsupported_lava = function(area, data, vi, x, y, z)
	--if below water level, abort. Caverns are on their own.
	if y < water_level or not area:contains(x, y, z) then return end

	if data[vi] == c_lava then
		if is_adjacent_to_air(area, data, x, y, z) then
			data[vi] = c_air
			for pi, x2, y2, z2 in area:iter_xyz(x-1, y, z-1, x+1, y+1, z+1) do
				if pi ~= vi and area:containsi(pi) then
					remove_unsupported_lava(area, data, pi, x2, y2, z2)
				end
			end
		end
	end
end

-- If we're adding glow versions of rock, then place glow obsidian directly.
local obsidianize_id
if magma_conduits.config.glowing_rock then
	obsidianize_id = minetest.get_content_id("magma_conduits:glow_obsidian")
else
	obsidianize_id = c_obsidian
end

local obsidianize = function(area, data, vi, x, y, z, minp, maxp)
	if data[vi] == c_lava then
		for pi in area:iter(math.max(x-1, minp.x), math.max(y-1, minp.y), math.max(z-1, minp.z),
							math.min(x+1, maxp.x), math.min(y+1, maxp.y), math.min(z+1, maxp.z)) do
			if data[pi] == c_stone then
				data[pi] = obsidianize_id
			end
		end
	end
end

local data = {}

minetest.register_on_generated(function(minp, maxp, seed)
	local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
	local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
	vm:get_data(data)

	for vi, x, y, z in area:iterp_xyz(minp, maxp) do
		if obsidian_lining then
			obsidianize(area, data, vi, x, y, z, minp, maxp)
		end
		if ameliorate_floods then
			remove_unsupported_lava(area, data, vi, x, y, z)
		end
	end

	--send data back to voxelmanip
	vm:set_data(data)
	--calc lighting
	vm:set_lighting({day = 0, night = 0})
	vm:calc_lighting()
	vm:update_liquids()
	--write it to world
	vm:write_to_map()
end)


code:
name = magma_conduits
description = Removes default mapgen lava and adds widely-spaced volcanoes and lava "veins".
depends = default
optional_depends = namegen, intllib, doc, named_waypoints


code:
magma_conduits_glowing_rock (Cause rock adjacent to lava to convert into "glowing" form) bool true
magma_conduits_cook_soil (Cause soil and carbonaceous ores adjacent to lava to cook) bool true
magma_conduits_remove_default_lava (Remove default mapgen lava) bool true

[Magma Veins]
#If this is false none of the other settings in this section apply
magma_conduits_magma_veins (Enable magma veins) bool true
magma_conduits_spread (Approximate spacing between magma conduits) int 400
magma_conduits_obsidian_lining (Add an obsidian lining to magma conduits) bool true
#Removes magma near the surface that could spill out of an open magma vein onto
#surrounding terrain
magma_conduits_ameliorate_floods (Ameliorate lava floods on the surface) bool true

# Note: Setting limits near "0" in versions of Minetest before June 2018
# commit 5c1edc5 may cause a crash due to a bug in vein ore generation
magma_conduits_upper_limit (Upper extent of magma conduits) int -256
magma_conduits_lower_limit (Lower extent of magma conduits) int -31000

[Volcanoes]
#If this is false none of the other settings in this section apply
magma_conduits_volcanoes (Enable volcanoes) bool true
magma_conduits_volcano_min_height (Minimum volcano peak elevation) int 20
magma_conduits_volcano_max_height (Maximum volcano peak elevation) int 200
#smaller slopes are steeper. 0.5 is probably the lowest this should go,
#things get unrealistic around there
magma_conduits_volcano_min_slope (Minimum volcano slope) float 0.75
#above 1.5 and the mountain becomes more of a shield volcano,
#taking up a lot of map area.
magma_conduits_volcano_max_slope (Maximum volcano slope) float 1.5
#The size of the region within which each volcano is randomly placed
#measured in mapblocks, which is usually 80 nodes on a side.
#Eg, the default of 16 means that one volcano is placed in each
#1280x1280 node region.
magma_conduits_volcano_region_mapblocks (Region mapblocks) int 16

magma_conduits_volcano_min_depth (Lowest depth magma pipes extend to) int -3000
magma_conduits_volcano_magma_chambers (Enables magma chambers at base of pipes) bool true
#With a multiplier of 1, magma chambers are the same size as the mountain above them.
magma_conduits_volcano_magma_chamber_radius_multiplier (Magma chamber radius multiplier) float 0.5

magma_conduits_volcano_probability_active (Probability of active volcano in region) float 0.3
magma_conduits_volcano_probability_dormant (Probability of dormant volcano in region) float 0.15
magma_conduits_volcano_probability_extinct (Probability of extinct volcano in region) float 0.15

[Volcano HUD waypoints]
magma_conduits_show_volcanoes_in_hud (Show volcanoes in HUD) bool true
magma_conduits_hud_requires_item (Require an item to view waypoints) bool true
#Players can still discover the locations of volcanoes without this, but waypoints
#will only be visible in their hud if they have this item in their inventory. You can also
#specify "group:groupname" here. Leave it blank to default to map:mapping_kit.
magma_conduits_hud_item_required (Specify the item or group required) string map:mapping_kit
magma_conduits_volcano_discovery_range (Volcano discovery range) int 60
magma_conduits_volcano_visibility_range (Volcano HUD visibility range) int 1000


code:
-- These nodes are only present to work around https://github.com/minetest/minetest/issues/7864
-- somehow, placing lava that's a light source is sometimes killing the game.
-- This causes the mod to place non-glowing lava on mapgen that is immediately replaced with
-- the regular stuff as soon as the chunk is loaded.
-- Once that issue is resolved, this should be got rid of.

local simple_copy
simple_copy = function(t)
	local r = {}
	for k, v in pairs(t) do
		if type(v) == "table" then
			r[k] = simple_copy(v)
		else
			r[k] = v
		end
	end
	return r
end

local source_def = simple_copy(minetest.registered_nodes["default:lava_source"])
source_def.light_source = nil
source_def.liquid_alternative_flowing = "magma_conduits:lava_flowing"
source_def.liquid_alternative_source = "magma_conduits:lava_source"
source_def.groups.not_in_creative_inventory = 1

minetest.register_node("magma_conduits:lava_source", source_def)

local flowing_def = simple_copy(minetest.registered_nodes["default:lava_flowing"])
flowing_def.light_source = nil
flowing_def.liquid_alternative_flowing = "magma_conduits:lava_flowing"
flowing_def.liquid_alternative_source = "magma_conduits:lava_source"

minetest.register_node("magma_conduits:lava_flowing", flowing_def)

minetest.register_lbm({
	label = "convert magma_conduits lava",
	name = "magma_conduits:convert_lava",
	nodenames = {"magma_conduits:lava_source"},
	run_at_every_load = true,
	action = function(pos, node)
		minetest.set_node(pos, {name="default:lava_source"})
	end,
})

minetest.register_lbm({
	label = "convert magma_conduits flowing lava",
	name = "magma_conduits:convert_flowing_lava",
	nodenames = {"magma_conduits:lava_flowing"},
	run_at_every_load = true,
	action = function(pos, node)
		minetest.set_node(pos, {name="default:lava_flowing"})
	end,
})

-- Mapgen v7 has a glitch where it will sometimes cut slices out of default:stone placed by this mod
-- *after* mapgen is finished. The slices are taken at maxp.y or minp.y and match the
-- rivers formed by the "ridges" flag, if you disable "ridges" they don't occur.
-- Some annoying hackery is needed to patch those slices back up
-- again, and I only want to do that hackery if we're actually in mapgen v7.
-- https://github.com/minetest/minetest/issues/7878
if minetest.get_mapgen_setting("mg_name") == "v7" then

	local stone_def = simple_copy(minetest.registered_nodes["default:stone"])
	stone_def.is_ground_content = false

	minetest.register_node("magma_conduits:stone", stone_def)
	minetest.register_lbm({
		label = "convert magma_conduits stone",
		name = "magma_conduits:convert_stone",
		nodenames = {"magma_conduits:stone"},
		run_at_every_load = true,
		action = function(pos, node)
			minetest.set_node(pos, {name="default:stone"})
		end,
	})
end


code:
name "active_volcano" {
  syllablesStart = "Fire, Smolder, Grey, Ash, Pyre, Ember, Forge, Crack, Earth, Stone, Boulder, Sulphur, Mist, Cloud, Tomb, Inferno, Gout, Gyre, Storm, Sulphur, Sour, Vapor, Miasma, Steam, Trickle, Scorch, Dragon, Drake, Smog, Salamander, Phoenix, Wyrm, Hydra, Wyvern, Diamond, Ruby, Obsidian, Black, White, Thunder"

  syllablesEnd = "forge, mouth, heap, cone, pit, vent, horn, well, crack, split, mass, horn, scar, wall, well, rock, tumble, shard, scar, nest, gate, portal, plume, burn, scorch, drake, thunder, mount"

  syllablesPost = "Peak, Crag, Spire, Mountain, Tor, Ridge, Dome, Mound, Palisade, Volcano, Apex"

  rules = "Mount_$s$e, $s$e_$90p, 10%$s_$p"
}

name "inactive_volcano" {
  syllablesStart = "Bird, Baker, Ball, Aurora, Aerie, Bishop, Block, Blue, Grey, Cave, Caribou, Cole, Cirrus, Copper, Cougar, Crow, Eagle, Fable, Fiddle, Finger, Fox, Gloria, Gold, Gordon, Heart, Goat, Kent, Red, Ring, Rose, Rundle, Shark, Scarab, Smut, Snow, South, North, East, West, Stone, Storm, Sulphur, Cloud, Temple, Tomb, Terra, Tower, Tunnel, Twin, Turtle, Trap, War, Wedge, Wind, Wonder, Cirrus, Loft, Shard, Splinter, Block, Wedge, Rubble, Sheep, Heaven, Upper, Low, Flat, Tall, Ever, Never, Force, Cold, Ice, Spike, Anvil, Hammer, Black, White, Obsidian, Thunder"

  syllablesEnd = "wood, ston, ton, land, lets, wall, well, foot, nest, en, view, hood, arch, met, meet, horn, holm, scraper, swept, shard, scar, loft, rock, stone, slab, spike, spine, wedge, fold, crack, spit, anvil, hammer, thunder, mount"

  syllablesPost = "Peak, Crag, Spire, Mountain, Tor, Ridge, Dome, Mound, Palisade, Apex"

  rules = "Mount_$s$80e, $s$e_$90p, 20%$s_$p"
}


code:
-- NOTE: This code contains some hacks to work around a number of bugs in mapgen v7 and in Minetest's core mapgen code.
-- The issue URLs for those bugs are included in comments wherever those hacks are used, if the issues get resolved
-- then the associated hacks should be removed.
-- https://github.com/minetest/minetest/issues/7878
-- https://github.com/minetest/minetest/issues/7864

local modpath = minetest.get_modpath(minetest.get_current_modname())
dofile(modpath .. "/volcano_lava.lua") -- https://github.com/minetest/minetest/issues/7864, https://github.com/minetest/minetest/issues/7878

local S, NS = dofile(modpath.."/intllib.lua")

local named_waypoints_modpath = minetest.get_modpath("named_waypoints")
if named_waypoints_modpath then
	local volcano_waypoint_def = {
		default_name = S("a volcano"),
		default_color = 0xFFFFFF,
		discovery_volume_radius = tonumber(minetest.settings:get("magma_conduits_volcano_discovery_range")) or 60,
	}

	if minetest.settings:get_bool("magma_conduits_hud_requires_item", true) then
		local item_required = minetest.settings:get("magma_conduits_hud_item_required")
		if item_required == nil or item_required == "" then
			item_required = "map:mapping_kit"
		end
		volcano_waypoint_def.visibility_requires_item = item_required
	end

	if minetest.settings:get_bool("magma_conduits_show_volcanoes_in_hud", true) then
		volcano_waypoint_def.visibility_volume_radius = tonumber(minetest.settings:get("magma_conduits_volcano_visibility_range")) or 1000
		volcano_waypoint_def.on_discovery = named_waypoints.default_discovery_popup
	end
	named_waypoints.register_named_waypoints("volcanoes", volcano_waypoint_def)
end

local depth_root = magma_conduits.config.volcano_min_depth
local depth_base = -50 -- point where the mountain root starts expanding
local depth_maxwidth = -30 -- point of maximum width

local radius_vent = 3 -- approximate minimum radius of vent - noise adds a lot to this
local radius_lining = 5 -- the difference between this and the vent radius is about how thick the layer of lining nodes is, though noise will affect it
local caldera_min = 5 -- minimum radius of caldera
local caldera_max = 20 -- maximum radius of caldera

local snow_line = 120 -- above this elevation snow is added to the dirt type
local snow_border = 15 -- transitional zone where there's dirt with snow on it

local depth_maxpeak = magma_conduits.config.volcano_max_height
local depth_minpeak = magma_conduits.config.volcano_min_height
local slope_min = magma_conduits.config.volcano_min_slope
local slope_max = magma_conduits.config.volcano_max_slope

local region_mapblocks = magma_conduits.config.volcano_region_mapblocks
local mapgen_chunksize = tonumber(minetest.get_mapgen_setting("chunksize"))
local volcano_region_size = region_mapblocks * mapgen_chunksize * 16

local magma_chambers_enabled = magma_conduits.config.volcano_magma_chambers
local chamber_radius_multiplier = magma_conduits.config.volcano_magma_chamber_radius_multiplier

local p_active = magma_conduits.config.volcano_probability_active
local p_dormant = magma_conduits.config.volcano_probability_dormant
local p_extinct = magma_conduits.config.volcano_probability_extinct

if p_active + p_dormant + p_extinct > 1.0 then
	minetest.log("error", "[magma_conduits] probabilities of various volcano types adds up to more than 1")
end

local state_dormant = 1 - p_active
local state_extinct = 1 - p_active - p_dormant
local state_none = 1 - p_active - p_dormant - p_extinct

local c_air = minetest.get_content_id("air")
local c_lava = minetest.get_content_id("magma_conduits:lava_source") -- https://github.com/minetest/minetest/issues/7864
local c_water = minetest.get_content_id("default:water_source")

local c_lining = minetest.get_content_id("default:obsidian")
local c_hot_lining = minetest.get_content_id("default:obsidian")

local c_cone
if minetest.get_mapgen_setting("mg_name") == "v7" then
	c_cone = minetest.get_content_id("magma_conduits:stone") -- https://github.com/minetest/minetest/issues/7878
else
	c_cone = minetest.get_content_id("default:stone")
end

local c_ash = minetest.get_content_id("default:gravel")
local c_soil = minetest.get_content_id("default:dirt")
local c_soil_snow = minetest.get_content_id("default:dirt_with_snow")
local c_snow = minetest.get_content_id("default:snow")
local c_snow_block = minetest.get_content_id("default:snowblock")

local c_sand = minetest.get_content_id("default:sand")
local c_underwater_soil = c_sand
local c_plug = minetest.get_content_id("default:obsidian")

if magma_conduits.config.glowing_rock then
	c_hot_lining = minetest.get_content_id("magma_conduits:glow_obsidian")
end

local water_level = tonumber(minetest.get_mapgen_setting("water_level"))
local mapgen_seed = tonumber(minetest.get_mapgen_setting("seed"))

-- derived values

local radius_cone_max =  (depth_maxpeak - depth_maxwidth) * slope_max + radius_lining + 20
local depth_maxwidth_dist = depth_maxwidth-depth_base
local depth_maxpeak_dist = depth_maxpeak-depth_maxwidth

local scatter_2d = function(min_xz, gridscale, border_width)
	local bordered_scale = gridscale - 2 * border_width
	local point = {}
	point.x = math.random() * bordered_scale + min_xz.x + border_width
	point.y = 0
	point.z = math.random() * bordered_scale + min_xz.z + border_width
	return point
end

-- For some reason, map chunks generate with -32, -32, -32 as the "origin" minp. To make the large-scale grid align with map chunks it needs to be offset like this.
local get_corner = function(pos)
	return {x = math.floor((pos.x+32) / volcano_region_size) * volcano_region_size - 32, z = math.floor((pos.z+32) / volcano_region_size) * volcano_region_size - 32}
end

local namegen_path = minetest.get_modpath("namegen")
if namegen_path then
	namegen.parse_lines(io.lines(modpath.."/volcano_names.cfg"))
end

local get_volcano = function(pos)
	local corner_xz = get_corner(pos)
	local next_seed = math.random(1, 1000000000)
	math.randomseed(corner_xz.x + corner_xz.z * 2 ^ 8 + mapgen_seed)

	local state = math.random()
	if state < state_none then
		math.randomseed(next_seed)
		return nil
	end

	local name
	local color
	local location = scatter_2d(corner_xz, volcano_region_size, radius_cone_max)
	local depth_peak = math.random(depth_minpeak, depth_maxpeak)
	local depth_lava
	if state < state_extinct then
		depth_lava = - math.random(1, math.abs(depth_root)) -- extinct, put the lava somewhere deep.
		if namegen_path then
			name = namegen.generate("inactive_volcano")
		end
	elseif state < state_dormant then
		depth_lava = depth_peak - math.random(5, 50) -- dormant
		if namegen_path then
			name = namegen.generate("inactive_volcano")
		end
	else
		depth_lava = depth_peak - math.random(1, 25) -- active, put the lava near the top
		if namegen_path then
			name = namegen.generate("active_volcano")
		end
		color = 0xFF7F00 -- orange
	end
	local slope = math.random() * (slope_max - slope_min) + slope_min
	local caldera = math.random() * (caldera_max - caldera_min) + caldera_min

	if named_waypoints_modpath then
		named_waypoints.add_waypoint("volcanoes", {x=location.x, y=depth_peak, z=location.z}, {name=name, color=color})
	end

	math.randomseed(next_seed)
	return {location = location, depth_peak = depth_peak, depth_lava = depth_lava, slope = slope, state = state, caldera = caldera}
end

local perlin_params = {
	offset = 0,
	scale = 1,
	spread = {x=30, y=30, z=30},
	seed = -40901,
	octaves = 3,
	persist = 0.67
}
local nvals_perlin_buffer = {}
local nobj_perlin = nil
local data = {}

minetest.register_on_generated(function(minp, maxp, seed)
	if minp.y > depth_maxpeak or maxp.y < depth_root then
		return
	end

	local volcano = get_volcano(minp)

	if volcano == nil then
		return -- no volcano in this map region
	end

	local depth_peak = volcano.depth_peak
	local base_radius = (depth_peak - depth_maxwidth) * volcano.slope + radius_lining
	local chamber_radius = (base_radius / volcano.slope) * chamber_radius_multiplier

	-- early out if the volcano is too far away to matter
	-- The plus 20 is because the noise being added will generally be in the 0-20 range, see the "distance" calculation below
	if	volcano.location.x - base_radius - 20 > maxp.x or
		volcano.location.x + base_radius + 20 < minp.x or
		volcano.location.z - base_radius - 20 > maxp.z or
		volcano.location.z + base_radius + 20 < minp.z
	then
		return
	end

	local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
	local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
	vm:get_data(data)

	local sidelen = mapgen_chunksize * 16 --length of a mapblock
	local chunk_lengths = {x = sidelen, y = sidelen, z = sidelen} --table of chunk edges

	nobj_perlin = nobj_perlin or minetest.get_perlin_map(perlin_params, chunk_lengths)
	local nvals_perlin = nobj_perlin:get_3d_map_flat(minp, nvals_perlin_buffer)
	local noise_area = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}
	local noise_iterator = noise_area:iterp(minp, maxp)

	local x_coord = volcano.location.x
	local z_coord = volcano.location.z
	local depth_lava = volcano.depth_lava
	local caldera = volcano.caldera
	local state = volcano.state

	-- Create a table of biome data for use with the biomemap.
	if not magma_conduits.biome_ids then
		magma_conduits.biome_ids = {}
		for name, desc in pairs(minetest.registered_biomes) do
			local i = minetest.get_biome_id(desc.name)
			local biome_data = {}
			--biome_data.name = desc.name
			if desc.node_dust ~= nil and desc.node_dust ~= "" then
				biome_data.c_dust = minetest.get_content_id(desc.node_dust)
			end
			if desc.node_top ~= nil and desc.node_top ~= "" then
				biome_data.c_top = minetest.get_content_id(desc.node_top)
				if biome_data.c_top == c_sand then
					biome_data.c_top = c_ash -- beach sand just doesn't look nice on the side of a volcano, replace it with ash
				end
			end
			if desc.node_filler ~= nil and desc.node_filler ~= "" then
				biome_data.c_filler = minetest.get_content_id(desc.node_filler)
				if biome_data.c_filler == c_sand then
					biome_data.c_filler = c_ash -- beach sand just doesn't look nice on the side of a volcano, replace it with ash
				end
			end
			magma_conduits.biome_ids[i] = biome_data
		end
	end
	local biomemap = minetest.get_mapgen_object("biomemap")
	local minx = minp.x
	local minz = minp.z

	for vi, x, y, z in area:iterp_xyz(minp, maxp) do

		local vi3d = noise_iterator()

		local distance_perturbation = (nvals_perlin[vi3d]+1)*10
		local distance = vector.distance({x=x, y=y, z=z}, {x=x_coord, y=y, z=z_coord}) - distance_perturbation

		local biome_data
		if biomemap ~= nil then
			biome_data = magma_conduits.biome_ids[biomemap[(z-minz) * sidelen + (x-minx) + 1]]
		end

		-- Determine what materials to use at this y level
		-------------------------------------------------------------------------------------------------

		local c_top
		local c_filler
		local c_dust
		if state < state_dormant then
			if y < water_level then
				c_top = c_underwater_soil
				c_filler = c_underwater_soil
			elseif y < snow_line and biome_data ~= nil then
				c_top = biome_data.c_top
				c_filler = biome_data.c_filler
				c_dust = biome_data.c_dust
			elseif y < snow_line + snow_border then
				c_top = c_soil_snow
				c_filler = c_soil
				c_dust = c_snow
			else
				c_top = c_snow_block
				c_filler = c_snow_block
				c_dust = c_snow
			end
		else
			c_top = c_ash
			c_filler = c_ash
		end

		local pipestuff
		local liningstuff
		if y < depth_lava + math.random() * 1.1 then
			pipestuff = c_lava
			liningstuff = c_hot_lining
		else
			if state < state_dormant then
				pipestuff = c_plug -- dormant volcano
				liningstuff = c_lining
			else
				pipestuff = c_air -- active volcano
				liningstuff = c_lining
			end
		end

		-- Actually create the volcano
		-------------------------------------------------------------------------------------------

		if y < depth_base then
			if magma_chambers_enabled and y < depth_root + chamber_radius then -- Magma chamber lower half
				local lower_half = ((y - depth_root) / chamber_radius) * chamber_radius
				if distance < lower_half + radius_vent then
					data[vi] = c_lava -- Put lava in the magma chamber even for extinct volcanoes, if someone really wants to dig for it it's down there.
				elseif distance < lower_half + radius_lining and data[vi] ~= c_air and data[vi] ~= c_lava then -- leave holes into caves and into existing lava
					data[vi] = liningstuff
				end
			elseif magma_chambers_enabled and y < depth_root + chamber_radius * 2 then -- Magma chamber upper half
				local upper_half = (1 - (y - depth_root - chamber_radius) / chamber_radius) * chamber_radius
				if distance < upper_half + radius_vent then
					data[vi] = c_lava
				elseif distance < upper_half + radius_lining and data[vi] ~= c_air and data[vi] ~= c_lava then -- leave holes into caves and into existing lava
					data[vi] = liningstuff
				end
			else -- pipe
				if distance < radius_vent then
					data[vi] = pipestuff
				elseif distance < radius_lining and data[vi] ~= c_air and data[vi] ~= c_lava then -- leave holes into caves and into existing lava
					data[vi] = liningstuff
				end
			end
		elseif y < depth_maxwidth then -- root
			if distance < radius_vent then
				data[vi] = pipestuff
			elseif distance < radius_lining then
				data[vi] = liningstuff
			elseif distance < radius_lining + ((y - depth_base)/depth_maxwidth_dist) * base_radius then
				data[vi] = c_cone
			end
		elseif y < depth_peak + 5 then -- cone
			local current_elevation = y - depth_maxwidth
			local peak_elevation = depth_peak - depth_maxwidth
			if current_elevation > peak_elevation - caldera and distance < current_elevation - peak_elevation + caldera then
				data[vi] = c_air -- caldera
			elseif distance < radius_vent then
				data[vi] = pipestuff
			elseif distance < radius_lining then
				data[vi] = liningstuff
			elseif distance <  current_elevation * -volcano.slope + base_radius then
				data[vi] = c_cone
				if data[vi + area.ystride] == c_air and c_dust ~= nil then
					data[vi + area.ystride] = c_dust
				end
			elseif c_top ~= nil and c_filler ~= nil and distance < current_elevation * -volcano.slope + base_radius + nvals_perlin[vi3d]*-4 then
				data[vi] = c_top
				if data[vi - area.ystride] == c_top then
					data[vi - area.ystride] = c_filler
				end
				if data[vi + area.ystride] == c_air and c_dust ~= nil then
					data[vi + area.ystride] = c_dust
				end
			end

		end
	end

	--send data back to voxelmanip
	vm:set_data(data)
	--calc lighting
	vm:set_lighting({day = 0, night = 0})
	vm:calc_lighting()
	vm:update_liquids()
	--write it to world
	vm:write_to_map()
end)

----------------------------------------------------------------------------------------------
-- Debugging and sightseeing commands

minetest.register_privilege("findvolcano", { description = "Allows players to use a console command to find volcanoes", give_to_singleplayer = false})

function round(val, decimal)
  if (decimal) then
    return math.floor( (val * 10^decimal) + 0.5) / (10^decimal)
  else
    return math.floor(val+0.5)
  end
end

local send_volcano_state = function(pos, name)
	local corner_xz = get_corner(pos)
	local volcano = get_volcano(pos)
	if volcano == nil then
		return false
	end
	local location = {x=math.floor(volcano.location.x), y=volcano.depth_peak, z=math.floor(volcano.location.z)}
	local text = "Peak at " .. minetest.pos_to_string(location)
		.. ", Slope: " .. tostring(round(volcano.slope, 2))
		.. ", State: "
	if volcano.state < state_extinct then
		text = text .. "Extinct"
	elseif volcano.state < state_dormant then
		text = text .. "Dormant"
	else
		text = text .. "Active"
	end

	minetest.chat_send_player(name, text)
	return true
end

local send_nearby_states = function(pos, name)
	local retval = false
	retval = send_volcano_state({x=pos.x-volcano_region_size, y=0, z=pos.z+volcano_region_size}, name) or retval
	retval = send_volcano_state({x=pos.x, y=0, z=pos.z+volcano_region_size}, name) or retval
	retval = send_volcano_state({x=pos.x+volcano_region_size, y=0, z=pos.z+volcano_region_size}, name) or retval
	retval = send_volcano_state({x=pos.x-volcano_region_size, y=0, z=pos.z}, name) or retval
	retval = send_volcano_state(pos, name) or retval
	retval = send_volcano_state({x=pos.x+volcano_region_size, y=0, z=pos.z}, name) or retval
	retval = send_volcano_state({x=pos.x-volcano_region_size, y=0, z=pos.z-volcano_region_size}, name) or retval
	retval = send_volcano_state({x=pos.x, y=0, z=pos.z-volcano_region_size}, name) or retval
	retval = send_volcano_state({x=pos.x+volcano_region_size, y=0, z=pos.z-volcano_region_size}, name) or retval
	return retval
end

minetest.register_chatcommand("findvolcano", {
    params = "pos", -- Short parameter description
    description = "find the volcanoes near the player's map region, or in the map region containing pos if provided",
    func = function(name, param)
		if minetest.check_player_privs(name, {findvolcano = true}) then
			local pos = {}
			pos.x, pos.y, pos.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
			pos.x = tonumber(pos.x)
			pos.y = tonumber(pos.y)
			pos.z = tonumber(pos.z)
			if pos.x and pos.y and pos.z then
				if not send_nearby_states(pos, name) then
					minetest.chat_send_player(name, "No volcanoes near " .. minetest.pos_to_string(pos))
				end
				return true
			else
				local playerobj = minetest.get_player_by_name(name)
				pos = playerobj:get_pos()
				if not send_nearby_states(pos, name) then
					pos.x = math.floor(pos.x)
					pos.y = math.floor(pos.y)
					pos.z = math.floor(pos.z)
					minetest.chat_send_player(name, "No volcanoes near " .. minetest.pos_to_string(pos))
				end
				return true
			end
		else
			return false, "You need the findvolcano privilege to use this command."
		end
	end,
})


code:
-- These functions are a minor modification of the voxel area iterator defined in the built in voxelarea.lua lua code.
-- As such, this file is separately licened under the LGPL as follows:

-- License of Minetest source code
-------------------------------

--Minetest
--Copyright (C) 2010-2018 celeron55, Perttu Ahola <celeron55@gmail.com>

--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.

--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--GNU Lesser General Public License for more details.

--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

function VoxelArea:iter_xyz(minx, miny, minz, maxx, maxy, maxz)
	local i = self:index(minx, miny, minz) - 1

	local x = minx - 1 -- subtracting one because x gets incremented before it gets returned the first time.
	local xrange = maxx - minx + 1
	local nextaction = i + 1 + xrange

	local y = 0
	local yrange = maxy - miny + 1
	local yreqstride = self.ystride - xrange

	local z = 0
	local zrange = maxz - minz + 1
	local multistride = self.zstride - ((yrange - 1) * self.ystride + xrange)

	return function()
		-- continue i until it needs to jump
		i = i + 1
		x = x + 1
		if i ~= nextaction then
			return i, x, y+miny, z+minz
		end

		-- continue y until maxy is exceeded
		y = y + 1
		x = minx -- new line
		if y ~= yrange then
			-- set i to index(minx, miny + y, minz + z) - 1
			i = i + yreqstride
			nextaction = i + xrange
			return i, x, y+miny, z+minz
		end

		-- continue z until maxz is exceeded
		z = z + 1
		if z == zrange then
			-- cuboid finished, return nil
			return
		end

		-- set i to index(minx, miny, minz + z) - 1
		i = i + multistride

		y = 0
		nextaction = i + xrange
		return i, x, y+miny, z+minz
	end
end

function VoxelArea:iterp_xyz(minp, maxp)
	return self:iter_xyz(minp.x, minp.y, minp.z, maxp.x, maxp.y, maxp.z)
end


code:
name = MAPGEN
description = Meta-modpack containing map generating mods for MeseCraft