Java Code Examples for org.bukkit.event.player.PlayerKickEvent.setLeaveMessage()

The following are Jave code examples for showing how to use setLeaveMessage() of the org.bukkit.event.player.PlayerKickEvent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: BiteSkywars   File: PlayerListener.java   Source Code and License Vote up 6 votes
@EventHandler
public void onLeave(PlayerKickEvent event){
	Player p = event.getPlayer();
	SPlayer player = SPlayer.getDPlayer(p);
	Skywars.getStorage().unloadData(player);
	event.setLeaveMessage(null);
	Arena a = new ArenaManager().getArena(p);
	if(a==null){
		return;
	}
	a.leave(p);

	player.removeHolo(player);
	
	
}
 
Example 2
Project: BiteSkywars   File: PlayerListener.java   Source Code and License Vote up 6 votes
@EventHandler
public void onLeave(PlayerKickEvent event){
	Player p = event.getPlayer();
	SPlayer player = SPlayer.getDPlayer(p);
	Skywars.getStorage().unloadData(player);
	event.setLeaveMessage(null);
	Arena a = new ArenaManager().getArena(p);
	if(a==null){
		return;
	}
	a.leave(p);

	player.removeHolo(player);
	
	
}
 
Example 3
Project: CrazyLogin   File: PlayerListener.java   Source Code and License Vote up 6 votes
@EventHandler(priority = EventPriority.LOWEST)
public void PlayerKick(final PlayerKickEvent event) {
	final Player player = event.getPlayer();
	if (player.hasMetadata("NPC")) {
		return;
	}
	if (plugin.isUsingCustomJoinQuitMessagesEnabled()) {
		kicked.add(event.getPlayer().getName());
		event.setLeaveMessage("CRAZYLOGIN.KICK");
	}
	if (!plugin.isLoggedIn(player) && plugin.isDelayingJoinQuitMessagesEnabled()) {
		event.setLeaveMessage(null);
	}
	PlayerQuit(player, true);
	Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {

		@Override
		public void run() {
			plugin.unregisterDynamicHooks();
		}
	}, 5);
}
 
Example 4
Project: NPlugins   File: PunishmentListener.java   Source Code and License Vote up 6 votes
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerKick(final PlayerKickEvent event) {
    this.plugin.entering(this.getClass(), "onPlayerKick");

    String msg = this.punishmentDb.getLeaveMessages().remove(event.getPlayer().getUniqueId());
    if (msg != null) {
        if (this.plugin.isDebugEnabled()) {
            this.plugin.debug("Message not null: '" + msg + '\'');
        }
    } else {
        msg = this.plugin.getMessages().get(MessageId.player_standardKickMessage, event.getPlayer().getName())[0];
        if (this.plugin.isDebugEnabled()) {
            this.plugin.debug("Message is null, setting default: '" + msg + '\'');
        }
    }
    event.setLeaveMessage(msg);

    this.plugin.exiting(this.getClass(), "onPlayerKick");
}
 
Example 5
Project: Annihilation   File: PlayerListener.java   Source Code and License Vote up 5 votes
@EventHandler
public void onKick(PlayerKickEvent e) {
    if (e.getReason()
            .equals(ChatColor.RED + "ANNIHILATION-TRIGGER-KICK-01")) {
        e.setReason(ChatColor.RED
                + "You cannot join the game in this phase!");
        e.setLeaveMessage(null);
    }
}
 
Example 6
Project: StarQuestCode   File: LogoutListener.java   Source Code and License Vote up 5 votes
@EventHandler(priority = EventPriority.NORMAL)
public void setFormatChat( PlayerKickEvent e ) {
    PlayerManager.unloadPlayer( e.getPlayer().getName() );
    if ( ServerData.usingConnectionMessages() ) {
        e.setLeaveMessage( null );
    }
}
 
Example 7
Project: DDCustomPlugin   File: Chat.java   Source Code and License Vote up 5 votes
@EventHandler (priority = EventPriority.LOW)
	public void onPlayerKick(PlayerKickEvent e) {
		e.setLeaveMessage("     " + ChatColor.DARK_RED + "" + ChatColor.BOLD + "! " + utils.getNamePrefix(e.getPlayer()) + e.getPlayer().getName() + ChatColor.WHITE +  " - " + ChatColor.RED + "" + ChatColor.ITALIC + e.getReason());
		System.out.println("! " + e.getPlayer().getName() + " " + e.getReason());
//		for (RegisteredListener list : e.getHandlers().getRegisteredListeners()) {
//			log(list.getPlugin().toString());
//		}
//		e.setCancelled(true);
	}
 
Example 8
Project: CrafterNexus   File: PlayerListener.java   Source Code and License Vote up 5 votes
@EventHandler
public void onKick(PlayerKickEvent e) {
    if (e.getReason()
            .equals(ChatColor.RED + "ANNIHILATION-TRIGGER-KICK-01")) {
        e.setReason(ChatColor.RED
                + "You cannot join the game in this phase!");
        e.setLeaveMessage(null);
    }
}
 
