Advertisement
Guest User

Main

a guest
Dec 4th, 2012
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.73 KB | None | 0 0
  1. package net.projectinferno.games;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.plugin.PluginDescriptionFile;
  6. import org.bukkit.plugin.RegisteredServiceProvider;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. import net.milkbowl.vault.permission.Permission;
  10. import net.projectinferno.games.api.TeamAPI;
  11. import net.projectinferno.games.commands.BanCommand;
  12. import net.projectinferno.games.commands.CreateCommand;
  13. import net.projectinferno.games.commands.JoinCommand;
  14. import net.projectinferno.games.commands.KickCommand;
  15. import net.projectinferno.games.commands.ResetStatsCommand;
  16. import net.projectinferno.games.commands.SaveCommand;
  17. import net.projectinferno.games.commands.SpawnCommand;
  18. import net.projectinferno.games.commands.StatsCommand;
  19. import net.projectinferno.games.events.DeathEvents;
  20. import net.projectinferno.games.events.PlayerEvents;
  21. import net.projectinferno.games.events.SpawnEvents;
  22.  
  23. public class Main extends JavaPlugin {
  24.  
  25.     public final Logger log = Logger.getLogger("Minecraft");
  26.     public static Permission perms = null;
  27.     TeamAPI tAPI = new TeamAPI(this);
  28.  
  29.     @Override
  30.     public void onEnable() {
  31.         PluginDescriptionFile plug = this.getDescription();
  32.         log.info(plug.getFullName() + " has been Enabled!");
  33.         tAPI.reloadTeams();
  34.         this.plugin();
  35.  
  36.         this.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
  37.            
  38.                     public void run() {
  39.                         new PlayerEvents(Main.this);
  40.                         new SpawnEvents(Main.this);
  41.                         new DeathEvents(Main.this);
  42.                         Main.this.getCommand("join").setExecutor(new JoinCommand(Main.this));
  43.                         Main.this.getCommand("join").setExecutor(new JoinCommand(Main.this));
  44.                         Main.this.getCommand("create").setExecutor(new CreateCommand(Main.this));
  45.                         Main.this.getCommand("setspawn").setExecutor(new SpawnCommand(Main.this));
  46.                         Main.this.getCommand("stats").setExecutor(new StatsCommand(Main.this));
  47.                         Main.this.getCommand("resetstats").setExecutor(new ResetStatsCommand(Main.this));
  48.                         Main.this.getCommand("kick").setExecutor(new KickCommand(Main.this));
  49.                         Main.this.getCommand("ban").setExecutor(new BanCommand(Main.this));
  50.                         Main.this.getCommand("save").setExecutor(new SaveCommand(Main.this));
  51.                     }
  52.  
  53.                 }, 20);
  54.     }
  55.  
  56.     @Override
  57.     public void onDisable() {
  58.         PluginDescriptionFile plug = this.getDescription();
  59.         log.info(plug.getFullName() + " has been Disabled!");
  60.         this.plugin();
  61.  
  62.         getServer().getScheduler().cancelAllTasks();
  63.         saveConfig();
  64.     }
  65.  
  66.     private boolean setupPermissions() {
  67.         RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
  68.         perms = rsp.getProvider();
  69.         return perms != null;
  70.     }
  71.  
  72.     private boolean plugin() {
  73.         setupPermissions();
  74.  
  75.         return false;
  76.     }
  77.  
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement