本文整理匯總了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);
}
示例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);
}
示例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");
}
示例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);
}
}
示例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 );
}
}
示例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);
}
示例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);
}
}
}
}
示例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("");
}
}
}
示例9: onPlayerKick
import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
event.setLeaveMessage(null);
}
示例10: onPlayerKick
import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
event.setLeaveMessage(null);
}
示例11: onPlayerKick
import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent evt) {
evt.setLeaveMessage(null);
onLeave(evt.getPlayer());
}
示例12: onKick
import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onKick(PlayerKickEvent event) {
removeProfile(event);
event.setLeaveMessage(null);
}
示例13: onPlayerKick
import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event)
{
event.setLeaveMessage(null);
}
示例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());
}
示例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));
}