本文整理汇总了Java中ch.njol.util.Kleenean类的典型用法代码示例。如果您正苦于以下问题:Java Kleenean类的具体用法?Java Kleenean怎么用?Java Kleenean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Kleenean类属于ch.njol.util包,在下文中一共展示了Kleenean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expr, int i, Kleenean kleenean, @NotNull SkriptParser.ParseResult parseResult) {
switch (parseResult.mark) {
case 0:
material = Material.POTION;
break;
case 1:
material = Material.SPLASH_POTION;
break;
case 2:
material = Material.LINGERING_POTION;
break;
case 3:
material = Material.TIPPED_ARROW;
break;
default:
material = Material.POTION;
break;
}
potionEffects = (Expression<PotionEffect>) expr[0];
return true;
}
示例2: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
VariableString s = VariableString.newInstance(parseResult.regexes.get(0).group(), StringMode.VARIABLE_NAME);
if (s == null) {
Skript.error("Invalid reference naming. A reference should be named like a variable");
return false;
}
variableName = s;
Expression<?> v = expressions[0];
if (v instanceof UnparsedLiteral) {
Skript.error("Unknown expression : " + ((UnparsedLiteral) v).getData());
return false;
}
value = v;
return true;
}
示例3: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
SkriptParser.ParseResult parseResult) {
target = Util.defendExpression(exprs[0]);
switch (parseResult.mark) {
case 0:
mapper = Util::fields;
break;
case 1:
mapper = Util::methods;
break;
case 2:
mapper = Util::constructor;
break;
}
return Util.canInitSafely(target);
}
示例4: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
SkriptParser.ParseResult parseResult) {
className = (Expression<String>) exprs[0];
if (exprs[1] != null) {
if (!(exprs[1] instanceof Variable)) {
return false;
}
var = (Variable) exprs[1];
}
return true;
}
示例5: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
SkriptParser.ParseResult parseResult) {
expr = Util.defendExpression(exprs[0]);
if (!Util.canInitSafely(expr)) {
return false;
}
if (!(expr instanceof ExprJavaCall)) {
Skript.error("Try may only be used with Java calls");
return false;
}
((ExprJavaCall) expr).setSuppressErrors(true);
return true;
}
示例6: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
SkriptParser.ParseResult parseResult) {
target = Util.defendExpression(exprs[0]);
switch (parseResult.mark) {
case 0:
mapper = Util::fields;
break;
case 1:
mapper = Util::methods;
break;
}
return Util.canInitSafely(target);
}
示例7: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
SkriptParser.ParseResult parseResult) {
if (!ScriptLoader.isCurrentEvent(
CustomEffect.EffectEvent.class,
CustomExpression.ExpressionGetEvent.class,
CustomExpression.ExpressionChangeEvent.class,
CustomCondition.ConditionEvent.class
)) {
Skript.error("The expression 'expression' may only be used in a custom syntax.",
ErrorQuality.SEMANTIC_ERROR);
return false;
}
index = Utils.parseInt(parseResult.regexes.get(0).group(1));
if (index <= 0) {
Skript.error("The expression index must be a natural number.", ErrorQuality.SEMANTIC_ERROR);
return false;
}
index--;
plural = parseResult.mark == 1;
return true;
}
示例8: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
SkriptParser.ParseResult parseResult) {
String pattern = expressions.get(matchedPattern);
which = expressionInfos.get(pattern);
if (which.shouldAdaptArgument()) {
Expression<?> lastExpression = exprs[exprs.length - 1];
System.arraycopy(exprs, 0, exprs, 1, exprs.length - 1);
exprs[0] = lastExpression;
}
this.exprs = Arrays.stream(exprs)
.map(Util::defendExpression)
.toArray(Expression[]::new);
this.parseResult = parseResult;
return Util.canInitSafely(this.exprs);
}
示例9: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
SkriptParser.ParseResult parseResult) {
if (!ScriptLoader.isCurrentEvent(
CustomEffect.EffectEvent.class,
CustomExpression.ExpressionGetEvent.class,
CustomExpression.ExpressionChangeEvent.class,
CustomCondition.ConditionEvent.class
)) {
Skript.error("Only custom syntax may be continued.", ErrorQuality.SEMANTIC_ERROR);
return false;
}
objects = Util.defendExpression(exprs[0]);
return Util.canInitSafely(objects);
}
示例10: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
SkriptParser.ParseResult parseResult) {
if (!ScriptLoader.isCurrentEvent(CustomExpression.ExpressionChangeEvent.class)) {
Skript.error("The change value may only be used in a change handlers.",
ErrorQuality.SEMANTIC_ERROR);
return false;
}
plural = parseResult.mark == 1;
return true;
}
示例11: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
a = (Expression<Number>) expressions[0];
b = (Expression<Number>) expressions[1];
return true;
}
示例12: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expr, int i, Kleenean kleenean, @NotNull SkriptParser.ParseResult parseResult) {
entity = (Expression<LivingEntity>) expr[0];
type = (Expression<PotionEffectType>) expr[1];
setNegated(parseResult.mark == 1);
return true;
}
示例13: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expr, int i, Kleenean kleenean, @NotNull SkriptParser.ParseResult parseResult) {
mat = parseResult.mark == 0 ? Material.BANNER : Material.SHIELD;
patterns = (Expression<Pattern>) expr[0];
color = (Expression<Color>) expr[1];
return true;
}
示例14: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
VariableString v = VariableString.newInstance(parseResult.regexes.get(0).group(), StringMode.VARIABLE_NAME);
if (v == null) {
Skript.error("Invalid reference name.");
return false;
}
variableName = v;
return true;
}
示例15: init
import ch.njol.util.Kleenean; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expr, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
type = (Expression<PotionEffectType>) expr[0];
duration = (Expression<Timespan>) expr[1];
level = (Expression<Number>) expr[2];
particles = (Expression<Boolean>) expr[3];
ambient = (Expression<Boolean>) expr[4];
color = (Expression<Color>) expr[5];
return true;
}