当前位置: 首页>>代码示例>>Java>>正文


Java Achievement类代码示例

本文整理汇总了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;
}
 
开发者ID:NeptunePowered,项目名称:NeptuneCommon,代码行数:8,代码来源:NeptuneStatisticsFactory.java

示例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);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:11,代码来源:NeptuneOfflinePlayer.java

示例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);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:10,代码来源:NeptuneOfflinePlayer.java

示例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);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:11,代码来源:MixinEntityPlayerMP.java

示例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);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:11,代码来源:MixinEntityPlayerMP.java

示例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)));
    }
}
 
开发者ID:toddharrison,项目名称:PlayerState,代码行数:12,代码来源:PlayerStateManager.java

示例7: hasAchievement

import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public boolean hasAchievement(Achievement achievement) {
    return this.statsFile.hasAchievementUnlocked((net.minecraft.stats.Achievement) achievement);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneCommon,代码行数:5,代码来源:MixinEntityPlayerMP.java

示例8: hasAchievement

import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public boolean hasAchievement(Achievement achievement) {
    return this.statisticsFile.hasAchievementUnlocked((net.minecraft.stats.Achievement) achievement);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:5,代码来源:NeptuneOfflinePlayer.java

示例9: removeAchievement

import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public void removeAchievement(Achievement achievement) {

}
 
开发者ID:NeptunePowered,项目名称:NeptuneCommon,代码行数:5,代码来源:MixinEntityPlayerMP.java

示例10: awardAchievement

import net.canarymod.api.statistics.Achievement; //导入依赖的package包/类
@Override
public void awardAchievement(Achievement achievement) {

}
 
开发者ID:NeptunePowered,项目名称:NeptuneCommon,代码行数:5,代码来源:MixinEntityPlayerMP.java


注:本文中的net.canarymod.api.statistics.Achievement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。