Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. package br.Joao.AnBans;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5.  
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.configuration.file.YamlConfiguration;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. import br.Joao.AnBans.Comandos.Comando_Ban;
  11. import br.Joao.AnBans.Eventos.Login_Verificar_Ban;
  12.  
  13. public class Main extends JavaPlugin {
  14.  
  15. private static Main instance;
  16.  
  17. public static File configFile = null;
  18. public static YamlConfiguration configBans = null;
  19.  
  20. @Override
  21. public void onEnable() {
  22.  
  23. instance = this;
  24. configFile = new File(getDataFolder(), "Banidos.yml");
  25. if (!configFile.exists()) {
  26. saveResource("Banidos.yml", false);
  27. }
  28. configBans = YamlConfiguration.loadConfiguration(configFile);
  29. try {
  30. configBans.save(configFile);
  31. }
  32. catch (IOException e) {
  33. e.printStackTrace();
  34. }
  35. Bukkit.getServer().getPluginManager().registerEvents(new Login_Verificar_Ban(), this);
  36. Comandos();
  37. }
  38.  
  39. @Override
  40. public void onDisable() {
  41.  
  42.  
  43. instance = this;
  44. }
  45.  
  46. public void Comandos() {
  47. getCommand("ban").setExecutor(new Comando_Ban());
  48. }
  49.  
  50. public static Main getInstance() {
  51. return instance;
  52.  
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement