Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.projectinferno.games;
- import java.util.logging.Logger;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.RegisteredServiceProvider;
- import org.bukkit.plugin.java.JavaPlugin;
- import net.milkbowl.vault.permission.Permission;
- import net.projectinferno.games.api.TeamAPI;
- import net.projectinferno.games.commands.BanCommand;
- import net.projectinferno.games.commands.CreateCommand;
- import net.projectinferno.games.commands.JoinCommand;
- import net.projectinferno.games.commands.KickCommand;
- import net.projectinferno.games.commands.ResetStatsCommand;
- import net.projectinferno.games.commands.SaveCommand;
- import net.projectinferno.games.commands.SpawnCommand;
- import net.projectinferno.games.commands.StatsCommand;
- import net.projectinferno.games.events.DeathEvents;
- import net.projectinferno.games.events.PlayerEvents;
- import net.projectinferno.games.events.SpawnEvents;
- public class Main extends JavaPlugin {
- public final Logger log = Logger.getLogger("Minecraft");
- public static Permission perms = null;
- TeamAPI tAPI = new TeamAPI(this);
- @Override
- public void onEnable() {
- PluginDescriptionFile plug = this.getDescription();
- log.info(plug.getFullName() + " has been Enabled!");
- tAPI.reloadTeams();
- this.plugin();
- this.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- new PlayerEvents(Main.this);
- new SpawnEvents(Main.this);
- new DeathEvents(Main.this);
- Main.this.getCommand("join").setExecutor(new JoinCommand(Main.this));
- Main.this.getCommand("join").setExecutor(new JoinCommand(Main.this));
- Main.this.getCommand("create").setExecutor(new CreateCommand(Main.this));
- Main.this.getCommand("setspawn").setExecutor(new SpawnCommand(Main.this));
- Main.this.getCommand("stats").setExecutor(new StatsCommand(Main.this));
- Main.this.getCommand("resetstats").setExecutor(new ResetStatsCommand(Main.this));
- Main.this.getCommand("kick").setExecutor(new KickCommand(Main.this));
- Main.this.getCommand("ban").setExecutor(new BanCommand(Main.this));
- Main.this.getCommand("save").setExecutor(new SaveCommand(Main.this));
- }
- }, 20);
- }
- @Override
- public void onDisable() {
- PluginDescriptionFile plug = this.getDescription();
- log.info(plug.getFullName() + " has been Disabled!");
- this.plugin();
- getServer().getScheduler().cancelAllTasks();
- saveConfig();
- }
- private boolean setupPermissions() {
- RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
- perms = rsp.getProvider();
- return perms != null;
- }
- private boolean plugin() {
- setupPermissions();
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement