本文整理汇总了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));
}