mirror of
https://github.com/CarmJos/cn2b2t-project.git
synced 2026-06-04 17:38:49 +08:00
修复数据加载
This commit is contained in:
@@ -271,7 +271,12 @@ public class User {
|
||||
}
|
||||
|
||||
private void loadData() {
|
||||
this.datafile = new File(Main.getInstance().getDataFolder() + "/userdatas/", this.getInkID() + ".yml");
|
||||
File userdatasFolder = new File(Main.getInstance().getDataFolder() + "/userdatas");
|
||||
if (!userdatasFolder.isDirectory() || !userdatasFolder.exists()) {
|
||||
userdatasFolder.mkdir();
|
||||
}
|
||||
|
||||
this.datafile = new File(userdatasFolder, this.getInkID() + ".yml");
|
||||
if (!datafile.exists()) {
|
||||
try {
|
||||
datafile.createNewFile();
|
||||
@@ -279,7 +284,7 @@ public class User {
|
||||
Bukkit.getLogger().info("Could not load file " + "/userdatas/" + "yml" + ex);
|
||||
}
|
||||
}
|
||||
datas = YamlConfiguration.loadConfiguration(datafile);
|
||||
this.datas = YamlConfiguration.loadConfiguration(datafile);
|
||||
}
|
||||
|
||||
public FileConfiguration getDatas() {
|
||||
|
||||
Reference in New Issue
Block a user