API
API
As usual, make sure to import the class, wherever you're going to be using CommandRank:
import me.black_ixx.commandRank.api.CommandRankAPI;
In your plugin.yml, make sure to add your dependency on CommandRank.
Either:
- depend: [CommandRank]
Or:
- softdepend: [CommandRank]
And during enable, make sure to check that CommandRank is enabled as well:
private boolean commandRankEnable() { final Plugin commandRankPlugin = this.getServer().getPluginManager().getPlugin("CommandRank"); if (commandRankPlugin != null) { return true; } return false; }
If its not enabled, you're going to have to handle that situation accordingly.
Now you can work with the API.
CommandRankAPI.RankUpDefault(player);
allows you to execute the default RankUp with player. The same method is used for the KillListener or SignRankUp.
CommandRankAPI.RankUpOther(player, group);
allows you to execute another RankUp to a specific group.
Comments