Exemplo n.º 1
0
  @EventHandler
  public void onEntityDamage(EntityDamageEvent event) {
    trampoline.onEntityDamage(event);
    launchPad.onPlayerDamage(event);
    //		worldBlocks.onPlayerTakeDamage(event);

    if (fairGod != null) fairGod.onEntityDamage(event);
    if (fly != null) fly.onDamage(event);
    hubPortals.onPlayerFallEvent(event);
  }
Exemplo n.º 2
0
  /*
  Double Jumping code:

  public ArrayList<Player> doubleJumping = new ArrayList<Player>();
  */
  @EventHandler
  public void onPlayerMove(PlayerMoveEvent event) {
    /*
    Double Jumping code:

    if (!player.getAllowFlight() && ((player.hasPermission("customplugin.doublejump") || Board.getFactionAt(loc).isSafeZone())) && (player.getWorld().getName().equals("Survival") || player.getWorld().getName().equals("GriefFree"))) {
    	if (event.getPlayer().getLocation().getBlock().getRelative(BlockFace.DOWN).getType() != Material.AIR && player.getLocation().getY() - player.getLocation().getBlockY() < .1) {
    		event.getPlayer().setAllowFlight(true);
    		doubleJumping.add(event.getPlayer());
    	}
    }
    */
    beastSprint.onPlayerMoveEvent(event);
    hubPortals.onPlayerMoveEvent(event);
    //		worldBlocks.onPlayerMove(event);

    if (ewBlockFenceWalk != null) ewBlockFenceWalk.onPlayerMove(event);
    //		if (legitWarzone != null)
    //			legitWarzone.onPlayerMoves(event);
    if (donorShop != null) donorShop.onPlayerMoveEvent(event);
  }
Exemplo n.º 3
0
 @EventHandler
 public void onPlayerJoin(PlayerJoinEvent event) {
   //		ipRecorder.onPlayerJoinEvent(event);
   //		forumActivation.onPlayerJoinEvent(event);
   respectedAutoPromote.onPlayerJoinEvent(event);
   homes.onJoinEvent(event);
   hubPortals.onJoinEvent(event);
   /*
   This allowed the owner when joining the game to get full epic armor
   */
   if (event.getPlayer().getName().equals("Esaych")) {
     PlayerInventory inv = event.getPlayer().getInventory();
     colorize(inv.getHelmet(), 47, 0, 111);
     colorize(inv.getChestplate(), 47, 0, 111);
     colorize(inv.getLeggings(), 47, 0, 111);
     colorize(inv.getBoots(), 47, 0, 111);
   }
   if (staffVotes != null) {
     staffVotes.onPlayerJoinEvent(event);
   }
 }
Exemplo n.º 4
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!");
  }