Clans API - Simonsator/BungeecordPartyAndFriends GitHub Wiki

Add Clans As A Dependency For Your Plugin

Add this line into your plugin.yml: depends: [Clans]

Add SubCommands

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)

Add clan stats

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);

Getting A Clan Object

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");
	}
}

JavaDoc

The JavaDoc for clans can beh found here