/**
* Places player back on their island if the setting is true
* @param e
*/
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerRespawn(final PlayerRespawnEvent e) {
if (DEBUG) {
plugin.getLogger().info(e.getEventName());
}
if (!Settings.respawnOnIsland) {
return;
}
if (respawn.contains(e.getPlayer().getUniqueId())) {
respawn.remove(e.getPlayer().getUniqueId());
Location respawnLocation = plugin.getGrid().getSafeHomeLocation(e.getPlayer().getUniqueId(), 1);
if (respawnLocation != null) {
//plugin.getLogger().info("DEBUG: Setting respawn location to " + respawnLocation);
e.setRespawnLocation(respawnLocation);
// Get island
Island island = plugin.getGrid().getIslandAt(respawnLocation);
if (island != null) {
// Run perms etc.
processPerms(e.getPlayer(), island);
}
}
}
}
PlayerEvents.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:acidisland
作者:
评论列表
文章目录