当前位置: 首页>>代码示例>>Java>>正文


Java PlayerQuitEvent.getPlayer方法代码示例

本文整理汇总了Java中org.bukkit.event.player.PlayerQuitEvent.getPlayer方法的典型用法代码示例。如果您正苦于以下问题:Java PlayerQuitEvent.getPlayer方法的具体用法?Java PlayerQuitEvent.getPlayer怎么用?Java PlayerQuitEvent.getPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.event.player.PlayerQuitEvent的用法示例。


在下文中一共展示了PlayerQuitEvent.getPlayer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handlePlayerQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
private void handlePlayerQuit(PlayerQuitEvent event) {
    Player player = event.getPlayer();

    teams.values().forEach(t -> {
        t.unsubscribe(player, true);
        t.removePlayer(player);
    });
    objectives.values().forEach(o -> o.unsubscribe(player, true));

    Map<String, PacketScoreboardObjective> playerObjectives = this.playerObjectives.remove(player.getUniqueId());
    if (playerObjectives != null) {
        playerObjectives.values().forEach(o -> o.unsubscribe(player, true));
    }

    Map<String, PacketScoreboardTeam> playerTeams = this.playerTeams.remove(player.getUniqueId());
    if (playerTeams != null) {
        playerTeams.values().forEach(t -> {
            t.unsubscribe(player, true);
            t.removePlayer(player);
        });
    }
}
 
开发者ID:lucko,项目名称:helper,代码行数:23,代码来源:PacketScoreboard.java

示例2: onQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
public void onQuit(PlayerQuitEvent event) {
	Player player = event.getPlayer();
	PlaceHolderSetup(player);
	if (enableQuitMessage) {
		broadcastQuitMessage("chatassets.loghandler.quitmessage.receive", event);
	}
	int index = 0;
	if (Commander.msgsender.contains(player)) {
		index = Commander.msgsender.indexOf(player);
		Commander.msgsender.remove(index);
		Commander.msgreceiver.remove(index);
	} else if (Commander.msgreceiver.contains(player)) {
		index = Commander.msgreceiver.indexOf(player);
		Commander.msgsender.remove(index);
		Commander.msgreceiver.remove(index);
	}
}
 
开发者ID:RcExtract,项目名称:ChatAssets,代码行数:18,代码来源:LogHandler.java

