Use relative path to main game dir as comparison, fixes #86

This commit is contained in:
Brady 2018-08-23 21:26:28 -05:00
parent 71ce9cd901
commit 830c90dd97
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ public enum WorldProvider implements Helper {
IAnvilChunkLoader loader = (IAnvilChunkLoader) provider.getChunkLoader();
directory = loader.getChunkSaveLocation();
if (!directory.getParentFile().getName().equals("saves")) {
// In the case of any dimension that isn't the overworld, we'll see a number other than 2 (likely 3)
if (directory.toPath().relativize(mc.gameDir.toPath()).getNameCount() != 2) {
// subdirectory of the main save directory for this world
directory = directory.getParentFile();
}