예제 #1
0
  /** Plugin onDisable() event, disables all plugins that needs disabling, and cancels all tasks */
  public void onDisable() {
    heartBeat.disable();
    //		worldBlocks.disable();

    if (donorShop != null) donorShop.disable();
    if (demiGod != null) demiGod.disable();

    for (BukkitTask task : Bukkit.getScheduler().getPendingTasks()) {
      if (task.getOwner() == this) {
        task.cancel();
      }
    }
    DataManager dm = new DataManager();
    dm.cpsavedata();
    getLogger().info("Diamond Dominion Custom Plugin disabled");
  }
예제 #2
0
  /** Plugin onEnable() event, enables all custom plugins that are on the current server */
  public void onEnable() {
    log("Diamond Dominion Custom Plugin ENABLING!");
    Bukkit.getServer().getPluginManager().registerEvents(this, this);

    this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);

    String server = detectedServer();
    log("Detected Server: " + server);

    DataManager dm = new DataManager();
    dm.reloaddata();
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "pex set default group Player");
    log("Loading Custom Items:");
    /*
     * Start Loading all Custom Plugin Classes
     */
    if (shouldEnable("EndDragonRespawn")) {
      log(" - EndDragonRespawn:");
      try {
        endDragonRespawn = new EndDragonRespawn(this);
        endDragonRespawn.enable();
      } catch (Exception e) {
        pluginFailed();
      }
    }

    if (shouldEnable("HeartBeat"))
      try {
        heartBeat = new HeartBeat(this);
        heartBeat.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("FairGod"))
      try {
        fairGod = new FairGod(this);
        fairGod.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    //		if (shouldEnable("LegitWarzone"))
    //			try {
    //				legitWarzone = new LegitWarzone(this);
    //				legitWarzone.enable();
    //			} catch (Exception e) {
    //				pluginFailed();
    //			}

    if (shouldEnable("TopPvPers"))
      try {
        topPvPers = new TopPvPers(this);
        topPvPers.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("VoteRewards"))
      try {
        voteRewards = new VoteRewards(this);
        voteRewards.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("VoteReceiver"))
      try {
        voteReceiver = new VoteReceiver(this);
        voteReceiver.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("DemiGodPackage"))
      try {
        demiGod = new DemiGodPackage(this);
        demiGod.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    //		if (shouldEnable("DirectionBook"))
    //			try {
    //				directionBook = new DirectionBook(this);
    //				directionBook.enable();
    //			} catch (Exception e) {
    //				pluginFailed();
    //			}

    //		if (shouldEnable("GameTime"))
    //			try {
    //				gameTime = new GameTime(this);
    //				gameTime.enable();
    //			} catch (Exception e) {
    //				pluginFailed();
    //			}

    if (shouldEnable("CustomRecipies"))
      try {
        customRecipies = new CustomRecipies(this);
        customRecipies.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("SpawnerSwitch"))
      try {
        spawnerSwitch = new SpawnerSwitch(this);
        spawnerSwitch.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    //		if (shouldEnable("JailSigns"))
    //		jailSigns.enable();

    //		if (shouldEnable("AutoConfiscate"))
    //		autoConfiscate.enable();

    if (shouldEnable("ModAppWall"))
      try {
        modAppWall = new ModAppWall(this);
        modAppWall.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("ModListWall"))
      try {
        modListWall = new ModListWall(this);
        modListWall.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    //		if (shouldEnable("WebRanks"))
    //			try {
    //				webRanks = new WebRanks(this);
    //				webRanks.enable();
    //			} catch (Exception e) {
    //				pluginFailed();
    //			}

    if (shouldEnable("Trampoline"))
      try {
        trampoline = new Trampoline(this);
        trampoline.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("PlotMeOverride"))
      try {
        plotMeOverride = new PlotMeOverride(this);
        plotMeOverride.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("Chat"))
      try {
        chat = new Chat(this);
        chat.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("ChatPrefix"))
      try {
        chatPrefix = new ChatPrefix(this);
        chatPrefix.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("FullMute"))
      try {
        fullMute = new FullMute(this);
        fullMute.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("LaunchPad"))
      try {
        launchPad = new LaunchPad(this);
        launchPad.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("ColorArmor"))
      try {
        colorArmor = new ColorArmor(this);
        colorArmor.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    //		if (shouldEnable("DrunkenWizard"))
    //		drunkenWizard.enable();

    if (shouldEnable("CreativeEntityRemover"))
      try {
        creativeEntityRemover = new CreativeEntityRemover(this);
        creativeEntityRemover.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("WelcomeBook"))
      try {
        welcomeBook = new WelcomeBook(this);
        welcomeBook.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("IpRecorder"))
      try {
        ipRecorder = new IpRecorder(this);
        ipRecorder.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("WelcomeSign"))
      try {
        welcomeSign = new WelcomeSign(this);
        welcomeSign.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    //		if (shouldEnable("PeacefulGriefFree"))
    //		peacefulGriefFree.enable();

    //		if (shouldEnable("ForumActivation"))
    //			try {
    //				forumActivation = new ForumActivation(this);
    //				forumActivation.enable();
    //			} catch (Exception e) {
    //				pluginFailed();
    //			}

    if (shouldEnable("VirtualChest"))
      try {
        virtualChest = new VirtualChest(this);
        virtualChest.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    //		if (shouldEnable("WorldBlocks"))
    //			try {
    //				worldBlocks = new WorldBlocks(this);
    //				worldBlocks.enable();
    //			} catch (Exception e) {
    //				pluginFailed();
    //			}

    if (shouldEnable("DonorShop"))
      try {
        donorShop = new DonorShop(this);
        donorShop.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("SpawnMusic"))
      try {
        spawnMusic = new SpawnMusic(this);
        spawnMusic.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("CrashPlayer"))
      try {
        crashPlayer = new CrashPlayer(this);
        crashPlayer.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("BeastSprint"))
      try {
        beastSprint = new BeastSprint(this);
        beastSprint.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("Nameless"))
      try {
        nameless = new Nameless(this);
        nameless.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("TnTPunch"))
      try {
        tntpunch = new TnTPunch(this);
        tntpunch.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("RestartWarning"))
      try {
        restartWarning = new RestartWarning(this);
        restartWarning.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("UnderCover"))
      try {
        underCover = new UnderCover(this);
        underCover.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("SignEdit"))
      try {
        signEdit = new SignEdit(this);
        signEdit.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("WarpWild"))
      try {
        warpWild = new WarpWild(this);
        warpWild.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("EWButtons"))
      try {
        ewButtons = new EWButtons(this);
        ewButtons.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("SkyBlockTP"))
      try {
        skyBlockTP = new SkyBlockTP(this);
        skyBlockTP.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("EnderEggCollection"))
      try {
        enderEggCollection = new EnderEggCollection(this);
        enderEggCollection.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("Voodoo"))
      try {
        voodoo = new Voodoo(this);
        voodoo.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("ExtraMiningLoot"))
      try {
        extraMiningLoot = new ExtraMiningLoot(this);
        extraMiningLoot.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("EWBlockFenceWalk"))
      try {
        ewBlockFenceWalk = new EWBlockFenceWalk(this);
        ewBlockFenceWalk.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("CommandModifier"))
      try {
        commandModifier = new CommandModifier(this);
        commandModifier.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("SkyBlockPortalReward"))
      try {
        sbPortalReward = new SkyBlockPortalReward(this);
        sbPortalReward.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("HubPortals"))
      try {
        hubPortals = new HubPortals(this);
        hubPortals.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("BungeeGlobalCommand"))
      try {
        bungeeGBCMD = new BungeeGlobalCommand(this);
        bungeeGBCMD.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("StaffVotes"))
      try {
        staffVotes = new StaffVotes(this);
        staffVotes.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("RespectedAutoPromote"))
      try {
        respectedAutoPromote = new RespectedAutoPromote(this);
        respectedAutoPromote.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("Homes"))
      try {
        homes = new Homes(this);
        homes.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("FairFly"))
      try {
        fly = new FairFly(this);
        fly.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    if (shouldEnable("ServerRestart"))
      try {
        serverRestart = new ServerRestart(this);
        serverRestart.enable();
      } catch (Exception e) {
        pluginFailed();
      }

    /*
     * Complete loading all custom plugin classes
     */
    log("Fully Enabled!");
  }