Example 9
Project: CrazyLogin   File: PlayerListener.java   Source Code and License Vote up 5 votes
@EventHandler(priority = EventPriority.HIGHEST)
public void PlayerKickMessage(final PlayerKickEvent event) {
	final Player player = event.getPlayer();
	if (plugin.isUsingCustomJoinQuitMessagesEnabled()) {
		if (event.getLeaveMessage() != null) {
			if (event.getLeaveMessage().equals("CRAZYLOGIN.KICK")) {
				sendDefaultPlayerKickMessage(player);
				event.setLeaveMessage(null);
			}
		}
	}
}
 
Example 10
Project: xEssentials_old_Source   File: banKickEvent.java   Source Code and License Vote up 5 votes
@EventHandler
public void bannedPlayer(PlayerKickEvent e) {
	if(ban.isBanned(e.getPlayer())) {
		e.setLeaveMessage("");
	} else if(ban.isTempBanned(e.getPlayer())) {
		if(!timeunits.isOverTime(fileManager.getLongValue(e.getPlayer().getName().toLowerCase() + ".yml", "time", fileManager.getDir() + File.separator + "bans"))) {
			e.setLeaveMessage("");
		}
	}
}
 
Example 11
Project: mczone   File: Events.java   Source Code and License Vote up 4 votes
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
    event.setLeaveMessage(null);
}
 
Example 12
Project: mczone   File: Events.java   Source Code and License Vote up 4 votes
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
	event.setLeaveMessage(null);
}
 
Example 13
Project: mczone   File: ConnectEvents.java   Source Code and License Vote up 4 votes
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
	event.setLeaveMessage(null);
}
 
Example 14
Project: mczone   File: ConnectEvents.java   Source Code and License Vote up 4 votes
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
	event.setLeaveMessage(null);
}
 
Example 15
Project: Kineticraft   File: MechanicManager.java   Source Code and License Vote up 4 votes
@EventHandler
public void onPlayerKick(PlayerKickEvent evt) {
    evt.setLeaveMessage(null);
    onLeave(evt.getPlayer());
}
 
Example 16
Project: Chambers   File: ProfileListener.java   Source Code and License Vote up 4 votes
@EventHandler
public void onKick(PlayerKickEvent event) {
	removeProfile(event);
	event.setLeaveMessage(null);
}
 
Example 17
Project: Breakpoint   File: PlayerConnectionListener.java   Source Code and License Vote up 4 votes
@EventHandler
public void onPlayerKick(PlayerKickEvent event)
{
	event.setLeaveMessage(null);
}
 
Example 18
Project: Breakpoint   File: PlayerConnectionListener.java   Source Code and License Vote up 4 votes
@EventHandler
public void onPlayerKick(PlayerKickEvent event)
{
	event.setLeaveMessage(null);
}
 
Example 19
Project: Minecraft-UAPI   File: UserListener.java   Source Code and License Vote up 4 votes
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerKickEvent(PlayerKickEvent event) {
	event.setLeaveMessage(null);
	this.onExit(event.getPlayer());
}
 
Example 20
Project: Peacecraft   File: ChatListener.java   Source Code and License Vote up 4 votes
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerKick(PlayerKickEvent event) {
    this.module.removeOnlinePlayer(event.getPlayer().getName());
    event.setLeaveMessage(event.getLeaveMessage().replaceFirst(Pattern.quote(event.getPlayer().getName()), ChatColor.RESET + Matcher.quoteReplacement(event.getPlayer().getDisplayName()) + ChatColor.RESET + ChatColor.YELLOW));
}
 
Example 21
Project: MiniMiniGames   File: WorldListener.java   Source Code and License Vote up 4 votes
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
   event.setLeaveMessage(null);
}
 
Example 22
Project: ChatEx   File: ChatListener.java   Source Code and License Vote up 4 votes
@EventHandler(priority = EventPriority.LOWEST)
public void onKick(final PlayerKickEvent e) {
    if (!Config.CHANGE_JOIN_AND_QUIT.getBoolean()) return;
    String msg = Locales.PLAYER_KICK.getString();
    e.setLeaveMessage(Utils.replacePlayerPlaceholders(e.getPlayer(), msg));
}
 
Example 23
Project: Hub-Plugin   File: Main.java   Source Code and License Vote up 4 votes
@EventHandler
public void Kick(PlayerKickEvent e){
  e.setLeaveMessage(null);
}
 
Example 24
Project: EOEHub   File: PlayerListener.java   Source Code and License Vote up 4 votes
@EventHandler(priority = EventPriority.HIGHEST)
public void onKick(PlayerKickEvent event) {
    event.setLeaveMessage(null);
}
 
Example 25
Project: CivChat   File: ChatListener.java   Source Code and License Vote up 4 votes
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerKick(PlayerKickEvent event) {
    event.setLeaveMessage(null);
}