Java Code Examples for ch.njol.skript.Skript#info()

The following examples show how to use ch.njol.skript.Skript#info() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Hook.java    From Skript with GNU General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example 2
Source File: EvtTestCase.java    From Skript with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean check(Event e) {
	String n = name.getSingle(e);
	if (n == null) {
		return false;
	}
	Skript.info("Running test case " + n);
	TestTracker.testStarted(n);
	return true;
}
 
Example 3
Source File: Config.java    From Skript with GNU General Public License v3.0 5 votes vote down vote up
public Config(final InputStream source, final String fileName, @Nullable final File file, final boolean simple, final boolean allowEmptySections, final String defaultSeparator) throws IOException {
	try {
		this.fileName = fileName;
		if (file != null) // Must check for null before converting to path
			this.file = file.toPath();
		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();
	}
}
 
Example 4
Source File: Aliases.java    From Skript with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Loads aliases from Skript's standard locations.
 * Exceptions will be logged, but not thrown.
 */
public static void load() {
	try {
		long start = System.currentTimeMillis();
		loadInternal();
		Skript.info("Loaded " + provider.getAliasCount() + " aliases in " + (System.currentTimeMillis() - start) + "ms");
	} catch (IOException e) {
		Skript.exception(e);
	}
}
 
Example 5
Source File: ScriptCommand.java    From Skript with GNU General Public License v3.0 5 votes vote down vote up
boolean execute2(final ScriptCommandEvent event, final CommandSender sender, final String commandLabel, final String rest) {
	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(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;
}
 
Example 6
Source File: ErrorDescLogHandler.java    From Skript with GNU General Public License v3.0 4 votes vote down vote up
protected void onSuccess() {
	if (success != null)
		Skript.info(success);
}