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


Java PlayerRespawnEvent.getRespawnLocation方法代碼示例

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


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

示例1: onPlayerRespawn

import org.bukkit.event.player.PlayerRespawnEvent; //導入方法依賴的package包/類
public void onPlayerRespawn(PlayerRespawnEvent event) {
    if (!plugin.config.handle_player_respawn) {
        return;
    }
    Location respawnLocation = event.getRespawnLocation();
    Location defaultLocation = respawnLocation.getWorld().getSpawnLocation();
    if (respawnLocation.equals(defaultLocation) || respawnLocation.distance(defaultLocation) <= 2) {
        SpawnLocation spawn = plugin.getPlayerSpawn(event.getPlayer());
        event.setRespawnLocation(spawn.getLocation());
        plugin.getLogger().info(I18n.format("log.respawn", event.getPlayer().getName(), spawn.getName()));
    }
}
 
開發者ID:NyaaCat,項目名稱:Ourtown,代碼行數:13,代碼來源:EventListener.java

示例2: onPlayerTeleport

import org.bukkit.event.player.PlayerRespawnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerTeleport(final PlayerRespawnEvent event)
{
    if(event.getPlayer() != null && event.getRespawnLocation() != null)
    {
       // final AnniPlayer p = AnniPlayer.getPlayer(event.getPlayer().getUniqueId());
       // if(p != null)
       // {
            //					if(permanentBar)
            //						BarAPI.sendPermDragon(event.getPlayer());
            //					else
            handleTeleport(event.getPlayer(), event.getRespawnLocation().clone());
       // }
    }
}
 
開發者ID:MrLittleKitty,項目名稱:AnnihilationPro,代碼行數:16,代碼來源:Bar.java

示例3: onPlayerRespawn2

import org.bukkit.event.player.PlayerRespawnEvent; //導入方法依賴的package包/類
/**
 * On player respawn2.
 * 
 * @param event
 *            the event
 */
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
// For land listener
public void onPlayerRespawn2(PlayerRespawnEvent event) {

	Player player = event.getPlayer();
	PlayerConfEntry entry = playerConf.get(player);
	Location loc = event.getRespawnLocation();

	updatePosInfo(event, entry, loc, false);
}
 
開發者ID:Tabinol,項目名稱:Factoid,代碼行數:17,代碼來源:PlayerListener.java

示例4: onRespawn

import org.bukkit.event.player.PlayerRespawnEvent; //導入方法依賴的package包/類
@EventHandler
public void onRespawn(PlayerRespawnEvent event) {
	if (!this.module.spawnLoc.isPresent()) { return; }

	Location respawnLoc = event.getRespawnLocation();

	if (this.module.spawnLoc.isPresent()) {
		if (!event.isBedSpawn() || respawnLoc.getY() < 4) {
			respawnLoc = this.module.spawnLoc.get();
		}
	}
	
	event.setRespawnLocation(respawnLoc);
}
 
開發者ID:Craftolution,項目名稱:CraftoPlugin,代碼行數:15,代碼來源:FixedRespawnComponent.java

示例5: PlayerRespawn

import org.bukkit.event.player.PlayerRespawnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
public void PlayerRespawn(final PlayerRespawnEvent event) {
	final Player player = event.getPlayer();
	if (isLoggedInRespawn(player)) {
		return;
	}
	final Location respawnLocation = event.getRespawnLocation();
	if (respawnLocation != null && respawnLocation.getWorld() != null) {
		if (plugin.isForceSaveLoginEnabled()) {
			savelogin.put(player.getName().toLowerCase(), respawnLocation.clone());
			final Location tempSpawnLocation = plugin.getSaveLoginLocation(respawnLocation.getWorld());
			event.setRespawnLocation(tempSpawnLocation);
			setMovementBlocker(player, tempSpawnLocation);
		}
		else {
			setMovementBlocker(player, respawnLocation);
		}
	}
	final AuthRequestor requestor;
	if (plugin.hasPlayerData(player)) {
		requestor = new AuthRequestor(plugin, player, "LOGIN.REQUEST");
	}
	else {
		requestor = new AuthRequestor(plugin, player, "REGISTER.REQUEST");
	}
	if (plugin.getRepeatAuthRequests() > 0) {
		requestor.start(5, plugin.getRepeatAuthRequests());
	}
	else {
		requestor.start(5);
	}
}
 
開發者ID:ST-DDT,項目名稱:CrazyLogin,代碼行數:33,代碼來源:PlayerListener.java

示例6: callRespawnEvent

import org.bukkit.event.player.PlayerRespawnEvent; //導入方法依賴的package包/類
@Override
public Location callRespawnEvent(final Player player, final Location loc, final boolean bedSpawn)
{
	final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, loc, bedSpawn);
	getServer().getPluginManager().callEvent(pre);
	return pre.getRespawnLocation();
}
 
開發者ID:Curtis3321,項目名稱:Essentials,代碼行數:8,代碼來源:BukkitPlugin.java


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