1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Fixed missing chunks file

This commit is contained in:
TheBusyBiscuit 2017-03-19 20:20:25 +01:00
parent abc808b95b
commit 3ca993175e

View File

@ -495,18 +495,20 @@ public class SlimefunStartup extends JavaPlugin {
output.closeEntry(); output.closeEntry();
} }
ZipEntry entry = new ZipEntry("stored-chunks/chunks.sfc"); if (new File("data-storage/Slimefun/stored-chunks/chunks.sfc").exists()) {
output.putNextEntry(entry); ZipEntry entry = new ZipEntry("stored-chunks/chunks.sfc");
FileInputStream input = new FileInputStream(new File("data-storage/Slimefun/stored-chunks/chunks.sfc")); output.putNextEntry(entry);
FileInputStream input = new FileInputStream(new File("data-storage/Slimefun/stored-chunks/chunks.sfc"));
int length; int length;
while ((length = input.read(buffer)) > 0) { while ((length = input.read(buffer)) > 0) {
output.write(buffer, 0, length); output.write(buffer, 0, length);
}
input.close();
output.closeEntry();
} }
input.close();
output.closeEntry();
output.close(); output.close();
System.out.println("[Slimfun] Backed up Blocks to " + file.getName()); System.out.println("[Slimfun] Backed up Blocks to " + file.getName());
} catch(IOException e) { } catch(IOException e) {