• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SkriptParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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.SkriptParser; //导入依赖的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


示例3: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例4: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例5: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例6: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例7: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Literal<?>[] args, int matchedPattern,
                    SkriptParser.ParseResult parseResult) {
  isChanger = (parseResult.mark & 1) == 1;

  String what = parseResult.regexes.get(0).group();
  switch (matchedPattern) {
    case 0:
      whiches.add(createSyntaxInfo(what, (parseResult.mark & 2) == 2, false));
      break;
    case 1:
      String fromType = ((Literal<ClassInfo>) args[0]).getSingle().getCodeName();
      whiches.add(createSyntaxInfo("[the] " + what + " of %$" + fromType + "s%", false, true));
      whiches.add(createSyntaxInfo("%$" + fromType + "s%'[s] " + what, false, false));
      break;
  }

  return true;
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:21,代码来源:CustomExpression.java


示例8: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean init(Literal<?>[] args, int matchedPattern,
                    SkriptParser.ParseResult parseResult) {
  String c = parseResult.regexes.get(0).group();
  switch (matchedPattern) {
    case 0:
      whiches.add(createSyntaxInfo(c, false));
      break;
    case 1:
      String type = ((Literal<ClassInfo>) args[0]).getSingle().getCodeName();
      whiches.add(createSyntaxInfo("%" + type + "% (is|are) " + c, false));
      whiches.add(createSyntaxInfo("%" + type + "% (isn't|is not|aren't|are not) " + c, true));
      break;
  }

  return true;
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:19,代码来源:CustomCondition.java


示例9: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例10: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
    if (i == 0) {
        xExpr = (Expression<Number>) expressions[0];
        yExpr = (Expression<Number>) expressions[1];
        zExpr = (Expression<Number>) expressions[2];
        chunkExpression = (Expression<Chunk>) expressions[3];
    } else {
        int mark = parseResult.mark;
        yExpr = (Expression<Number>) expressions[0];
        level = mark % 4;
        south = (mark & NS) == 0;
        east = (mark & EW) == 0;
        center = (mark & CORCEN) == 0;
        chunkExpression = (Expression<Chunk>) expressions[1];
    }
    return true;
}
 
开发者ID:MundoSK,项目名称:MundoSK,代码行数:19,代码来源:ExprChunkBlock.java


示例11: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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;
}
 
开发者ID:ResultLuna,项目名称:skMath,代码行数:8,代码来源:ExprModulus.java


示例12: init

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


示例13: init

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


示例14: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例15: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例16: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
	if (!ScriptLoader.isCurrentEvent(PotionSplashEvent.class)) {
		Skript.error(
			"The 'affected entities' expression can only be used in potion splash events",
			ErrorQuality.SEMANTIC_ERROR
		);
		return false;
	}
	return true;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:12,代码来源:ExprPotionSplashAffectedEntities.java


示例17: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的package包/类
@Override
public boolean init(Expression<?>[] expr, int i, Kleenean kleenean, @NotNull SkriptParser.ParseResult parseResult) {
	isToward = parseResult.mark == 0;
	entity = (Expression<Entity>) expr[0];
	towards = (Expression<Location>) expr[1];
	return true;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:8,代码来源:EffOrientTowards.java


示例18: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例19: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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


示例20: init

import ch.njol.skript.lang.SkriptParser; //导入依赖的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.SkriptParser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java KeyChainAliasCallback类代码示例发布时间:2022-05-21
下一篇:
Java KeyResolverSpi类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap