Beispiel #1
0
 @EventHandler
 public void PlayerLeave(PlayerQuitEvent e) {
   playerTab.remove(e.getPlayer().getName());
   playerTabLast.remove(e.getPlayer().getName());
   playerTab47.remove(e.getPlayer().getName());
   playerTabLast47.remove(e.getPlayer().getName());
 }
 @EventHandler(priority = EventPriority.LOWEST)
 public void onPlayerQuit(PlayerQuitEvent e) {
   Managers.log("[Player] Saving details for player " + e.getPlayer().getName());
   Managers.getStatisticManager()
       .saveStatistic(getPlayerDetails(e.getPlayer()), PlayerDetails.class);
   players.remove(e.getPlayer());
 }
Beispiel #3
0
  @EventHandler(priority = EventPriority.HIGHEST)
  public void onPlayerQuit(final PlayerQuitEvent e) {
    Player player = e.getPlayer();
    SCPlayer scPlayer = getSCPlayer(player.getUniqueId());

    e.setQuitMessage(null);

    if (scPlayer.isCombatTagged()) {
      player.setHealth(0);
      scPlayer.removeCombatTag();
      broadcast(
          new FancyMessage(scPlayer.getTag())
              .tooltip(scPlayer.getHoverText())
              .then(" §5has logged off while in combat!"));
    }

    if (rankManager.getRank(player.getUniqueId()).getId() >= Rank.MOD.getId())
      staff(
          new FancyMessage("§9[STAFF] ")
              .then(scPlayer.getTag())
              .tooltip(scPlayer.getHoverText())
              .then(" §edisconnected."));

    removeSCPlayer(player.getUniqueId());
  }
  // <Index = 2>
  @EventHandler
  public void onPlayerQuit(PlayerQuitEvent event) {
    Player p = event.getPlayer();
    final String pName = p.getName();

    event.setQuitMessage(ChatMessages.WHITE + pName + ChatMessages.quitMessage);

    Bukkit.getScheduler()
        .scheduleSyncDelayedTask(
            plugin,
            new Runnable() {
              @Override
              public void run() {
                if (Main.lobbyBoolean == false && Bukkit.getOnlinePlayers().size() < 2) {
                  Main.gameTimer = 5;
                }
              }
            },
            100);
    Bukkit.getScheduler()
        .scheduleSyncDelayedTask(
            Main.getInstance(),
            new Runnable() {
              @Override
              public void run() {
                if (!Bukkit.getOfflinePlayer(pName).isOnline())
                  ScoreboardHandler.removePlayer(pName);
              }
            },
            300L);
  }
 @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
 public void onPlayerQuit(PlayerQuitEvent event) {
   BlockHitManager.clearHistory(event.getPlayer());
   if (Orebfuscator.config.isProximityHiderEnabled()) {
     ProximityHider.clearPlayer(event.getPlayer());
   }
 }
 @EventHandler(ignoreCancelled = true)
 public void onPlayerQuit(PlayerQuitEvent event) {
   if (getSettingsManager().isLogoutTranslationEnabled()) {
     Localisation.sendGlobalMessage("message.logout", event.getPlayer());
     event.setQuitMessage(null);
   }
 }
 @EventHandler(priority = EventPriority.NORMAL)
 public void onPlayerQuit(PlayerQuitEvent event) {
   try {
     if (!economiesLoaded()) {
       return;
     }
     Location l = event.getPlayer().getLocation();
     String name = event.getPlayer().getName();
     if (!hasAccount(name)) {
       addPlayer(name);
     }
     if (hyperPlayers.containsKey(name)) {
       HyperPlayer hp = hyperPlayers.get(name);
       if (hp == null) {
         return;
       }
       hp.setX(l.getX());
       hp.setY(l.getY());
       hp.setZ(l.getZ());
       hp.setWorld(l.getWorld().getName());
     }
   } catch (Exception e) {
     hc.gDB().writeError(e);
   }
 }
  @EventHandler(priority = EventPriority.MONITOR)
  public void quitHandler(PlayerQuitEvent event) {
    // update their spam status
    plugin.spamManager.playerQuit(event.getPlayer());

    // set their persistance
    plugin.ph.setOfflineChannel(
        event.getPlayer().getName(), plugin.channelManager.getPlayerChannel(event.getPlayer()));
    plugin.ph.setOfflineVerbosity(
        event.getPlayer().getName(), plugin.chatManager.getVerbosity(event.getPlayer()));

    // remove them from their channel
    plugin.channelManager.removePlayer(event.getPlayer());
    // and remove them from the VoxelChat list
    plugin.chatManager.disableVoxelChat(event.getPlayer());

    // turn off the global join notification
    event.setQuitMessage("");

    // and do our own custom notification
    Player[] players = plugin.getServer().getOnlinePlayers();
    for (int i = 0; i < players.length; i++) {
      if (plugin.chatManager.getVerbosity(players[i]).compareTo(Verbosity.SHOWSOME) >= 0) {
        // they want these messages! show them!
        // TODO: custom join / leave messages
        ColourHandler.sendMessage(
            players[i],
            plugin.permissions.getUser(event.getPlayer()).getPrefix()
                + event.getPlayer().getName()
                + " &ehas left the game!");
      }
    }
  }
