本文整理汇总了Java中net.canarymod.api.statistics.Achievement类的典型用法代码示例。如果您正苦于以下问题:Java Achievement类的具体用法?Java Achievement怎么用?Java Achievement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Achievement类属于net.canarymod.api.statistics包,在下文中一共展示了Achievement类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public Achievement getAchievement(String nmsName) {
if (StatList.getOneShotStat(nmsName) instanceof Achievement) {
return (Achievement) StatList.getOneShotStat(nmsName);
}
return null;
}
示例2: removeAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public void removeAchievement(Achievement achievement) {
// Ensure all children achievements are removed
Arrays.stream(Achievements.values())
.map(Achievements::getInstance).map(Achievement::getParent)
.filter(achievement::equals).filter(this::hasAchievement)
.forEach(this::removeAchievement);
this.statisticsFile.unlockAchievement(null, (StatBase) achievement, 0);
}
示例3: awardAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public void awardAchievement(Achievement achievement) {
// Ensure all parent achievements are awarded
if (!this.hasAchievement(achievement.getParent())) {
this.awardAchievement(achievement.getParent());
}
this.statisticsFile.unlockAchievement(null, (StatBase) achievement, 1);
}
示例4: removeAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public void removeAchievement(Achievement achievement) {
// Ensure all children achievements are removed
Arrays.stream(Achievements.values())
.map(Achievements::getInstance).map(Achievement::getParent)
.filter(achievement::equals).filter(this::hasAchievement)
.forEach(this::removeAchievement);
this.statsFile.unlockAchievement((EntityPlayerMP) (Object) this, (StatBase) achievement, 0);
}
示例5: awardAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public void awardAchievement(Achievement achievement) {
// Ensure all parent achievements are awarded
if (!this.hasAchievement(achievement.getParent())) {
this.awardAchievement(achievement.getParent());
}
this.statsFile.unlockAchievement((EntityPlayerMP) (Object) this, (StatBase) achievement, 1);
this.statsFile.sendAchievements((EntityPlayerMP) (Object) this);
}
示例6: restoreAchievements
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
private void restoreAchievements(final String achievements, final Player player) {
final StringTokenizer st = new StringTokenizer(achievements, ";");
while (st.hasMoreTokens()) {
final String t = st.nextToken();
final int i = t.indexOf("=");
final String achievementName = t.substring(0, i);
final Achievement a = STATS_FACTORY.getAchievement(achievementName);
player.setStat(a, Integer.parseInt(t.substring(i + 1)));
}
}
示例7: hasAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public boolean hasAchievement(Achievement achievement) {
return this.statsFile.hasAchievementUnlocked((net.minecraft.stats.Achievement) achievement);
}
示例8: hasAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public boolean hasAchievement(Achievement achievement) {
return this.statisticsFile.hasAchievementUnlocked((net.minecraft.stats.Achievement) achievement);
}
示例9: removeAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public void removeAchievement(Achievement achievement) {
}
示例10: awardAchievement
import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public void awardAchievement(Achievement achievement) {
}