@Override
    public void onEnable() {
        
        //Save default configuration files
       new File("plugins/MineCaster").mkdir();
       File config = new File("plugins/MineCaster/config.xml");
        if(!config.exists()) {
            InputStream is = getResource("config.xml");
            try {
                OutputStream os = new FileOutputStream(config);

                int read = 0;
                byte[] bytes = new byte[1024];
                try {
                    while ((read = is.read(bytes)) != -1) {
                        try {
                            os.write(bytes, 0, read);
                        } catch (IOException ex) {
                            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                } catch (IOException ex) {
                    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                }  
            } catch (FileNotFoundException ex) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
           
        //Initialize and load XMl-CONFIGURATION-HANDLER
        xml = new xmlConfigurationManager();
        try {
            xml.loadConfiguration("plugins/MineCaster/config.xml");
        } catch (XMLStreamException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    
        //Activate Timer
        scheduleMessageTimer();
        
        //Initialize GUI
        if(!GraphicsEnvironment.isHeadless()) {
            gui = new GUI();
        }

        /*
         * Initialize Graphs
         */
        //PlayerCount Graph
        playerCountGraph = new Graph("Number of " + ChatColor.DARK_RED + "players " + ChatColor.WHITE + "in the last " + ChatColor.GOLD + "24h");
        playerCountGraph.getPlayerCountDataCollector();
        
        //Activate MC.Statistics
        StatisticEngine engine = new StatisticEngine(this);   
    }