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


Java Skript.info方法代码示例

本文整理汇总了Java中ch.njol.skript.Skript.info方法的典型用法代码示例。如果您正苦于以下问题:Java Skript.info方法的具体用法?Java Skript.info怎么用?Java Skript.info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.njol.skript.Skript的用法示例。


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

示例1: contains

import ch.njol.skript.Skript; //导入方法依赖的package包/类
public static Pair<Boolean, String[]> contains(String className, String... patterns){
	
	if(disabledClassNames.contains(className)){
		if(debug)
			Skript.info("Disabling feature " + className + " through the Features.sk config.");
		return new Pair<Boolean, String[]>(true, patterns);
	}
	if(patterns != null){
		for(int i = 0 ; i < patterns.length ; i++){
			if(alteredPatterns.containsKey(patterns[i])){
				if(debug)
					Skript.info("Altering the pattern" + patterns[i] + " to " + alteredPatterns.get(patterns[i]) + ".");
				patterns[i] = alteredPatterns.get(patterns[i]);
				return new Pair<Boolean, String[]>(false, patterns);
			}
			if(disabledPatterns.contains(patterns[i])){
				if(debug)
					Skript.info("Disabling the feature " + className + " which had the exact pattern: " + patterns[i] + ".");
				return new Pair<Boolean, String[]>(true, patterns);
			}
		}
	}
	return new Pair<Boolean, String[]>(false, patterns);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:25,代码来源:FeatureConfigLol.java

示例2: Hook

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@SuppressWarnings("null")
public Hook() throws IOException {
	@SuppressWarnings("unchecked")
	final P p = (P) Bukkit.getPluginManager().getPlugin(getName());
	plugin = p;
	if (p == null)
		return;
	if (!init()) {
		Skript.error(m_hook_error.toString(p.getName()));
		return;
	}
	loadClasses();
	if (Skript.logHigh())
		Skript.info(m_hooked.toString(p.getName()));
	return;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:17,代码来源:Hook.java

示例3: visitFile

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
  if (MATCHER.matches(file)) {
    Skript.info("Loaded external library " + file.getFileName());
    urls.add(file.toUri().toURL());
  }
  return super.visitFile(file, attrs);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:9,代码来源:LibraryLoader.java

示例4: Config

import ch.njol.skript.Skript; //导入方法依赖的package包/类
public Config(final InputStream source, final String fileName, final boolean simple, final boolean allowEmptySections, final String defaultSeparator) throws IOException {
	try {
		this.fileName = fileName;
		this.simple = simple;
		this.allowEmptySections = allowEmptySections;
		this.defaultSeparator = defaultSeparator;
		separator = defaultSeparator;
		
		if (source.available() == 0) {
			main = new SectionNode(this);
			Skript.warning("'" + getFileName() + "' is empty");
			return;
		}
		
		if (Skript.logVeryHigh())
			Skript.info("loading '" + fileName + "'");
		
		final ConfigReader r = new ConfigReader(source);
		try {
			main = SectionNode.load(this, r);
		} finally {
			r.close();
		}
	} finally {
		source.close();
	}
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:28,代码来源:Config.java

示例5: execute

import ch.njol.skript.Skript; //导入方法依赖的package包/类
@SuppressWarnings("resource")
@Override
protected void execute(final Event e) {
	for (final String message : messages.getArray(e)) {
		if (files != null) {
			for (String s : files.getArray(e)) {
				s = s.toLowerCase();
				if (!s.endsWith(".log"))
					s += ".log";
				if (s.equals("server.log")) {
					SkriptLogger.LOGGER.log(Level.INFO, message);
					continue;
				}
				PrintWriter w = writers.get(s);
				if (w == null) {
					final File f = new File(logsFolder, s); // REMIND what if s contains '..'?
					try {
						f.getParentFile().mkdirs();
						w = new PrintWriter(new BufferedWriter(new FileWriter(f, true)));
						writers.put(s, w);
					} catch (final IOException ex) {
						Skript.error("Cannot write to log file '" + s + "' (" + f.getPath() + "): " + ExceptionUtils.toString(ex));
						return;
					}
				}
				w.println("[" + SkriptConfig.formatDate(System.currentTimeMillis()) + "] " + message);
				w.flush();
			}
		} else {
			final Trigger t = getTrigger();
			final File script = t == null ? null : t.getScript();
			Skript.info("[" + (script != null ? script.getName() : "---") + "] " + message);
		}
	}
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:36,代码来源:EffLog.java

示例6: execute2

import ch.njol.skript.Skript; //导入方法依赖的package包/类
boolean execute2(final CommandSender sender, final String commandLabel, final String rest) {
	final ScriptCommandEvent event = new ScriptCommandEvent(ScriptCommand.this, sender);
	
	final ParseLogHandler log = SkriptLogger.startParseLogHandler();
	try {
		final boolean ok = SkriptParser.parseArguments(rest, ScriptCommand.this, event);
		if (!ok) {
			final LogEntry e = log.getError();
			if (e != null)
				sender.sendMessage(ChatColor.DARK_RED + e.getMessage());
			sender.sendMessage(Commands.m_correct_usage + " " + usage);
			log.clear();
			log.printLog();
			return false;
		}
		log.clear();
		log.printLog();
	} finally {
		log.stop();
	}
	
	if (Skript.log(Verbosity.VERY_HIGH))
		Skript.info("# /" + name + " " + rest);
	final long startTrigger = System.nanoTime();
	
	if (!trigger.execute(event))
		sender.sendMessage(Commands.m_internal_error.toString());
	
	if (Skript.log(Verbosity.VERY_HIGH))
		Skript.info("# " + name + " took " + 1. * (System.nanoTime() - startTrigger) / 1000000. + " milliseconds");
	return true;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:33,代码来源:ScriptCommand.java

示例7: onSuccess

import ch.njol.skript.Skript; //导入方法依赖的package包/类
protected void onSuccess() {
	if (success != null)
		Skript.info(success);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:5,代码来源:ErrorDescLogHandler.java


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