-
Notifications
You must be signed in to change notification settings - Fork 25
Clans API
Add this line into your plugin.yml: depends: [Clans]
For clan subcommands there is the abstract class ClanSubCommand. You can find it inside the package de.simonsator.partyandfriends.clan.api. Your own command needs to extend this class. The JavaDoc explains how to use the class. You need to register the generated object by ClanManager.getInstance().getClanCommands().addCommand(pCommand: ClanSubCommand)
You can add stats of your minigame to Clans. They will get called when someone uses the command /clan stats. A stat is represented by the class ClanStat. Your stat needs to implement that class. Then you need to register the stat by the following line of code: ((Stats) de.simonsator.partyandfriends.clan.commands.ClanCommands.getInstance().getSubCommand(Stats.class)).registerClanStats(ClanStat pStats, Plugin pPlugin);
package de.simonsator.partyandfriends.clan;
import de.simonsator.partyandfriends.api.pafplayers.OnlinePAFPlayer;
import de.simonsator.partyandfriends.api.pafplayers.PAFPlayerManager;
import de.simonsator.partyandfriends.clan.api.Clan;
import de.simonsator.partyandfriends.clan.api.ClansManager;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class Example {
public void doSomething(ProxiedPlayer pPlayer) {
OnlinePAFPlayer player = PAFPlayerManager.getInstance().getPlayer(pPlayer);
// Getting the clan a player is in
Clan clan = ClansManager.getInstance().getClan(player);
// Getting the clan object for a clan of a given name
clan = ClansManager.getInstance().getClan("TheCoolClan");
}
}
The JavaDoc for clans can beh found here
Still looking for help? Please send me a PM via Spigot (simonsator), the spigot discussion of Party and Friends, discord private chat (Simonsator#5834), my discord server or email ([email protected])
Notice that I just started with this wiki and that it is incomplete.