Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File location = new File(MageSpells.getInstance().getDataFolder() + "/Spells/");
- if (location.exists()) {
- MageSpells.getInstance().logger.info("Loading Spells...");
- for (File fileData : location.listFiles()) {
- try {
- if(!fileData.isHidden()) {
- YamlConfiguration config = YamlConfiguration.loadConfiguration(fileData);
- String spellName = FilenameUtils.getBaseName(fileData.getName());
- SpellObject spellData = deformatData(spellName, config, fileData);
- if(spellData!= null) {
- MageSpells.getMageSpellsManager().getSpellManager().addSpellObject(spellData);
- // main.logger.info(spellData.getName() + " loaded.");
- }else{
- MageSpells.getInstance().logger.info("Error loading " + spellName);
- }
- }
- } catch (Exception e) {
- System.out.println("Error with file " + fileData.getName());
- e.printStackTrace();
- }
- }
- //deformats, saves to pregamedata
- }
- public SpellObject deformatData(String spellName, YamlConfiguration config, File file) {
- try {
- String displayname = Utils.colorize(config.getString("DisplayName"));
- String lore = Utils.colorize(config.getString("Lore"));
- if(!config.contains("Visible")){
- config.createSection("Visible");
- config.set("Visible", true);
- }
- boolean visible = config.getBoolean("Visible");
- String spellnode = config.getString("SpellNode");
- boolean boltenabled = config.getBoolean("Bolt.Enabled");
- int boltradius = config.getInt("Bolt.DamageRadius");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement