In order to properly use SimplePortals you will need to be able to retrieve the plugin's instance. You can do this by following these instructions:
import org.bukkit.plugin.java.JavaPlugin;
import xzot1k.plugins.sp.SimplePortals;
public class Main extends JavaPlugin {
private SimplePortals simplePortals;
@Override
public void onEnable() {
if (!isSimplePortalsInstalled()) {
getServer().getPluginManager().disablePlugin(this); // disable plugin since SimplePortals is NOT installed.
return;
}
// SimplePortals was found and now can be accessed with the getSimplePortals() getter.
}
// This method tells you whether SimplePortals is installed or not.
private boolean isSimplePortalsInstalled() {
if (getServer().getPluginManager().getPlugin("SimplePortals") != null) {
this.simplePortals = SimplePortals.getPluginInstance();
return true;
}
return false;
}
public SimplePortals getSimplePortals() { return simplePortals; }
}