Beispiel #9
0
  @EventHandler
  public void onPlayerQuit(PlayerQuitEvent e) {
    Player p = e.getPlayer();

    if (Config.getConfig().getBoolean("options.set-fly-on-join.fly")) p.setAllowFlight(false);

    if (Config.getConfig().getBoolean("broadcast.player-quit.enabled")) {
      if (Config.getConfig().getBoolean("broadcast.player-quit.hide")) {
        e.setQuitMessage(null);
      } else {
        e.setQuitMessage(
            ChatColor.translateAlternateColorCodes(
                '&',
                Config.getConfig()
                    .getString("broadcast.player-quit.message")
                    .replaceAll("%player%", e.getPlayer().getName())));
      }
    }

    if (pvp.containsKey(p)) {
      if (pvp.get(p).isSync()) pvp.get(p).cancel();

      pvp.remove(p);
    }

    if (Commands.delay.containsKey(p)) {
      if (Commands.delay.get(p).getTask().isSync()) Commands.delay.get(p).getTask().cancel();

      Commands.delay.remove(p);
    }
  }
  @EventHandler(priority = EventPriority.NORMAL)
  public void onPlayerQuit(PlayerQuitEvent event) {

    World world = event.getPlayer().getWorld();
    if (world.getName().equalsIgnoreCase(CreativeWorldConfig.CreativeName)) {
      CreativeWorldLib.PlayerSetSurvival(event.getPlayer());
    }
  }
Beispiel #11
0
  @EventHandler
  public void onPlayerQuit(PlayerQuitEvent e) {
    Player p = e.getPlayer();
    SPlayer player = new SPlayer(p);

    e.setQuitMessage(null);

    player.removePlayer();
  }
 @EventHandler
 public void quit(PlayerQuitEvent event) {
   if (!event.getPlayer().getWorld().getName().equals(getName())) return;
   if (isChosen(event.getPlayer().getName())) {
     Bukkit.broadcastMessage(
         ChatColor.LIGHT_PURPLE + "[BattleReverie] " + event.getPlayer().getName() + " quit!");
     endOrGo(event.getPlayer().getName());
   }
 }
 @Override
 public void onPlayerQuit(PlayerQuitEvent event) {
   Player triggerMessage = event.getPlayer();
   plugin.triggerMessages(triggerMessage, "ondisconnect");
   if (plugin.triggerMessages(triggerMessage, "ondisconnect|override")) {
     event.setQuitMessage("");
   }
   plugin.deathCause.remove(triggerMessage.getEntityId());
   plugin.deathBringer.remove(triggerMessage.getEntityId());
   return;
 }
 // Quit Handling
 @EventHandler
 public void onPlayerQuit(PlayerQuitEvent event) {
   if (!Utilities.getUtilities().onlyfirstjoin()) {
     String message = plugin.getConfig().getString("messages.leavemessage");
     if (!message.equalsIgnoreCase("none")) {
       event.setQuitMessage(Utilities.getUtilities().format(message, event.getPlayer()));
     } else {
       event.setQuitMessage(null);
     }
   }
 }