示例3: hideAbandonedServer

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR)
public void hideAbandonedServer(PlayerQuitEvent event) {
    final Server local = minecraftService.getLocalServer();

    if(local.startup_visibility() != ServerDoc.Visibility.PUBLIC &&      // If server was initially not public and
       local.visibility() == ServerDoc.Visibility.PUBLIC &&              // server was made public and
       event.getPlayer().hasPermission(VISIBILITY_PERMISSION)) {    // someone with perms to do that is leaving...

        // ...check if there is still someone online with that permission
        for(Player player : event.getPlayer().getServer().getOnlinePlayers()) {
            // If someone else with perms is online, we're cool
            if(player != event.getPlayer() && player.hasPermission(VISIBILITY_PERMISSION)) return;
        }

        // If nobody with perms is online, make the server non-public again
        logger.info("Reverting server visibility to " + local.startup_visibility() + " because nobody with permissions is online");
        setVisibility(local.startup_visibility());
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:20,代码来源:ServerVisibilityCommands.java

示例4: onQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler
public void onQuit(PlayerQuitEvent e) {
    Player p = e.getPlayer();
    if (FakeAPI.getFakeEntities().containsKey(p.getName())) {
        PlayerFakeUtil.unFollowPlayer(p);
        PlayerFakeUtil.normalizeLook(p);
        PlayerFakeUtil.cancelAllSplittedTasks(p);

        ArmorstandFakeUtil.unFollowArmorstand(p);
        ArmorstandFakeUtil.cancelAllSplittedTasks(p);

        EndercrystalFakeUtil.cancelAllSplittedTasks(p);

        MobFakeUtil.unFollowPlayer(p);
        MobFakeUtil.normalizeLook(p);
        MobFakeUtil.cancelAllSplittedTasks(p);

        BigItemFakeUtil.cancelAllSplittedTasks(p);

        FakeAPI.getFakeEntities().remove(p.getName());
    }
}
 
开发者ID:AlphaHelixDev,项目名称:AlphaLibary,代码行数:23,代码来源:FakeEventListener.java

示例5: onLeave

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler
public void onLeave(PlayerQuitEvent event) {
    Player player = event.getPlayer();

    event.setQuitMessage(null);

    Game game = Skywars.getInstance().getGame(player);
    if (game != null && game.getGamePlayer(player) != null) {
        GamePlayer gamePlayer = game.getGamePlayer(player);

        if (gamePlayer.isTeamClass()) {
            if (gamePlayer.getTeam().isPlayer(player)) {
                player.damage(player.getMaxHealth()); // Kill player to make game process this as a death
            }
        } else {
            if (gamePlayer.getPlayer() == player) {
                player.damage(player.getMaxHealth()); // Kill player to make game process this as a death
            }
        }
    }
}
 
开发者ID:JordanOsterberg,项目名称:SkywarsSeries,代码行数:22,代码来源:PlayerLeave.java

示例6: onPlayerLogout

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler
public void onPlayerLogout (PlayerQuitEvent event)
{
    Player eventPlayer = event.getPlayer ();

    PlayerManager.Instance ().removePlayer (eventPlayer.getUniqueId ());
}
 
开发者ID:MagnaRisa,项目名称:CraftyProfessions,代码行数:8,代码来源:CoreListener.java

示例7: onQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST)
public void onQuit(PlayerQuitEvent 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

示例8: dec

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST)
public void dec(PlayerQuitEvent evt){
    Player player = evt.getPlayer();
    names.remove(player.getName());
    players.remove(player);
    
    if (!quit.isEmpty()) {
        for (QuitReactor re : quit) re.react(evt);
    }
}
 
开发者ID:GelandiAssociation,项目名称:EscapeLag,代码行数:11,代码来源:AzurePlayerList.java

示例9: onQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler
public void onQuit(PlayerQuitEvent e){
    Player p = e.getPlayer();
    RagePlayer u = RageGames.getPlayer(p);
    plugin.getGm().removePlayerFromGame(u);
    RageGames.players.remove(u);
    Utils.broadcastMsg("&7Ha salido del juego &e" + p.getDisplayName() + " &3(&b" + plugin.getGm().getPlaying().size() + "&d/&b" + plugin.getAm().getMaxPlayers() + "&3)");
}
 
开发者ID:cadox8,项目名称:PA,代码行数:9,代码来源:PlayerEvents.java

示例10: onQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler
public void onQuit(PlayerQuitEvent e){
	Player p = e.getPlayer();
	if(PlayerManager.confirmationReady.contains(p)){
		PlayerManager.confirmationReady.remove(p); 
	}
}
 
开发者ID:DiscowZombie,项目名称:UltimateTs,代码行数:8,代码来源:TypeYesOrNo.java

示例11: onPlayerQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerQuit(PlayerQuitEvent event) {
	Player player = event.getPlayer();

	Craft craft = Craft.getPlayerCraft(player);

	if (craft != null) {
		if (craft.isNameOnBoard.get(player.getName())) {
			Craft.reboardNames.put(player.getName(), craft);

			craft.isNameOnBoard.put(player.getName(), false);
			if (craft.driverName == player.getName()) {
				craft.haveControl = false;
				craft.releaseHelm();
			}

			boolean abandonCheck = true;
			for (String s : craft.isNameOnBoard.keySet()) {
				if (craft.isNameOnBoard.get(s)) {
					abandonCheck = false;
				}
			}

			if (abandonCheck) {
				craft.abandoned = true;
				craft.captainAbandoned = true;
			} else if (player.getName() == craft.captainName) {
				craft.captainAbandoned = true;
			}
		}

		for (Periscope p : craft.periscopes) {
			if (p.user == player) {
				p.user = null;
				break;
			}
		}
	}

}
 
开发者ID:Maximuspayne,项目名称:NavyCraft2-Lite,代码行数:41,代码来源:NavyCraft_PlayerListener.java

示例12: onPlayerQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
/**
 * Remove the player from all maps and lists.
 *
 * @param event the event.
 */
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
    Player player = event.getPlayer();
    Arc.getExemptionManager().clearData(player);
    Arc.getViolationHandler().removeViolationData(player);

    // clear check data.
    MovingData.removeData(player);
    FightData.removeData(player);
    InventoryData.removeData(player);

    Arc.getViolationHandler().clearPlayerData(player);

}
 
开发者ID:Vrekt,项目名称:Arc-v2,代码行数:20,代码来源:PlayerListener.java

示例13: onPlayerQuitEvent

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler
public void onPlayerQuitEvent(PlayerQuitEvent event) {
    Player player = event.getPlayer();
    PlayerTab playerTab = PlayerTab.getByPlayer(player);

    if (playerTab != null) {
        for (Team team : new HashSet<>(playerTab.getScoreboard().getTeams())) {
            team.unregister();
        }

        PlayerTab.getPlayerTabs().remove(playerTab);
        Bukkit.getPluginManager().callEvent(new PlayerTabRemoveEvent(playerTab));
    }
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:15,代码来源:Kraken.java

示例14: onQuit

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler
public void onQuit(PlayerQuitEvent event) {
	Player player = event.getPlayer();
	PlayerScoreboard board = null;
	if ((board = scoreboards.remove(player.getUniqueId())) != null) {
		board.disable();
	}
}
 
开发者ID:HuliPvP,项目名称:Chambers,代码行数:9,代码来源:ScoreboardManager.java

示例15: onDisconnect

import org.bukkit.event.player.PlayerQuitEvent; //导入方法依赖的package包/类
@EventHandler
public void onDisconnect(PlayerQuitEvent event) {
    Player player = event.getPlayer();
    if (isInProgress(player)) {
        popInProgressCommit(player).cleanup();
    }
    popSignEditCommit(player);
}
 
开发者ID:Deltik,项目名称:SignEdit,代码行数:9,代码来源:Interact.java


注:本文中的org.bukkit.event.player.PlayerQuitEvent.getPlayer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。