Advertisement
Guest User

Untitled

a guest
Mar 10th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. package fr.smash.reportmain;
  2.  
  3.  
  4. import org.bukkit.Bukkit;
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.plugin.PluginManager;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. import fr.smash.reportSQL.DataBase;
  10. import fr.smash.reportcommandes.ReportCommand;
  11. import fr.smash.reportcommandes.ReportListCommand;
  12. import fr.smash.reportlisteners.ReportListeners;
  13.  
  14. public final class Main extends JavaPlugin {
  15.    
  16.     private PluginManager pm ;
  17.    
  18.     public DataBase db ;
  19.    
  20.     public void onEnable() {
  21.  
  22.         //DataBase
  23.        
  24.         db = new DataBase("jdbc:mysql://", "localhost", "serveur1.8", "root", "") ;
  25.        
  26.         db.connection() ;
  27.        
  28.         //Listeners
  29.        
  30.         pm = Bukkit.getServer().getPluginManager() ;
  31.        
  32.         pm.registerEvents(new ReportListeners(), this) ;
  33.        
  34.         //Enregistrement des commandes
  35.        
  36.             //Commandes report <name>
  37.        
  38.         getCommand("report").setExecutor(new ReportCommand()) ;
  39.        
  40.         getCommand("reportlist").setExecutor(new ReportListCommand()) ;
  41.        
  42.         //Message dans la console lors du start (si bien démarré)
  43.        
  44.         Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "Le plugin " + "ReportCommands" + " a ete demarre correctement ! ") ;
  45.        
  46.     }
  47.    
  48.     public void onDisable() {
  49.        
  50.         //DataBase
  51.  
  52.         db.disconnect() ;
  53.        
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement