Bug with config;//

Discussion in 'Plugin Development' started by dekrosik, Jul 5, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    dekrosik

    Hello i make config class:
    Code:
    package com.gmail.desk1123.storage;
    
    import com.gmail.desk1123.AwesomeDrop;
    import com.gmail.desk1123.handlers.DropManager;
    import org.bukkit.Material;
    import org.bukkit.configuration.file.FileConfiguration;
    
    /**
     *
     * @author dekros987
     */
    public class Configuration {
    
        static FileConfiguration config;
    
        public static boolean toInventory;
        public static String inventoryName;
        public static int saveTime;
        public static boolean saveToFile;
        public static int adminDropPower;
       // public static String blockedMsg;
        public static int TurboDropTime;
        //public static List<Material> blocked_material = new ArrayList<>();
    
        public static void onLoad() {
            config = AwesomeDrop.getInstance().getConfig();
            toInventory = config.getBoolean("Config.toInventory");
            inventoryName = config.getString("Config.InventoryName");
            saveTime = config.getInt("Config.saveTime");
            saveToFile = config.getBoolean("Config.saveToFile");
            adminDropPower = config.getInt("Config.adminDropPower");
            //blocked_material = (List<Material>) config.getList("Config.blockedBlock");
            //blockedMsg = config.getString("Config.blockedBlockMsg");
            TurboDropTime = config.getInt("Config.turboDropTime");
            for (String s : config.getConfigurationSection("Drops").getKeys(false)) {
                DropManager.addDrop(Material.getMaterial(s),
                        config.getString("Drops." + s + ".name"),
                        config.getInt("Drops." + s + ".minY"),
                        config.getInt("Drops." + s + ".maxY"),
                        config.getBoolean("Drops." + s + ".fortune"),
                        config.getDouble("Drops." + s + ".chance"),
                        config.getDouble("Drops." + s + ".vipChance"),
                        config.getString("Drops." + s + ".message"),
                        config.getInt("Drops." + s + ".points"));
            }
    
            AwesomeDrop.getInstance().saveConfig();
        }
    
    }
    
    
    and when i start server i have this error http://pastebin.com/Md3KPXj5
    Awesomedrop 37 line is
    public void onEnable(){
    Configuration.onLoad();//THIS IS 37LINE
    }
    how to repair this?
     
  2. Please post the contents of plugin.yml.
     
Thread Status:
Not open for further replies.

Share This Page