Search in sources :

Example 6 with MageData

use of com.elmakers.mine.bukkit.api.data.MageData in project MagicPlugin by elBukkit.

the class YamlMageDataStore method load.

@Override
public void load(String id, MageDataCallback callback) {
    final File playerFile = new File(playerDataFolder, id + ".dat");
    if (!playerFile.exists()) {
        callback.run(null);
        return;
    }
    YamlConfiguration saveFile = YamlConfiguration.loadConfiguration(playerFile);
    MageData data = load(id, saveFile);
    if (callback != null) {
        callback.run(data);
    }
}
Also used : MageData(com.elmakers.mine.bukkit.api.data.MageData) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) File(java.io.File)

Aggregations

MageData (com.elmakers.mine.bukkit.api.data.MageData)6 MageDataCallback (com.elmakers.mine.bukkit.api.data.MageDataCallback)2 Mage (com.elmakers.mine.bukkit.api.magic.Mage)2 ArrayList (java.util.ArrayList)2 UndoList (com.elmakers.mine.bukkit.api.block.UndoList)1 BrushData (com.elmakers.mine.bukkit.api.data.BrushData)1 SpellData (com.elmakers.mine.bukkit.api.data.SpellData)1 UndoData (com.elmakers.mine.bukkit.api.data.UndoData)1 SaveEvent (com.elmakers.mine.bukkit.api.event.SaveEvent)1 YamlDataFile (com.elmakers.mine.bukkit.data.YamlDataFile)1 MagicController (com.elmakers.mine.bukkit.magic.MagicController)1 File (java.io.File)1 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 HashMap (java.util.HashMap)1 List (java.util.List)1 ConfigurationSection (org.bukkit.configuration.ConfigurationSection)1 InvalidConfigurationException (org.bukkit.configuration.InvalidConfigurationException)1 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)1 Player (org.bukkit.entity.Player)1