本文整理汇总了Java中ch.njol.skript.lang.Condition类的典型用法代码示例。如果您正苦于以下问题:Java Condition类的具体用法?Java Condition怎么用?Java Condition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Condition类属于ch.njol.skript.lang包,在下文中一共展示了Condition类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setScope
import ch.njol.skript.lang.Condition; //导入依赖的package包/类
@Override
public void setScope() {
TriggerItem possibleCatch = scope.getNext();
if (possibleCatch instanceof Conditional) {
try {
Condition catchCond = (Condition) CustomScope.condition.get(possibleCatch);
if (catchCond instanceof ScopeCatch) {
this.scopeCatch = (ScopeCatch) catchCond;
} else {
Skript.warning("It is recommended to use a catch statement after a try statement");
}
} catch (IllegalAccessException e) {
Logging.reportException(this, e);
}
} else {
Skript.warning("It is recommended to use a catch statement after a try statement");
}
last.setNext(null);
}
示例2: registerCondition
import ch.njol.skript.lang.Condition; //导入依赖的package包/类
/**
* registers a {@link Condition}.
*
* @param condition The condition's class
* @param patterns Skript patterns to match this condition
*/
@SuppressWarnings("null")
public static <E extends Condition> void registerCondition(final Class<E> condition, final String... patterns) throws IllegalArgumentException {
checkAcceptRegistrations();
Pair<Boolean, String[]> pair = FeatureConfig.contains(condition.getSimpleName(), patterns);
if(pair.getFirst())
return;
final SyntaxElementInfo<E> info = new SyntaxElementInfo<E>(pair.getSecond(), condition);
conditions.add(info);
statements.add(info);
}
示例3: registerCondition
import ch.njol.skript.lang.Condition; //导入依赖的package包/类
/**
* registers a {@link Condition}.
*
* @param condition The condition's class
* @param patterns Skript patterns to match this condition
*/
public static <E extends Condition> void registerCondition(final Class<E> condition, final String... patterns) throws IllegalArgumentException {
checkAcceptRegistrations();
final SyntaxElementInfo<E> info = new SyntaxElementInfo<E>(patterns, condition);
conditions.add(info);
statements.add(info);
}
示例4: getConditions
import ch.njol.skript.lang.Condition; //导入依赖的package包/类
public static Collection<SyntaxElementInfo<? extends Condition>> getConditions() {
return conditions;
}
示例5: register
import ch.njol.skript.lang.Condition; //导入依赖的package包/类
/**
* @param c
* @param property
* @param type must be plural
*/
public static void register(final Class<? extends Condition> c, final String property, final String type) {
Skript.registerCondition(c, "%" + type + "% (is|are) " + property, "%" + type + "% (isn't|is not|aren't|are not) " + property);
}