mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 08:59:01 +00:00
Threaded savefile writes
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.dre.brewery.filedata;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import com.dre.brewery.P;
|
||||
|
||||
public class WriteData implements Runnable {
|
||||
|
||||
private FileConfiguration data;
|
||||
|
||||
public WriteData(FileConfiguration data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
File datafile = new File(P.p.getDataFolder(), "data.yml");
|
||||
|
||||
try {
|
||||
data.save(datafile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
DataSave.lastSave = 1;
|
||||
DataSave.running = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user