Java 类net.minecraft.client.stream.MetadataAchievement 实例源码

项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Updates the players statistics or achievements
 */
public void handleStatistics(S37PacketStatistics packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    boolean flag = false;

    for (Entry<StatBase, Integer> entry : packetIn.func_148974_c().entrySet()) {
        StatBase statbase = (StatBase) entry.getKey();
        int i = ((Integer) entry.getValue()).intValue();

        if (statbase.isAchievement() && i > 0) {
            if (this.field_147308_k && this.gameController.thePlayer.getStatFileWriter().readStat(statbase) == 0) {
                Achievement achievement = (Achievement) statbase;
                this.gameController.guiAchievement.displayAchievement(achievement);
                this.gameController.getTwitchStream().func_152911_a(new MetadataAchievement(achievement), 0L);

                if (statbase == AchievementList.openInventory) {
                    this.gameController.gameSettings.showInventoryAchievementHint = false;
                    this.gameController.gameSettings.saveOptions();
                }
            }

            flag = true;
        }

        this.gameController.thePlayer.getStatFileWriter().unlockAchievement(this.gameController.thePlayer, statbase,
                i);
    }

    if (!this.field_147308_k && !flag && this.gameController.gameSettings.showInventoryAchievementHint) {
        this.gameController.guiAchievement.displayUnformattedAchievement(AchievementList.openInventory);
    }

    this.field_147308_k = true;

    if (this.gameController.currentScreen instanceof IProgressMeter) {
        ((IProgressMeter) this.gameController.currentScreen).doneLoading();
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Updates the players statistics or achievements
 */
public void handleStatistics(S37PacketStatistics packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    boolean flag = false;

    for (Entry<StatBase, Integer> entry : packetIn.func_148974_c().entrySet())
    {
        StatBase statbase = (StatBase)entry.getKey();
        int i = ((Integer)entry.getValue()).intValue();

        if (statbase.isAchievement() && i > 0)
        {
            if (this.field_147308_k && this.gameController.thePlayer.getStatFileWriter().readStat(statbase) == 0)
            {
                Achievement achievement = (Achievement)statbase;
                this.gameController.guiAchievement.displayAchievement(achievement);
                this.gameController.getTwitchStream().func_152911_a(new MetadataAchievement(achievement), 0L);

                if (statbase == AchievementList.openInventory)
                {
                    this.gameController.gameSettings.showInventoryAchievementHint = false;
                    this.gameController.gameSettings.saveOptions();
                }
            }

            flag = true;
        }

        this.gameController.thePlayer.getStatFileWriter().unlockAchievement(this.gameController.thePlayer, statbase, i);
    }

    if (!this.field_147308_k && !flag && this.gameController.gameSettings.showInventoryAchievementHint)
    {
        this.gameController.guiAchievement.displayUnformattedAchievement(AchievementList.openInventory);
    }

    this.field_147308_k = true;

    if (this.gameController.currentScreen instanceof IProgressMeter)
    {
        ((IProgressMeter)this.gameController.currentScreen).doneLoading();
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Updates the players statistics or achievements
 */
public void handleStatistics(S37PacketStatistics packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    boolean flag = false;

    for (Entry<StatBase, Integer> entry : packetIn.func_148974_c().entrySet())
    {
        StatBase statbase = (StatBase)entry.getKey();
        int i = ((Integer)entry.getValue()).intValue();

        if (statbase.isAchievement() && i > 0)
        {
            if (this.field_147308_k && this.gameController.thePlayer.getStatFileWriter().readStat(statbase) == 0)
            {
                Achievement achievement = (Achievement)statbase;
                this.gameController.guiAchievement.displayAchievement(achievement);
                this.gameController.getTwitchStream().func_152911_a(new MetadataAchievement(achievement), 0L);

                if (statbase == AchievementList.openInventory)
                {
                    this.gameController.gameSettings.showInventoryAchievementHint = false;
                    this.gameController.gameSettings.saveOptions();
                }
            }

            flag = true;
        }

        this.gameController.thePlayer.getStatFileWriter().unlockAchievement(this.gameController.thePlayer, statbase, i);
    }

    if (!this.field_147308_k && !flag && this.gameController.gameSettings.showInventoryAchievementHint)
    {
        this.gameController.guiAchievement.displayUnformattedAchievement(AchievementList.openInventory);
    }

    this.field_147308_k = true;

    if (this.gameController.currentScreen instanceof IProgressMeter)
    {
        ((IProgressMeter)this.gameController.currentScreen).doneLoading();
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleStatistics(S37PacketStatistics p_147293_1_)
{
    boolean flag = false;
    StatBase statbase;
    int i;

    for (Iterator iterator = p_147293_1_.func_148974_c().entrySet().iterator(); iterator.hasNext(); this.gameController.thePlayer.getStatFileWriter().func_150873_a(this.gameController.thePlayer, statbase, i))
    {
        Entry entry = (Entry)iterator.next();
        statbase = (StatBase)entry.getKey();
        i = ((Integer)entry.getValue()).intValue();

        if (statbase.isAchievement() && i > 0)
        {
            if (this.field_147308_k && this.gameController.thePlayer.getStatFileWriter().writeStat(statbase) == 0)
            {
                Achievement achievement = (Achievement)statbase;
                this.gameController.guiAchievement.func_146256_a(achievement);
                this.gameController.func_152346_Z().func_152911_a(new MetadataAchievement(achievement), 0L);

                if (statbase == AchievementList.openInventory)
                {
                    this.gameController.gameSettings.showInventoryAchievementHint = false;
                    this.gameController.gameSettings.saveOptions();
                }
            }

            flag = true;
        }
    }

    if (!this.field_147308_k && !flag && this.gameController.gameSettings.showInventoryAchievementHint)
    {
        this.gameController.guiAchievement.func_146255_b(AchievementList.openInventory);
    }

    this.field_147308_k = true;

    if (this.gameController.currentScreen instanceof IProgressMeter)
    {
        ((IProgressMeter)this.gameController.currentScreen).func_146509_g();
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleStatistics(S37PacketStatistics p_147293_1_)
{
    boolean flag = false;
    StatBase statbase;
    int i;

    for (Iterator iterator = p_147293_1_.func_148974_c().entrySet().iterator(); iterator.hasNext(); this.gameController.thePlayer.getStatFileWriter().func_150873_a(this.gameController.thePlayer, statbase, i))
    {
        Entry entry = (Entry)iterator.next();
        statbase = (StatBase)entry.getKey();
        i = ((Integer)entry.getValue()).intValue();

        if (statbase.isAchievement() && i > 0)
        {
            if (this.field_147308_k && this.gameController.thePlayer.getStatFileWriter().writeStat(statbase) == 0)
            {
                Achievement achievement = (Achievement)statbase;
                this.gameController.guiAchievement.func_146256_a(achievement);
                this.gameController.func_152346_Z().func_152911_a(new MetadataAchievement(achievement), 0L);

                if (statbase == AchievementList.openInventory)
                {
                    this.gameController.gameSettings.showInventoryAchievementHint = false;
                    this.gameController.gameSettings.saveOptions();
                }
            }

            flag = true;
        }
    }

    if (!this.field_147308_k && !flag && this.gameController.gameSettings.showInventoryAchievementHint)
    {
        this.gameController.guiAchievement.func_146255_b(AchievementList.openInventory);
    }

    this.field_147308_k = true;

    if (this.gameController.currentScreen instanceof IProgressMeter)
    {
        ((IProgressMeter)this.gameController.currentScreen).func_146509_g();
    }
}