本文整理汇总了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());
}
示例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);
}
示例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;
}
示例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;
}
示例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
));
}
示例6: getCriterion
import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public Optional<Criterion> getCriterion() {
return this.criterion;
}
示例7: ScoreHealth
import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
public ScoreHealth(String name, EverAPI plugin, Criterion health) {
super(name, plugin, health, ObjectiveDisplayModes.INTEGER);
}
示例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;
}
示例9: getCriterion
import org.spongepowered.api.scoreboard.critieria.Criterion; //导入依赖的package包/类
@Override
public Optional<Criterion> getCriterion() {
return Optional.ofNullable(this.criterion);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
示例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);
}
示例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);
}