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


Java PlayerKickEvent.getPlayer方法代碼示例

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


在下文中一共展示了PlayerKickEvent.getPlayer方法的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: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event){
	Player player = event.getPlayer();
	Location location = player.getLocation();
	
	PlayerKickObsel obsel = new PlayerKickObsel(
			new Date().getTime(),
			location.getBlockX(),
			location.getBlockY(),
			location.getBlockZ(),
			location.getWorld().getName(),
			player.getName(),
			event.getReason());
	
	JSONObselManager.getInstance().addObsel(obsel);
}
 
開發者ID:Lyon1-Asterix,項目名稱:Minetrace,代碼行數:17,代碼來源:MinetraceListener.java

示例3: onKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onKick(final PlayerKickEvent event) {

	final PlayerStat stat = PlayerStat.TIMES_KICKED;

	// Get player
	final Player player = event.getPlayer();

	// Do general check
	if (!plugin.doGeneralCheck(player, stat))
		return;

	// Update value to new stat.
	plugin.getDataManager().setPlayerInfo(player.getUniqueId(), stat, StatzUtil.makeQuery("uuid",
			player.getUniqueId(), "value", 1, "world", player.getWorld().getName(), "reason", event.getReason()));

}
 
開發者ID:Staartvin,項目名稱:Statz,代碼行數:18,代碼來源:TimesKickedListener.java

示例4: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
	Player player = event.getPlayer();
	//Retrieves important information about player
	String name = player.getName();
	String uuid = player.getUniqueId().toString();
	String ip = player.getAddress().getAddress().getHostAddress();
	Date time = new Date();
	boolean online = true;
	String world = player.getWorld().getName();
	String location = getLocation(player);
	//Upserts to database unless the player is in the do not track list
	if(!(playerIsIncognito(name))) {
		Bukkit.getScheduler().runTaskAsynchronously(this, new Runnable() {
			public void run() {
				getSQLDatabase().updatePlayerData(name, uuid, ip, time, online, world, location);
			}
		});
	}
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:21,代碼來源:SQGlobalInfo.java

示例5: 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

示例6: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent e)
{
    Set<ProtectedRegion> regions = playerRegions.remove(e.getPlayer());
    if (regions != null)
    {
        for(ProtectedRegion region : regions)
        {
            RegionLeaveEvent leaveEvent = new RegionLeaveEvent(region, e.getPlayer(), MovementWay.DISCONNECT);
            RegionLeftEvent leftEvent = new RegionLeftEvent(region, e.getPlayer(), MovementWay.DISCONNECT);

            BAMradio.Instance.getServer().getPluginManager().callEvent(leaveEvent);
            BAMradio.Instance.getServer().getPluginManager().callEvent(leftEvent);
        }
    }
}
 
開發者ID:fr34kyn01535,項目名稱:BAMradio,代碼行數:17,代碼來源:WGRegionEventsListener.java

示例7: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onPlayerKick(PlayerKickEvent event) {
	Player p = event.getPlayer();
	ArenaManager am = SimpleSurvivalGames.instance.getArenaManager();
	
	// Make sure the player is not null
	if(p == null)
		return;
	
	// Make sure the event was not cancelled
	if(event.isCancelled())
		return;
	
	// Is the current in any arena
	if(am.isInArena(p)) {
		Arena arena = am.getPlayer(p).getArena();
		
		// Kick the player out of the arena
		SimpleSurvivalGames.instance.getArenaManager().kick(p);
		
		// Show a message to all players this player died
		arena.sendMessage(ChatColor.GOLD + p.getName() + ChatColor.DARK_RED + " lost connection!");
	}
}
 
開發者ID:timvisee,項目名稱:simple-survival-games,代碼行數:25,代碼來源:SSGPlayerListener.java

示例8: onKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOWEST)
public void onKick(PlayerKickEvent event) {
    Player player = event.getPlayer();

    if (this.profiles.containsKey(player.getUniqueId())) {
        this.profiles.get(player.getUniqueId()).save(new GenericCallback() {
            @Override
            public void call(boolean result) {
                profiles.remove(player.getUniqueId());
            }
        });
    }
}
 
開發者ID:ijoeleoli,項目名稱:ZorahPractice,代碼行數:14,代碼來源:PlayerManager.java

示例9: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
/**
    * Handles players getting kicked
    *
    * @param e an event representing a player getting kicked
    * @see PlayerKickEvent
    * @since 2.1.0
    */
@EventHandler
public void onPlayerKick(PlayerKickEvent e) {
	Player player = e.getPlayer();
	
	if (ArenaManager.getInstance().getArena(player) == null) {
		return;
	}
	
	Arena arena = ArenaManager.getInstance().getArena(player);
	
	arena.leave(player);
}
 
開發者ID:stefvanschie,項目名稱:buildinggame,代碼行數:20,代碼來源:Leave.java

示例10: onKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onKick(PlayerKickEvent event) {
	Player player = event.getPlayer();
	if(silent.contains(player.getName())) {
		silent.remove(player.getName());
	}
}
 
開發者ID:McSheepMaster,項目名稱:sNoHax,代碼行數:8,代碼來源:Alerter.java

示例11: onKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler
public void onKick(PlayerKickEvent e) {
	Player p = e.getPlayer();

	if (TimeVoteListener.isVoting(p.getWorld().getName())) {
		TimeVoteListener.getVoteing(p.getWorld().getName()).switchWorld(p, false);
	}
}
 
開發者ID:fof1092,項目名稱:TimeVote,代碼行數:9,代碼來源:EventListener.java

示例12: onKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler(priority=EventPriority.HIGHEST)
public void onKick(PlayerKickEvent ev)
{
	Player player = ev.getPlayer();
	
	if (this.am.isInGame(player)) {
		// If the player is in game, remove it to avoid get locked
		// in the arena.
		this.am.removePlayer(player);
	}
}
 
開發者ID:odarriba,項目名稱:defend-the-village,代碼行數:12,代碼來源:Main.java

示例13: PlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void PlayerKick(PlayerKickEvent event) {
	Player p = event.getPlayer();
	removeBar(p);
	FDragon.removehorligneD(p);
	FWither.removehorligneW(p);
}
 
開發者ID:mgone2010,項目名稱:BossbarAPI,代碼行數:8,代碼來源:BossbarAPI.java

示例14: onPlayerKick

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerKick(PlayerKickEvent event){
	if(enableEventKicked) {
		try {
			Player player = event.getPlayer();

			if(!player.hasPermission("googleanalyticsplugin.ignore")) {
				plugin.getTracker().TrackAction(getClientName(plugin, player), getClientId(player), getClientIP(player.getAddress().getAddress()), player.getName(), "Kicked", event.getReason());
			}
		}
		catch(Exception e) {
			plugin.getLogger().warning("Event Listener Error: " + e.getMessage());
		}
	}
}
 
開發者ID:Fox32,項目名稱:GoogleAnalyticsPlugin,代碼行數:16,代碼來源:GoogleAnalyticsEventListener.java

示例15: onPlayerKicked

import org.bukkit.event.player.PlayerKickEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPlayerKicked(PlayerKickEvent event)
   {
	Player player = event.getPlayer();
	RpChar character = plugin.getCharacterManager().getCharacter(player);
	if (character == null)
		return;
       plugin.getStorage().saveCharacter(character);
}
 
開發者ID:AaronFoley,項目名稱:CharacterCards,代碼行數:10,代碼來源:PlayerListener.java


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