Beispiel #15
0
  @EventHandler(priority = EventPriority.HIGHEST)
  private void onPlayerQuit(PlayerQuitEvent evt) {
    plugin
        .getPlayerLocationListener()
        .removePlayerFromPoint(
            plugin.getPlayerHandler().findPlayer(evt.getPlayer().getDisplayName()));

    if (plugin.getPlayerHandler().findPlayer(evt.getPlayer().getDisplayName()) != null) {
      plugin.getPlayerHandler().removePlayer(evt.getPlayer().getDisplayName());
      // plugin.getLogger().info("removed " + evt.getPlayer().getDisplayName() + " from the game.");
    }
  }
Beispiel #16
0
  @EventHandler
  public void onQuit(PlayerQuitEvent e) {

    Player p = e.getPlayer();

    if (Join.pOnline < 5) {
      e.setQuitMessage(
          ChatUtils.getGamePrefix()
              + "Suite à la déconnexion de "
              + p.getName()
              + " le nombre de joueurs requis est inssufisant pour commencer la partie.");
    }
  }
  @EventHandler
  public void onPlayerLeave(PlayerQuitEvent e) {

    Player p = e.getPlayer();

    if (ArenaManager.isPlayerPlaying(p)) {

      e.setQuitMessage("");

      Arena arena = ArenaManager.getPlayersArena(p);
      ArenaManager.leave(arena, p, true);
    }
  }
 @EventHandler(priority = EventPriority.NORMAL)
 public void onPlayerQuit(final PlayerQuitEvent event) {
   if (event.getQuitMessage() == null) {
     return;
   }
   for (final IRCChannel c : Variables.channels) {
     if (!c.getBlockedEvents().contains("game_quit")) {
       IRC.sendMessageToChannel(
           c.getChannel(),
           ColorUtils.formatGametoIRC(event.getPlayer().getDisplayName() + " has quit."));
     }
   }
 }
Beispiel #19
0
  public void onPlayerQuit(PlayerQuitEvent event) {

    for (myPlayer player : parent.universe.players.values()) {
      if (player.player == event.getPlayer()) {

        player.dead = true;
        this.parent.informNpcDeadPlayer(event.getPlayer());

        // System.out.println("npcx : removed player ("+ player.player.getName()+")");
        // not needed
        // parent.universe.players.remove(player);
      }
    }
  }
Beispiel #20
0
 @EventHandler
 public void onQuit(PlayerQuitEvent event) {
   Player player = event.getPlayer();
   if (player.isOp()) {
     event.setQuitMessage(
         plugin.getConfig().getString("Messages.Quit.OP").replace("%player%", player.getName()));
   } else if (!player.hasPermission("gcpvp.vip")) {
     event.setQuitMessage(null);
   } else {
     plugin.getConfig().getString("Messages.Quit.VIP");
     event.setQuitMessage(
         plugin.getConfig().getString("Messages.Quit.VIP").replace("%player%", player.getName()));
   }
 }
Beispiel #21
0
 @EventHandler(priority = EventPriority.LOWEST)
 void playerQuit(PlayerQuitEvent event) {
   if (prefixOnQuit) {
     event.setQuitMessage(
         "["
             + plugin.getPlayerManager().getPlayer(event.getPlayer().getName()).getGroup()
             + "] "
             + event.getQuitMessage());
   }
   plugin.getPlayerManager().unregisterPlayer(event.getPlayer());
   if (plugin.getIRCBot() != null) {
     MinecraftQuitEvent evt = new MinecraftQuitEvent(event.getPlayer().getName());
     plugin.getServer().getPluginManager().callEvent(evt);
   }
 }
 @EventHandler
 public void onLeave(PlayerQuitEvent e) {
   if (!plugin.getConfig().getBoolean("Complete")) return;
   e.setQuitMessage(null);
   Player p = e.getPlayer();
   if (plugin.spieler != null && plugin.spieler == p) {
     plugin.spieler = null;
     if (!plugin.bfinish) {
       SpeedBuilder.gm.Reset();
     }
   }
   if (plugin.spectating.contains(p)) {
     plugin.spectating.remove(p);
   }
 }
