當前位置: 首頁>>代碼示例>>Java>>正文


Java PlayerKickEvent.setLeaveMessage方法代碼示例

本文整理匯總了Java中org.bukkit.event.player.PlayerKickEvent.setLeaveMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java PlayerKickEvent.setLeaveMessage方法的具體用法?Java PlayerKickEvent.setLeaveMessage怎麽用?Java PlayerKickEvent.setLeaveMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.event.player.PlayerKickEvent的用法示例。


在下文中一共展示了PlayerKickEvent.setLeaveMessage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onLeave

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@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);
	
	
}
 
開發者ID:SpikyBite,項目名稱:BiteSkywars,代碼行數:17,代碼來源:PlayerListener.java

示例2: PlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@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);
}
 
開發者ID:ST-DDT,項目名稱:CrazyLogin,代碼行數:23,代碼來源:PlayerListener.java

示例3: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@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");
}
 
開發者ID:Ribesg,項目名稱:NPlugins,代碼行數:20,代碼來源:PunishmentListener.java

示例4: onKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@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);
    }
}
 
開發者ID:cancabron,項目名稱:Annihilation,代碼行數:10,代碼來源:PlayerListener.java

示例5: setFormatChat

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.NORMAL)
public void setFormatChat( PlayerKickEvent e ) {
    PlayerManager.unloadPlayer( e.getPlayer().getName() );
    if ( ServerData.usingConnectionMessages() ) {
        e.setLeaveMessage( null );
    }
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:8,代碼來源:LogoutListener.java

示例6: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@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);
	}
 
開發者ID:Esaych,項目名稱:DDCustomPlugin,代碼行數:10,代碼來源:Chat.java

示例7: PlayerKickMessage

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@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);
			}
		}
	}
}
 
開發者ID:ST-DDT,項目名稱:CrazyLogin,代碼行數:13,代碼來源:PlayerListener.java

示例8: bannedPlayer

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@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("");
		}
	}
}
 
開發者ID:xize,項目名稱:xEssentials_old_Source,代碼行數:11,代碼來源:banKickEvent.java

示例9: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
    event.setLeaveMessage(null);
}
 
開發者ID:thekeenant,項目名稱:mczone,代碼行數:5,代碼來源:Events.java

示例10: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
	event.setLeaveMessage(null);
}
 
開發者ID:thekeenant,項目名稱:mczone,代碼行數:5,代碼來源:Events.java

示例11: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent evt) {
    evt.setLeaveMessage(null);
    onLeave(evt.getPlayer());
}
 
開發者ID:Kneesnap,項目名稱:Kineticraft,代碼行數:6,代碼來源:MechanicManager.java

示例12: onKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onKick(PlayerKickEvent event) {
	removeProfile(event);
	event.setLeaveMessage(null);
}
 
開發者ID:HuliPvP,項目名稱:Chambers,代碼行數:6,代碼來源:ProfileListener.java

示例13: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event)
{
	event.setLeaveMessage(null);
}
 
開發者ID:Limeth,項目名稱:Breakpoint,代碼行數:6,代碼來源:PlayerConnectionListener.java

示例14: onPlayerKickEvent

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerKickEvent(PlayerKickEvent event) {
	event.setLeaveMessage(null);
	this.onExit(event.getPlayer());
}
 
開發者ID:imfanhua,項目名稱:Minecraft-UAPI,代碼行數:6,代碼來源:UserListener.java

示例15: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@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));
}
 
開發者ID:Steveice10,項目名稱:Peacecraft,代碼行數:6,代碼來源:ChatListener.java


注:本文中的org.bukkit.event.player.PlayerKickEvent.setLeaveMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。