Package com.sk89q.util.yaml

Examples of com.sk89q.util.yaml.YAMLProcessor


                file.createNewFile();
            } catch (IOException e) {
                logger.log(Level.WARNING, "Failed to create new configuration file", e);
            }
        }
        config = new YAMLProcessor(file, false, YAMLFormat.EXTENDED);
        try {
            config.load();
        } catch (IOException e) {
            logger.log(Level.WARNING, "Error loading WEPIF configuration", e);
        }
View Full Code Here


    }

    private void loadConfig() {
        createDefaultConfiguration("config.yml"); // Create the default configuration file

        config = new BukkitConfiguration(new YAMLProcessor(new File(getDataFolder(), "config.yml"), true), this);
        config.load();
    }
View Full Code Here

        // Need to create the plugins/CraftBook folder
        getDataFolder().mkdirs();

        // Setup Config and the Commands Manager
        createDefaultConfiguration(new File(getDataFolder(), "config.yml"), "config.yml");
        config = new BukkitConfiguration(new YAMLProcessor(new File(getDataFolder(), "config.yml"), true, YAMLFormat.EXTENDED), logger());
        // Load the configuration
        try {
            config.load();
        } catch (Throwable e) {
            getLogger().severe("Failed to load CraftBook Configuration File! Is it corrupt?");
View Full Code Here

        mechanics = new ArrayList<CraftBookMechanic>();

        logDebugMessage("Initializing Mechanisms!", "startup");

        createDefaultConfiguration(new File(getDataFolder(), "mechanisms.yml"), "mechanisms.yml");
        mechanismsConfig = new YAMLProcessor(new File(getDataFolder(), "mechanisms.yml"), true, YAMLFormat.EXTENDED);

        try {
            mechanismsConfig.load();
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

            if(!file.exists())
                file.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
        processor = new YAMLProcessor(file, true, YAMLFormat.COMPACT);

        try {
            processor.load();
        } catch (Throwable e) {
            BukkitUtil.printStacktrace(e);
View Full Code Here

        try {
            File varFile = new File(CraftBookPlugin.inst().getDataFolder(), "variables.yml");
            if(!varFile.exists())
                varFile.createNewFile();
            variableConfiguration = new VariableConfiguration(new YAMLProcessor(varFile, true, YAMLFormat.EXTENDED), CraftBookPlugin.logger());
            variableConfiguration.load();
        } catch(Exception ignored){
            BukkitUtil.printStacktrace(ignored);
            return false;
        }
View Full Code Here

    @Override
    public boolean enable() {

        INSTANCE = this;
        CraftBookPlugin.inst().createDefaultConfiguration(new File(CraftBookPlugin.inst().getDataFolder(), "crafting-recipes.yml"), "crafting-recipes.yml");
        new RecipeManager(new YAMLProcessor(new File(CraftBookPlugin.inst().getDataFolder(), "crafting-recipes.yml"), true, YAMLFormat.EXTENDED));
        Collection<RecipeManager.Recipe> recipeCollection = RecipeManager.INSTANCE.getRecipes();
        int recipes = 0;
        for (RecipeManager.Recipe r : recipeCollection)
            if(addRecipe(r))
                recipes++;
View Full Code Here

        definitions = new HashSet<CommandItemDefinition>();
        cooldownPeriods = new HashMap<Tuple2<String, String>, Integer>();

        CraftBookPlugin.inst().createDefaultConfiguration(new File(CraftBookPlugin.inst().getDataFolder(), "command-items.yml"), "command-items.yml");
        config = new YAMLProcessor(new File(CraftBookPlugin.inst().getDataFolder(), "command-items.yml"), false, YAMLFormat.EXTENDED);

        try {
            config.load();
        } catch (IOException e) {
            CraftBookPlugin.logger().severe("Corrupt CommandItems command-items.yml File! Make sure that the correct syntax has been used, and that there are no tabs!");
View Full Code Here

    @Override
    public boolean enable() {

        instance = this;
        CraftBookPlugin.inst().createDefaultConfiguration(new File(CraftBookPlugin.inst().getDataFolder(), "cauldron-recipes.yml"), "cauldron-recipes.yml");
        recipes = new ImprovedCauldronCookbook(new YAMLProcessor(new File(CraftBookPlugin.inst().getDataFolder(), "cauldron-recipes.yml"), true, YAMLFormat.EXTENDED), CraftBookPlugin.logger());

        return recipes.hasRecipes();
    }
View Full Code Here

    @CommandPermissions("craftbook.mech.cauldron.reload")
    public void reload(CommandContext context, CommandSender sender) {

        if(ImprovedCauldron.instance == null) return;
        CraftBookPlugin.inst().createDefaultConfiguration(new File(CraftBookPlugin.inst().getDataFolder(), "cauldron-recipes.yml"), "cauldron-recipes.yml");
        ImprovedCauldron.instance.recipes = new ImprovedCauldronCookbook(new YAMLProcessor(new File(CraftBookPlugin.inst().getDataFolder(), "cauldron-recipes.yml"), true, YAMLFormat.EXTENDED), CraftBookPlugin.inst().getLogger());
        sender.sendMessage(ChatColor.YELLOW + "Reloaded Cauldron Recipes...");
    }
View Full Code Here

TOP

Related Classes of com.sk89q.util.yaml.YAMLProcessor

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.