mirror of
https://github.com/jaquadro/NBTExplorer.git
synced 2025-01-09 17:36:25 +00:00
Look for Minecraft directory on Linux
This commit is contained in:
parent
2140894905
commit
d5103f6f1a
1 changed files with 5 additions and 4 deletions
|
@ -257,16 +257,17 @@ namespace NBTExplorer.Windows
|
|||
return;
|
||||
|
||||
try {
|
||||
foreach (string path in new[] {
|
||||
foreach (string basepath in new[] {
|
||||
Environment.ExpandEnvironmentVariables("%APPDATA%"),
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) } // Tries Linux Minecraft location
|
||||
System.Environment.GetEnvironmentVariable("HOME") } // Tries Linux Minecraft location
|
||||
) {
|
||||
if (!Directory.Exists(path)) {
|
||||
if (!Directory.Exists(basepath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
path = Path.Combine(path, ".minecraft", "saves");
|
||||
string path = Path.Combine(basepath, ".minecraft");
|
||||
path = Path.Combine(path, "saves");
|
||||
|
||||
if (!Directory.Exists(path)) {
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue