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


Java Expression类代码示例

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


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

示例1: init

import ch.njol.skript.lang.Expression; //导入依赖的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;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:23,代码来源:ExprCustomPotionItem.java

示例2: init

import ch.njol.skript.lang.Expression; //导入依赖的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;
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:27,代码来源:ExprExpression.java

示例3: init

import ch.njol.skript.lang.Expression; //导入依赖的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);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:20,代码来源:EffContinue.java

示例4: init

import ch.njol.skript.lang.Expression; //导入依赖的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);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:21,代码来源:ExprMembers.java

示例5: init

import ch.njol.skript.lang.Expression; //导入依赖的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;
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:17,代码来源:EffImport.java

示例6: init

import ch.njol.skript.lang.Expression; //导入依赖的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;
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:20,代码来源:ExprTry.java

示例7: init

import ch.njol.skript.lang.Expression; //导入依赖的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);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:18,代码来源:ExprMemberNames.java

示例8: get

import ch.njol.skript.lang.Expression; //导入依赖的package包/类
@Override
protected Expression[] get(Event e) {
  Expression<?> expr = this.expr;
  if (expr instanceof ExprExpression && e instanceof CustomSyntaxEvent) {
    expr = ((ExprExpression) expr).getExpression(e).getSource();
  }
  return new Expression[]{expr};
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:9,代码来源:ExprRawExpression.java

示例9: init

import ch.njol.skript.lang.Expression; //导入依赖的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 parser mark may only be used in custom syntax.",
        ErrorQuality.SEMANTIC_ERROR);
  }
  return true;
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:16,代码来源:ExprParseMark.java

示例10: init

import ch.njol.skript.lang.Expression; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed,
                    SkriptParser.ParseResult parseResult) {
  if (!ScriptLoader.isCurrentEvent(CustomExpression.ExpressionChangeEvent.class)) {
    Skript.error("The change mode may only be used in change handlers.",
        ErrorQuality.SEMANTIC_ERROR);
  }
  return true;
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:10,代码来源:ExprChangeMode.java

示例11: init

import ch.njol.skript.lang.Expression; //导入依赖的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;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:11,代码来源:SExprReference.java

示例12: init

import ch.njol.skript.lang.Expression; //导入依赖的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;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:11,代码来源:ExprCustomPotionEffect.java

示例13: init

import ch.njol.skript.lang.Expression; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
    if (!ScriptLoader.isCurrentEvent(PlaceholderAPIEvent.class)) {
        Skript.error("The PlaceholderAPI identifier can only be used in a placeholder request event", ErrorQuality.SEMANTIC_ERROR);
        return false;
    }
    return true;
}
 
开发者ID:Pikachu920,项目名称:Ersatz,代码行数:9,代码来源:ExprIdentifier.java

示例14: init

import ch.njol.skript.lang.Expression; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
    if (!ScriptLoader.isCurrentEvent(PlaceholderAPIEvent.class)) {
        Skript.error("The PlaceholderAPI prefix can only be used in a placeholder request event", ErrorQuality.SEMANTIC_ERROR);
        return false;
    }
    return true;
}
 
开发者ID:Pikachu920,项目名称:Ersatz,代码行数:9,代码来源:ExprPrefix.java

示例15: init

import ch.njol.skript.lang.Expression; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {
    if (!ScriptLoader.isCurrentEvent(PlaceholderAPIEvent.class)) {
        Skript.error("The PlaceholderAPI result can only be used in a placeholder request event", ErrorQuality.SEMANTIC_ERROR);
        return false;
    }
    return true;
}
 
开发者ID:Pikachu920,项目名称:Ersatz,代码行数:9,代码来源:ExprResult.java


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