本文整理汇总了Java中net.minecraft.stats.StatBase.isAchievement方法的典型用法代码示例。如果您正苦于以下问题:Java StatBase.isAchievement方法的具体用法?Java StatBase.isAchievement怎么用?Java StatBase.isAchievement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.stats.StatBase
的用法示例。
在下文中一共展示了StatBase.isAchievement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addStat
import net.minecraft.stats.StatBase; //导入方法依赖的package包/类
/**
* Adds a value to a statistic field.
*/
public void addStat(StatBase stat, int amount)
{
if (stat != null)
{
if (stat.isAchievement() && net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.AchievementEvent(this, (net.minecraft.stats.Achievement) stat))) return;
this.statsFile.increaseStat(this, stat, amount);
for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(stat.getCriteria()))
{
this.getWorldScoreboard().getOrCreateScore(this.getName(), scoreobjective).increaseScore(amount);
}
if (this.statsFile.hasUnsentAchievement())
{
this.statsFile.sendStats(this);
}
}
}
示例2: handleStatistics
import net.minecraft.stats.StatBase; //导入方法依赖的package包/类
/**
* 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();
}
}
示例3: handleStatistics
import net.minecraft.stats.StatBase; //导入方法依赖的package包/类
/**
* 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();
}
}
示例4: handleStatistics
import net.minecraft.stats.StatBase; //导入方法依赖的package包/类
/**
* 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();
}
}
示例5: handleStatistics
import net.minecraft.stats.StatBase; //导入方法依赖的package包/类
/**
* 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();
}
}