Skip to content

Instantly share code, notes, and snippets.

@brcdev
Last active May 29, 2017 19:12
Show Gist options
  • Save brcdev/33e617e55638f1496d33908428d83f98 to your computer and use it in GitHub Desktop.
Save brcdev/33e617e55638f1496d33908428d83f98 to your computer and use it in GitHub Desktop.
package net.brcdev.gangs;
import net.brcdev.gangs.gang.Gang;
import org.bukkit.entity.Player;
import java.util.List;
public class GangsPlusApi {
/**
* Gets all gangs present on the server
*
* @return list of all gangs
*/
public static List<Gang> getAllGangs() {
return GangsPlugin.getInstance().gangManager.getAllGangs();
}
/**
* Checks if specified player is in a gang
*
* @param player Player to check
* @return whether player is in a gang
*/
public static boolean isInGang(Player player) {
return GangsPlugin.getInstance().gangManager.isInGang(player);
}
/**
* Gets specified player's gang
*
* @param player Player to check
* @return player's gang when in one, null otherwise
*/
public static Gang getPlayersGang(Player player) {
return GangsPlugin.getInstance().gangManager.getPlayersGang(player);
}
/**
* Checks if specified player is using the gang chat
*
* @param player Player to check
* @return whether player is using the gang chat
*/
public static boolean isUsingGangChat(Player player) {
return GangsPlugin.getInstance().playerManager.isPlayerLoaded(player) && GangsPlugin.getInstance().playerManager
.getPlayerData(player).isUsingGangChat();
}
/**
* Checks if specified player is using the ally chat
*
* @param player Player to check
* @return whether player is using the gang chat
*/
public static boolean isUsingAllyChat(Player player) {
return GangsPlugin.getInstance().playerManager.isPlayerLoaded(player) && GangsPlugin.getInstance().playerManager
.getPlayerData(player).isUsingAllyChat();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment