Skip to content
Marcin Wieczorek edited this page Apr 22, 2017 · 5 revisions

NovaGuilds API

To use our API you have to import NovaGuilds.jar to your project.
For Eclipse: Add External Libraries
For Intellij: Project Structure → Libraries

You will also need to add dependency for NovaGuilds in your plugin.yml
depend: [NovaGuilds]

Getting a NovaGuilds instance:

public NovaGuilds getNovaGuilds() {
	Plugin plugin = getServer().getPluginManager().getPlugin("NovaGuilds");

	if (plugin == null || !(plugin instanceof NovaGuilds)) {
		return null;
	}

	return (NovaGuilds) plugin;
}

You can also use:

NovaGuilds.getInstance()

Checking if player can build

You can check if a player can build at specified location. This checks his guild and bypass mode.

NovaGuilds novaGuilds = getNovaGuilds();

boolean canbuild = novaGuilds.getRegionManager().canBuild(Player, Location);