本文整理汇总了Java中org.bukkit.advancement.AdvancementProgress类的典型用法代码示例。如果您正苦于以下问题:Java AdvancementProgress类的具体用法?Java AdvancementProgress怎么用?Java AdvancementProgress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AdvancementProgress类属于org.bukkit.advancement包,在下文中一共展示了AdvancementProgress类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: awardAdvancements
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
/**
* Awards advancements created by Advanced Achievements. This method can be seen as a synchronisation to give
* advancements which were generated after the corresponding achievement was received for a given player.
*
* @param player
*/
private void awardAdvancements(Player player) {
Advancement advancement = Bukkit.getServer()
.getAdvancement(new NamespacedKey(plugin, AdvancementManager.ADVANCED_ACHIEVEMENTS_PARENT));
// If no parent, user has not used /aach generate, do not do anything.
if (advancement != null) {
AdvancementProgress advancementProgress = player.getAdvancementProgress(advancement);
if (!advancementProgress.isDone()) {
advancementProgress.awardCriteria(AchievementAdvancement.CRITERIA_NAME);
}
for (String achName : plugin.getDatabaseManager().getPlayerAchievementNamesList(player.getUniqueId())) {
advancement = Bukkit.getServer()
.getAdvancement(new NamespacedKey(plugin, AdvancementManager.getKey(achName)));
// Matching advancement might not exist if user has not called /aach generate.
if (advancement != null) {
advancementProgress = player.getAdvancementProgress(advancement);
if (!advancementProgress.isDone()) {
advancementProgress.awardCriteria(AchievementAdvancement.CRITERIA_NAME);
}
}
}
}
}
示例2: getAdvancementProgress
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
@Override
public AdvancementProgress getAdvancementProgress(Advancement advancement) {
return implementation.getAdvancementProgress(advancement);
}
示例3: getAdvancementProgress
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
@Override
public AdvancementProgress getAdvancementProgress(Advancement advancement)
{
// TODO Auto-generated method stub
throw new UnimplementedOperationException();
}
示例4: getAdvancements
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
/**
* Return the number of advancements the player has completed.
* @param player
* @return count
*/
private static int getAdvancements(Player player) {
List<Advancement> advancements = new ArrayList<>();
Bukkit.advancementIterator().forEachRemaining(advancements::add);
return (int) advancements.stream().map(player::getAdvancementProgress).filter(AdvancementProgress::isDone).count();
}
示例5: getAdvancementProgress
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
@Override
public AdvancementProgress getAdvancementProgress( Advancement advancement ) {
return null;
}
示例6: getAdvancementProgress
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
@Override
public AdvancementProgress getAdvancementProgress(Advancement advancement) {
return player.getAdvancementProgress(advancement);
}
示例7: getAdvancementProgress
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
@Override
public AdvancementProgress getAdvancementProgress(Advancement advancement) {
return null;
}
示例8: getAdvancementProgress
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
@Override
public AdvancementProgress getAdvancementProgress(Advancement arg0) {
return null;
}
示例9: getAdvancementProgress
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
@Override
public AdvancementProgress getAdvancementProgress(Advancement advancement) {
throw Pokkit.unsupported();
}
示例10: getAdvancementProgress
import org.bukkit.advancement.AdvancementProgress; //导入依赖的package包/类
@Override
public AdvancementProgress getAdvancementProgress(Advancement arg0) {
throw new UnsupportedOperationException();
}