AbrarSyed / SecretRoomsMod-forge

The official SecretRoomsMod repo
GNU Lesser General Public License v3.0
39 stars 34 forks source link

SRM chooses wrong location for world-files #155

Closed olee closed 9 years ago

olee commented 9 years ago

http://pastebin.com/hxzydJET There should be another way of retrieving the dimension-dir than the one used to get the correct location.

AbrarSyed commented 9 years ago

https://github.com/AbrarSyed/SecretRoomsMod-forge/blob/master/src/main/java/com/github/abrarsyed/secretroomsmod/common/OwnershipManager.java#L266

If that's not the way... How else should I do it.

olee commented 9 years ago

world.getChunkSaveLocation(); From FE's backup code:

    public Backup(WorldServer world, boolean worldSave)
    {
        isWorld = true;
        this.worldSave = worldSave;
        this.world = world;

        name = world.getWorldInfo().getWorldName() + " DIM " + world.provider.dimensionId;
        source = world.getChunkSaveLocation();
        folder = new File(basefolder, (world.getWorldInfo().getWorldName() + "/DIM " + world.provider.dimensionId).replaceAll(" ", "_"));
        backupName = getFilename() + ".zip";

        thread = new Thread(this, "ForgeEssentials - Backup - " + name);
    }
AbrarSyed commented 9 years ago

https://github.com/AbrarSyed/SecretRoomsMod-forge/commit/972db6a7c48574574282d1bd8ced2887a4eb82cd

your idea wont work with MCPC. and why the system for FE work like vanilla?

olee commented 9 years ago

what do you mean - it does not work with MCPC ?

AbrarSyed commented 9 years ago

MCPC has a different naming scheme for worlds than vanilla does. My current method accounts for that because MCPC returns something different than vanilla/forge. Creating the path your way will be problematic.

olee commented 9 years ago

Are you really sure? The commit you mentioned was totally different from what I showed you: world.getChunkSaveLocation() That one should be totally compatible with MCPC, because it is the one used internally by MC to actually save stuff.

AbrarSyed commented 9 years ago

unable to find the method you were talking about. + the current system works fine...

olee commented 9 years ago

:sweat: That one-line change should fix it. Didn't check it though - I currently have no time for that as you might have heard :disappointed:

    private File getSaveFile(World world)
    {
        //String worldSaveFolder = world.provider.getSaveFolder();
        String worldSaveFolder = world.getChunkSaveLocation();
        // ......
    }
AbrarSyed commented 9 years ago

Except there is no such method in world... I would have used it if I could find it...

olee commented 9 years ago

It's part of WorldServer and not World. You should be able to fix the function-header and the calling code to use WorldServer instead of World, or do a cast in the method.

olee commented 9 years ago

You just closed it, because you didn't find the method, but you still did not fix it now, did you?