Skip to content

Commit

Permalink
Fix wrong import settings being guessed sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
tryashtar committed Oct 13, 2022
1 parent c7dd791 commit 4ad9993
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NbtStudio/NbtObjects/NbtFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static IFailable<NbtFile> TryCreate(string path)
() => TryCreateFromNbt(path, NbtCompression.AutoDetect, big_endian: false), // bedrock files
() => TryCreateFromNbt(path, NbtCompression.AutoDetect, big_endian: false, bedrock_header: true) // bedrock level.dat files
};
return TryVariousMethods(methods, x => LooksSuspicious(x.RootTag));
return TryVariousMethods(methods, x => (x.RootTag is NbtContainerTag c && c.Count == 0) || LooksSuspicious(x.RootTag));
}

public static IFailable<NbtFile> TryVariousMethods(IEnumerable<Func<IFailable<NbtFile>>> methods, Predicate<NbtFile> suspicious)
Expand Down

0 comments on commit 4ad9993

Please sign in to comment.