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


Java Criterion类代码示例

本文整理汇总了Java中org.spongepowered.api.scoreboard.critieria.Criterion的典型用法代码示例。如果您正苦于以下问题:Java Criterion类的具体用法?Java Criterion怎么用?Java Criterion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Criterion类属于org.spongepowered.api.scoreboard.critieria包,在下文中一共展示了Criterion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerNewObjective

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
@Override
public org.bukkit.scoreboard.Objective registerNewObjective(String name, String criteria)
        throws IllegalArgumentException {
    checkArgument(name != null, "Name must not be null");
    Objective.Builder builder = Objective.builder();
    //noinspection ConstantConditions
    builder.name(name);
    if (criteria != null) {
        //TODO: no idea whether this is right
        Optional<Criterion> criterion = Pore.getGame().getRegistry().getType(Criterion.class, criteria);
        if (criterion.isPresent()) {
            builder.criterion(criterion.get());
        }
    }
    return PoreObjective.of(builder.build());
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:17,代码来源:PoreScoreboard.java

示例2: ScoreType

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public ScoreType(String name, EverAPI plugin, Criterion criterion, ObjectiveDisplayMode display) {
	super(name);
	this.plugin = plugin;
	this.objectives = new CopyOnWriteArrayList<IObjective>();
	
	this.criterion = Optional.ofNullable(criterion);
	this.display = display;
	
	this.plugin.getGame().getEventManager().registerListeners(this.plugin, this);
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:11,代码来源:ScoreType.java

示例3: LanternStatistic

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public LanternStatistic(String pluginId, String id, String name, Translation translation,
        String internalId, NumberFormat format, @Nullable Criterion criterion, StatisticType type) {
    super(pluginId, id, name, translation);
    this.internalId = internalId;
    this.criterion = criterion;
    this.format = format;
    this.type = type;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:LanternStatistic.java

示例4: LanternObjective

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
LanternObjective(String name, Criterion criterion, ObjectiveDisplayMode displayMode, Text displayName) {
    this.legacyDisplayName = LanternTexts.toLegacy(displayName);
    this.displayName = displayName;
    this.displayMode = displayMode;
    this.criterion = criterion;
    this.name = name;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:8,代码来源:LanternObjective.java

示例5: getObjectivesByCriteria

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
@Override
public Set<org.bukkit.scoreboard.Objective> getObjectivesByCriteria(String criteria)
        throws IllegalArgumentException {
    checkArgument(criteria != null, "Criterion must not be null");
    //TODO: no idea whether this is right
    Optional<Criterion> c = Pore.getGame().getRegistry().getType(Criterion.class, criteria);
    checkArgument(c.isPresent(), "Invalid criterion");
    return Sets.newHashSet(Collections2.transform(getHandle().getObjectivesByCriteria(c.get()),
            PoreObjective::of
    ));
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:12,代码来源:PoreScoreboard.java

示例6: getCriterion

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public Optional<Criterion> getCriterion() {
	return this.criterion;
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:4,代码来源:ScoreType.java

示例7: ScoreHealth

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public ScoreHealth(String name, EverAPI plugin, Criterion health) {
	super(name, plugin, health, ObjectiveDisplayModes.INTEGER);
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:4,代码来源:ScoreHealth.java

示例8: LanternBlockStatistic

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public LanternBlockStatistic(String pluginId, String id, String name, Translation translation, String internalId,
        NumberFormat format, @Nullable Criterion criterion, StatisticType type, BlockType blockType) {
    super(pluginId, id, name, translation, internalId, format, criterion, type);
    this.blockType = blockType;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:6,代码来源:LanternBlockStatistic.java

示例9: getCriterion

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
@Override
public Optional<Criterion> getCriterion() {
    return Optional.ofNullable(this.criterion);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:LanternStatistic.java

示例10: LanternItemStatistic

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public LanternItemStatistic(String pluginId, String id, String name, Translation translation, String internalId, NumberFormat format,
        @Nullable Criterion criterion, StatisticType type, ItemType itemType) {
    super(pluginId, id, name, translation, internalId, format, criterion, type);
    this.itemType = itemType;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:6,代码来源:LanternItemStatistic.java

示例11: LanternEntityStatistic

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public LanternEntityStatistic(String pluginId, String id, String name, Translation translation, String internalId, NumberFormat format,
        @Nullable Criterion criterion, StatisticType type, EntityType entityType) {
    super(pluginId, id, name, translation, internalId, format, criterion, type);
    this.entityType = entityType;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:6,代码来源:LanternEntityStatistic.java

示例12: build

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
@Override
protected ItemStatistic build(String pluginId, String id, String name, Translation translation, StatisticType type, NumberFormat format,
        String internalId, @Nullable Criterion criterion) {
    checkState(this.itemType != null, "The itemType must be set");
    return new LanternItemStatistic(pluginId, id, name, translation, internalId, format, criterion, type, this.itemType);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:7,代码来源:LanternItemStatisticBuilder.java

示例13: build

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
protected abstract T build(String pluginId, String id, String name, Translation translation,
StatisticType type, NumberFormat format, String internalId, @Nullable Criterion criterion);
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:3,代码来源:AbstractStatisticBuilder.java

示例14: build

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
@Override
protected BlockStatistic build(String pluginId, String id, String name, Translation translation, StatisticType type, NumberFormat format,
        String internalId, @Nullable Criterion criterion) {
    checkState(this.blockType != null, "The blockType must be set");
    return new LanternBlockStatistic(pluginId, id, name, translation, internalId, format, criterion, type, this.blockType);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:7,代码来源:LanternBlockStatisticBuilder.java

示例15: build

import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
@Override
protected EntityStatistic build(String pluginId, String id, String name, Translation translation, StatisticType type, NumberFormat format,
        String internalId, @Nullable Criterion criterion) {
    checkState(this.entityType != null, "The entityType must be set");
    return new LanternEntityStatistic(pluginId, id, name, translation, internalId, format, criterion, type, this.entityType);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:7,代码来源:LanternEntityStatisticBuilder.java


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