mirror of
https://github.com/jaquadro/NBTExplorer.git
synced 2025-01-26 01:06:25 +00:00
Add Linux Minecraft location
This commit is contained in:
parent
15b1b2891f
commit
2140894905
1 changed files with 16 additions and 12 deletions
|
@ -257,19 +257,23 @@ namespace NBTExplorer.Windows
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
string path = Environment.ExpandEnvironmentVariables("%APPDATA%");
|
foreach (string path in new[] {
|
||||||
if (!Directory.Exists(path)) {
|
Environment.ExpandEnvironmentVariables("%APPDATA%"),
|
||||||
path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||||
|
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) } // Tries Linux Minecraft location
|
||||||
|
) {
|
||||||
|
if (!Directory.Exists(path)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
path = Path.Combine(path, ".minecraft", "saves");
|
||||||
|
|
||||||
|
if (!Directory.Exists(path)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
OpenPaths(new string[] { path });
|
||||||
}
|
}
|
||||||
|
|
||||||
path = Path.Combine(path, ".minecraft");
|
|
||||||
path = Path.Combine(path, "saves");
|
|
||||||
|
|
||||||
if (!Directory.Exists(path)) {
|
|
||||||
path = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenPaths(new string[] { path });
|
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
MessageBox.Show("Could not open default Minecraft save directory");
|
MessageBox.Show("Could not open default Minecraft save directory");
|
||||||
|
|
Loading…
Reference in a new issue