本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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();
}
}
示例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);
}
}
}
示例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;
}
示例7: onSuccess
import ch.njol.skript.Skript; //导入方法依赖的package包/类
protected void onSuccess() {
if (success != null)
Skript.info(success);
}