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


Java方法net.minecraft.entity.player.EntityPlayerMP.triggerAchievement代码示例

以下是Java方法net.minecraft.entity.player.EntityPlayerMP.triggerAchievement的代码示例。如果您正苦于以下问题:Java EntityPlayerMP.triggerAchievement方法的具体用法?Java EntityPlayerMP.triggerAchievement怎么用?Java EntityPlayerMP.triggerAchievement使用的例子?那么恭喜您, 这里整理的方法代码示例例程将为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.player.EntityPlayerMP的用法示例。

本文一共展示了EntityPlayerMP.triggerAchievement的1个开源代码实例,这些例子默认根据受欢迎程度排序。您可以为喜欢的代码打CALL点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: playerLoggedOut

import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
/**
 * Called when a player disconnects from the game. Writes player data to disk and removes them from the world.
 */
public void playerLoggedOut(EntityPlayerMP playerIn)
{
    playerIn.triggerAchievement(StatList.leaveGameStat);
    this.writePlayerData(playerIn);
    WorldServer worldserver = playerIn.getServerForPlayer();

    if (playerIn.ridingEntity != null)
    {
        worldserver.removePlayerEntityDangerously(playerIn.ridingEntity);
        logger.debug("removing player mount");
    }

    worldserver.removeEntity(playerIn);
    worldserver.getPlayerManager().removePlayer(playerIn);
    this.playerEntityList.remove(playerIn);
    UUID uuid = playerIn.getUniqueID();
    EntityPlayerMP entityplayermp = (EntityPlayerMP)this.uuidToPlayerMap.get(uuid);

    if (entityplayermp == playerIn)
    {
        this.uuidToPlayerMap.remove(uuid);
        this.playerStatFiles.remove(uuid);
    }

    this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {playerIn}));
}
 
开发者ID:Notoh,项目:DecompiledMinecraft,完整代码来源:ServerConfigurationManager.java



注:本文示例均筛选自Github等开源项目,代码版权请参考对应项目的License;未经允许,请勿转载。