function modReset()

    -- World
    regSetBool('world.debugMode'    , false)
    regSetInt('world.chunkSize'     , 64)
    regSetInt('world.renderDistance', 16)
    regSetBool('world.despawnChunks', false)
    regSetString('world.generate'   , "floor + walls")

    -- Floor
    regSetBool('floor.unbreakable'  , false)
    regSetString('floor.material'   , "grass")
    regSetInt('floor.color.r'       , 55)
    regSetInt('floor.color.g'       , 80)
    regSetInt('floor.color.b'       , 55)
    regSetInt('floor.color.a'       , 255)
    regSetString('floor.texture'    , "grass")
    regSetInt('floor.textureOpacity', 80)
    regSetInt('floor.metallic'      , 0)
    regSetInt('floor.roughness'     , 0)
    regSetInt('floor.emissive'      , 0)
    regSetBool('floor.transparent'  , false)
    regSetInt('floor.thickness'     , 40)

    -- Walls
    regSetBool('walls.unbreakable'  , false)
    regSetString('walls.material'   , "masonry")
    regSetInt('walls.color.r'       , 200)
    regSetInt('walls.color.g'       , 200)
    regSetInt('walls.color.b'       , 200)
    regSetInt('walls.color.a'       , 255)
    regSetString('walls.texture'    , "none")
    regSetInt('walls.textureOpacity', 100)
    regSetInt('walls.metallic'      , 0)
    regSetInt('walls.roughness'     , 0)
    regSetInt('walls.emissive'      , 0)
    regSetBool('walls.transparent'  , false)
    regSetInt('walls.thickness'     , 40)
    regSetInt('walls.height'        , 40)
    regSetInt('walls.count'         , 1)
    regSetInt('walls.proba'         , 50)

    -- Ceiling
    regSetBool('ceiling.unbreakable'  , false)
    regSetString('ceiling.material'   , "masonry")
    regSetInt('ceiling.color.r'       , 55)
    regSetInt('ceiling.color.g'       , 55)
    regSetInt('ceiling.color.b'       , 55)
    regSetInt('ceiling.color.a'       , 255)
    regSetString('ceiling.texture'    , "none")
    regSetInt('ceiling.textureOpacity', 100)
    regSetInt('ceiling.metallic'      , 0)
    regSetInt('ceiling.roughness'     , 0)
    regSetInt('ceiling.emissive'      , 0)
    regSetBool('ceiling.transparent'  , false)
    regSetInt('ceiling.thickness'     , 4)

end

function getMajorVersion(versionString)
    versionString = versionString or "v0"
    local dotIndex = string.find(versionString, '.', 1, true) or #versionString
    return string.sub(versionString, 2, dotIndex)
end

function checkRegInitialized()
    local savedVersion = regGetString('verison')
    local currentVersion = "v1.0.1"
    -- Only reset mod if major version changed
    if getMajorVersion(savedVersion) ~= getMajorVersion(currentVersion) then
        modReset()
    end
    modReset()
    regSetString('verison', currentVersion)
end

function regGetFloat(path)
    local p = 'savegame.mod.' .. path
    return GetFloat(p)
end
function regSetFloat(path, value)
    local p = 'savegame.mod.' .. path
    SetFloat(p, value)
end

function regGetInt(path)
    local p = 'savegame.mod.' .. path
    return GetInt(p)
end
function regSetInt(path, value)
    local p = 'savegame.mod.' .. path
    SetInt(p, value)
end

function regGetBool(path)
    local p = 'savegame.mod.' .. path
    return GetBool(p)
end
function regSetBool(path, value)
    local p = 'savegame.mod.' .. path
    SetBool(p, value)
end

function regGetString(path)
    local p = 'savegame.mod.' .. path
    return GetString(p)
end
function regSetString(path, value)
    local p = 'savegame.mod.' .. path
    SetString(p, value)
end