Beispiel #23
0
 @EventHandler
 public void onPlayerQuit(PlayerQuitEvent pqe) {
   try {
     // Append to List in HashMap value column.
     List<LogEntry> previous = cache.get(pqe.getPlayer().getUniqueId());
     if (previous == null) {
       cache.put(pqe.getPlayer().getUniqueId(), new LinkedList<LogEntry>());
       previous = cache.get(pqe.getPlayer().getUniqueId());
     }
     previous.add(new LogEntry(false));
     cache.put(pqe.getPlayer().getUniqueId(), previous);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
 @EventHandler
 public void onQuit(PlayerQuitEvent evt) {
   for (Player p : Bukkit.getOnlinePlayers()) {
     if (p.equals(evt.getPlayer())) continue;
     for (Friendship f : FriendMe.friendships) {
       if (f.getSender().equals(evt.getPlayer())) {
         FriendMe.sendMessage(f.getReceiver(), Type.FRIEND_OFF, evt.getPlayer());
         break;
       } else if (f.getReceiver().equals(evt.getPlayer())) {
         FriendMe.sendMessage(f.getSender(), Type.FRIEND_OFF, evt.getPlayer());
         break;
       }
     }
   }
 }
 @EventHandler
 public void OnPlayerQuit(PlayerQuitEvent paramPlayerQuitEvent) {
   Player paramPlayer = paramPlayerQuitEvent.getPlayer();
   if (HasPet(paramPlayer)) {
     removePlayerMount(paramPlayer);
   }
 }
Beispiel #26
0
 @EventHandler
 public void onLeave(PlayerQuitEvent event) {
   Player player = event.getPlayer();
   if (!player.hasPermission(
       ConfigUtil.get().getConfig().getString("joinleavemessage.permission"))) {
     event.setQuitMessage(null);
   } else {
     event.setQuitMessage(
         ChatColor.translateAlternateColorCodes(
             '&',
             ConfigUtil.get()
                 .getConfig()
                 .getString("joinleavemessage.quit-message")
                 .replaceAll("%player%", player.getDisplayName())));
   }
 }
Beispiel #27
0
 @EventHandler(priority = EventPriority.HIGHEST)
 public void Quit(PlayerQuitEvent e) {
   Player p = e.getPlayer();
   boolean EMensagem = EssentialsLT.getInstance().getConfig().getBoolean("EMensagem");
   if (EMensagem) {
     if (p.hasPermission("membro")) {
       String saiu =
           EssentialsLT.getInstance()
               .getConfig()
               .getString("saiu")
               .replaceAll("&", "§")
               .replace("[nick]", p.getName());
       e.setQuitMessage(saiu);
     }
   }
 }
Beispiel #28
0
 @EventHandler
 public void onPlayerLogout(PlayerQuitEvent event) {
   String name = event.getPlayer().getName();
   if (this.beaconSetters.contains(name)) {
     this.beaconSetters.remove(name);
   }
 }
Beispiel #29
0
 @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
 public void onPlayerQuits(PlayerQuitEvent event) {
   plugin
       .getServer()
       .getScheduler()
       .runTask(plugin, new CancelAndRemoveIgnoreSleepTask(plugin, event.getPlayer().getName()));
 }
  @Override
  public void onPlayerQuit(PlayerQuitEvent event) {
    Player player = event.getPlayer();
    String playerName = player.getName();

    plugin.getPlayerData().remove(playerName);
  }