Closed olee closed 9 years ago
If that's not the way... How else should I do it.
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);
}
https://github.com/AbrarSyed/SecretRoomsMod-forge/commit/972db6a7c48574574282d1bd8ced2887a4eb82cd
your idea wont work with MCPC. and why the system for FE work like vanilla?
what do you mean - it does not work with MCPC ?
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.
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.
unable to find the method you were talking about. + the current system works fine...
: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();
// ......
}
Except there is no such method in world... I would have used it if I could find it...
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.
You just closed it, because you didn't find the method, but you still did not fix it now, did you?
http://pastebin.com/hxzydJET There should be another way of retrieving the dimension-dir than the one used to get the correct location.