/** * 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(); } }
/** * 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(); } }
/** * Updates the players statistics or achievements */ public void handleStatistics(SPacketStatistics packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); boolean flag = false; for (Entry<StatBase, Integer> entry : packetIn.getStatisticMap().entrySet()) { StatBase statbase = (StatBase)entry.getKey(); int i = ((Integer)entry.getValue()).intValue(); if (statbase.isAchievement() && i > 0) { if (this.hasStatistics && this.gameController.player.getStatFileWriter().readStat(statbase) == 0) { Achievement achievement = (Achievement)statbase; this.gameController.guiAchievement.displayAchievement(achievement); if (statbase == AchievementList.OPEN_INVENTORY) { this.gameController.gameSettings.showInventoryAchievementHint = false; this.gameController.gameSettings.saveOptions(); } } flag = true; } this.gameController.player.getStatFileWriter().unlockAchievement(this.gameController.player, statbase, i); } if (!this.hasStatistics && !flag && this.gameController.gameSettings.showInventoryAchievementHint) { this.gameController.guiAchievement.displayUnformattedAchievement(AchievementList.OPEN_INVENTORY); } this.hasStatistics = true; if (this.gameController.currentScreen instanceof IProgressMeter) { ((IProgressMeter)this.gameController.currentScreen).doneLoading(); } }
/** * Updates the players statistics or achievements */ public void handleStatistics(SPacketStatistics packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); boolean flag = false; for (Entry<StatBase, Integer> entry : packetIn.getStatisticMap().entrySet()) { StatBase statbase = (StatBase)entry.getKey(); int i = ((Integer)entry.getValue()).intValue(); if (statbase.isAchievement() && i > 0) { if (this.hasStatistics && this.gameController.thePlayer.getStatFileWriter().readStat(statbase) == 0) { Achievement achievement = (Achievement)statbase; this.gameController.guiAchievement.displayAchievement(achievement); if (statbase == AchievementList.OPEN_INVENTORY) { this.gameController.gameSettings.showInventoryAchievementHint = false; this.gameController.gameSettings.saveOptions(); } } flag = true; } this.gameController.thePlayer.getStatFileWriter().unlockAchievement(this.gameController.thePlayer, statbase, i); } if (!this.hasStatistics && !flag && this.gameController.gameSettings.showInventoryAchievementHint) { this.gameController.guiAchievement.displayUnformattedAchievement(AchievementList.OPEN_INVENTORY); } this.hasStatistics = true; if (this.gameController.currentScreen instanceof IProgressMeter) { ((IProgressMeter)this.gameController.currentScreen).doneLoading(); } }
/** * Updates the players statistics or achievements */ public void handleStatistics(S37PacketStatistics p_147293_1_) { boolean var2 = false; StatBase var5; int var6; for (Iterator var3 = p_147293_1_.func_148974_c().entrySet().iterator(); var3.hasNext(); this.gameController.thePlayer.func_146107_m().func_150873_a(this.gameController.thePlayer, var5, var6)) { Entry var4 = (Entry)var3.next(); var5 = (StatBase)var4.getKey(); var6 = ((Integer)var4.getValue()).intValue(); if (var5.isAchievement() && var6 > 0) { if (this.field_147308_k && this.gameController.thePlayer.func_146107_m().writeStat(var5) == 0) { this.gameController.guiAchievement.func_146256_a((Achievement)var5); if (var5 == AchievementList.openInventory) { this.gameController.gameSettings.showInventoryAchievementHint = false; this.gameController.gameSettings.saveOptions(); } } var2 = true; } } if (!this.field_147308_k && !var2 && 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(); } }
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(); } }