Skip to content

Instantly share code, notes, and snippets.

@XCompWiz
Created September 22, 2012 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XCompWiz/3766703 to your computer and use it in GitHub Desktop.
Save XCompWiz/3766703 to your computer and use it in GitHub Desktop.
Basic onWorldLoad get world filedir
@ForgeSubscribe
public void worldLoadEvent(Load event) {
getWorldDir(event.world);
}
private File getWorldDir(World world) {
String str = ""; //FIXME: Get base directory (using
str = str + world.getSaveHandler().getSaveDirectoryName();
if (world.provider.getSaveFolder() != null) {
str = str + world.provider.getSaveFolder();
}
File file = new File(str);
return file;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment