Make all the directories! \o/

This commit is contained in:
Ellpeck 2016-06-05 02:31:37 +02:00
parent c5cf9ec90f
commit ee01652574
3 changed files with 3 additions and 2 deletions

View file

@ -78,6 +78,7 @@ public class ExtraClientData{
public static File getTheFile(){
try{
if(!theFile.exists()){
theFile.mkdirs();
theFile.createNewFile();
}
}

View file

@ -135,6 +135,7 @@ public class WorldData{
if(dataFile != null){
if(!dataFile.exists()){
dataFile.mkdirs();
dataFile.createNewFile();
ModUtil.LOGGER.info("Creating new WorldData file for world "+data.dimension+"!");
}
@ -144,8 +145,6 @@ public class WorldData{
FileOutputStream stream = new FileOutputStream(dataFile);
CompressedStreamTools.writeCompressed(compound, stream);
stream.close();
ModUtil.LOGGER.info("Saved WorldData for world "+data.dimension+"!");
}
}
catch(Exception e){

View file

@ -94,6 +94,7 @@ public class ClientProxy implements IProxy{
if(ConfigBoolValues.BOOKLET_TEXT_TO_FILE.isEnabled()){
File file = new File(Minecraft.getMinecraft().mcDataDir, ModUtil.MOD_ID+"booklettext.txt");
try{
file.mkdirs();
file.createNewFile();
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
writer.write(TextFormatting.getTextWithoutFormattingCodes(bookletText));