Last active
August 29, 2015 14:04
-
-
Save 0xilly/bceff9ec71c05ea7a410 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String getJsonFilePath(World world) { | |
String levelName = world.getWorldInfo().getWorldName(); | |
String directory = ""; | |
try { | |
String subDirectory = ( MinecraftServer.getServer() instanceof DedicatedServer )? "" : "saves/"; | |
directory = subDirectory + levelName + "/stored_runes/"; | |
} catch (Exception e) { | |
LogHelper.info("Server not found"); | |
directory = "saves/" + levelName + "/stored_runes/"; | |
} | |
new File(directory).mkdirs();//ensure the folder exists | |
String fileName = directory + shortClassName() + ".json"; | |
return fileName; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment