Search in sources :

Example 1 with IProgressMeter

use of net.minecraft.client.gui.IProgressMeter in project CumServerPro by MCUmbrella.

the class NetHandlerPlayClient method handleStatistics.

public void handleStatistics(SPacketStatistics packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    for (Entry<StatBase, Integer> entry : packetIn.getStatisticMap().entrySet()) {
        StatBase statbase = entry.getKey();
        int k = ((Integer) entry.getValue()).intValue();
        this.gameController.player.getStatFileWriter().unlockAchievement(this.gameController.player, statbase, k);
    }
    this.hasStatistics = true;
    if (this.gameController.currentScreen instanceof IProgressMeter) {
        ((IProgressMeter) this.gameController.currentScreen).onStatsUpdated();
    }
}
Also used : StatBase(net.minecraft.stats.StatBase) IProgressMeter(net.minecraft.client.gui.IProgressMeter)

Example 2 with IProgressMeter

use of net.minecraft.client.gui.IProgressMeter in project kull by Sxmurai.

the class NetHandlerPlayClient method handleStatistics.

/**
 * 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();
    }
}
Also used : StatBase(net.minecraft.stats.StatBase) Achievement(net.minecraft.stats.Achievement) MetadataAchievement(net.minecraft.client.stream.MetadataAchievement) IProgressMeter(net.minecraft.client.gui.IProgressMeter) MetadataAchievement(net.minecraft.client.stream.MetadataAchievement)

Example 3 with IProgressMeter

use of net.minecraft.client.gui.IProgressMeter in project Minecraft-SlientClient-Hack by YouNeverKnow00.

the class NetHandlerPlayClient method handleStatistics.

/**
 * Updates the players statistics or achievements
 */
public void handleStatistics(SPacketStatistics packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    for (Entry<StatBase, Integer> entry : packetIn.getStatisticMap().entrySet()) {
        StatBase statbase = entry.getKey();
        int k = ((Integer) entry.getValue()).intValue();
        this.gameController.player.getStatFileWriter().unlockAchievement(this.gameController.player, statbase, k);
    }
    this.hasStatistics = true;
    if (this.gameController.currentScreen instanceof IProgressMeter) {
        ((IProgressMeter) this.gameController.currentScreen).func_193026_g();
    }
}
Also used : StatBase(net.minecraft.stats.StatBase) IProgressMeter(net.minecraft.client.gui.IProgressMeter)

Example 4 with IProgressMeter

use of net.minecraft.client.gui.IProgressMeter in project WizClient-1.8.9-Version by WizClient.

the class NetHandlerPlayClient method handleStatistics.

/**
 * 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);
                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();
    }
}
Also used : StatBase(net.minecraft.stats.StatBase) MetadataAchievement(net.minecraft.client.util.metadata.MetadataAchievement) Achievement(net.minecraft.stats.Achievement) IProgressMeter(net.minecraft.client.gui.IProgressMeter)

Aggregations

IProgressMeter (net.minecraft.client.gui.IProgressMeter)4 StatBase (net.minecraft.stats.StatBase)4 Achievement (net.minecraft.stats.Achievement)2 MetadataAchievement (net.minecraft.client.stream.MetadataAchievement)1 MetadataAchievement (net.minecraft.client.util.metadata.MetadataAchievement)1