src/AnvilPacker/Level/RegionReader.cs
/// <summary> Parses the region position from the specified path. </summary>
Parses the region position from the specified path.
Parses the region position from the specified path .
public static (int X, int Z) GetFilePos(string path)
        {
            var m = Regex.Match(Path.GetFileName(path), @"^r\.(-?\d+)\.(-?\d+)\.mca$");
            if (!m.Success) {
                throw new FormatException("Region filename must have the form of 'r.0.0.mca'.");
            }
            int x = int.Parse(m.Groups[1].Value) * 32;
            int z = int.Parse(m.Groups[2].Value) * 32;
            return (x, z);
        }
public static ( int X , int Z ) GetFilePos ( string path ) { var m = Regex . Match ( Path . GetFileName ( path ) , @"^r\.(-?\d+)\.(-?\d+)\.mca$" ) ; if ( ! m . Success ) { throw new FormatException ( " " ) ; } int x = int . Parse ( m . Groups [ 1 ] . Value ) * 32 ; int z = int . Parse ( m . Groups [ 2 ] . Value ) * 32 ; return ( x , z ) ; }
Parses the region position from the specified path.
Parses the region position from the specified path .
path
string