Package org.bukkit.configuration.file

Examples of org.bukkit.configuration.file.YamlConfiguration


            logoutdirty = false;
      }
    }
   
    public static void loadGroups() {
        YamlConfiguration groups = loadYamlFile("groups.yml");
        if(groups == null) {
            MultiInv.log.info("No groups.yml found. Creating example file...");
            groups = new YamlConfiguration();
           
            ArrayList<String> exampleGroup = new ArrayList<String>();
            exampleGroup.add("world");
            exampleGroup.add("world_nether");
            exampleGroup.add("world_the_end");
            groups.set("exampleGroup", exampleGroup);
            saveYamlFile(groups, "groups.yml");
        }
        parseGroups(groups);
       
    }
View Full Code Here


   
    public static YamlConfiguration loadYamlFile(String file) {
        File dataFolder = Bukkit.getServer().getPluginManager().getPlugin(DefaultVals.pluginName).getDataFolder();
        File yamlFile = new File(dataFolder, file);
       
        YamlConfiguration config = null;
        if(yamlFile.exists()) {
            try {
                config = new YamlConfiguration();
                config.load(yamlFile);
            } catch(Exception e) {
                e.printStackTrace();
            }
        }
        return config;
View Full Code Here

        File worldsFolder = new File(dataFolder, "UUIDGroups");
        playername = player.getName();
        uuid = player.getUniqueId().toString();
        file = new File(worldsFolder, group + File.separator + uuid + ".yml");
        enderfile = new File(worldsFolder, group + File.separator + uuid + ".ec.yml");
        playerFile = new YamlConfiguration();
        enderchestFile = new YamlConfiguration();
        load();
    }
View Full Code Here

        File worldsFolder = new File(dataFolder, "UUIDGroups");
        playername = player.getName();
        uuid = player.getUniqueId().toString();
        file = new File(worldsFolder, group + File.separator + uuid + ".yml");
        enderfile = new File(worldsFolder, group + File.separator + uuid + ".ec.yml");
        playerFile = new YamlConfiguration();
        enderchestFile = new YamlConfiguration();
        load();
    }
View Full Code Here

        File worldsFolder = new File(dataFolder, "UUIDGroups");
        playername = player.getName();
        uuid = player.getUniqueId().toString();
        file = new File(worldsFolder, group + File.separator + uuid + ".yml");
        enderfile = new File(worldsFolder, group + File.separator + uuid + ".ec.yml");
        playerFile = new YamlConfiguration();
        enderchestFile = new YamlConfiguration();
        if(convert) {
            File oldWorldsFolder = new File(dataFolder, "Groups");
            File file1 = new File(oldWorldsFolder, group + File.separator + uuid + ".yml");
            File enderfile1 = new File(oldWorldsFolder, group + File.separator + uuid + ".ec.yml");
            if(file1.exists()) {
View Full Code Here

            // If we are using mySQL let's assume we are getting this loaded from the mySQL connector...
            // So we shouldn't have to do anything. :D (There should be no other way this is called anyways.)
        } else {
            file = new File(dataFolder.getAbsolutePath() + File.separator + "books" + File.separator + "book_" + hashcode + ".yml");
            if(file.exists()) {
                ybookfile = new YamlConfiguration();
                load();
            } else {
                save();
            }
        }
View Full Code Here

                    // It should all be exactly the same.
                }
            } else {
                file = new File(dataFolder.getAbsolutePath() + File.separator + "books" + File.separator + "book_" + hashcode + ".yml");
                if(file.exists()) {
                    ybookfile = new YamlConfiguration();
                    load();
                } else {
                    save();
                }
            }
View Full Code Here

                    // It should all be exactly the same.
                }
            } else {
                file = new File(dataFolder.getAbsolutePath() + File.separator + "books" + File.separator + "book_" + hashcode + ".yml");
                if(file.exists()) {
                    ybookfile = new YamlConfiguration();
                    load();
                } else {
                    save();
                }
            }
View Full Code Here

    }
   
    public MIBook(File bookfile) {
        file = bookfile;
        if(bookfile.exists()) {
            ybookfile = new YamlConfiguration();
            load();
        }
        String allpages = title + ";author;" + author;
        for(int i = 0; i < pages.length; i++) {
            allpages = allpages + ";newpage;" + pages[i];
View Full Code Here

            // Find and load configuration file for the player's enderchest
            File dataFolder = Bukkit.getServer().getPluginManager().getPlugin("MultiInv").getDataFolder();
            File worldsFolder = new File(dataFolder, "UUIDGroups");
            File file = new File(worldsFolder, group + File.separator + player.getUniqueId().toString() + ".ec.yml");
            String playername = player.getName();
            YamlConfiguration playerFile = new YamlConfiguration();
            if(file.exists()) {
                try {
                    playerFile.load(file);
                } catch(Exception e) {
                    e.printStackTrace();
                    return;
                }
            }
            String inventoryString = new MIEnderchestInventory(inventory).toString();
            playerFile.set(inventoryName, inventoryString);
            String folder = file.getParentFile().getName();
            MultiInv.log.debug("Saving " + playername + "'s " + inventoryName + " Enderchest inventory to " + folder);
            try {
                playerFile.save(file);
            } catch(IOException e) {
                e.printStackTrace();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.bukkit.configuration.file.YamlConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.