use of com.griefdefender.hooks.config.ClanConfig in project GDHooks by bloodmc.
the class CommandClanTrustRank method execute.
@CommandCompletion("@gdclanranks @gdtrusttypes @gddummy")
@CommandAlias("clantrustrank")
@Description("%clan-trust-rank")
@Syntax("<rank> <accessor|builder|container|manager|resident>")
@Subcommand("clan trust rank")
public void execute(Player player, String rank, String type) {
final Audience audience = GriefDefender.getAudienceProvider().getSender(player);
TrustType trustType = HooksUtil.getTrustType(type);
if (trustType == null) {
audience.sendMessage(MessageConfig.MESSAGE_DATA.getMessage(MessageConfig.TRUST_INVALID));
return;
}
final ClanPlayer clanPlayer = GDHooks.getInstance().getClanProvider().getClanPlayer(player.getUniqueId());
if (clanPlayer == null) {
return;
}
final Clan clan = clanPlayer.getClan();
if (clan == null) {
return;
}
if (!clanPlayer.isLeader()) {
return;
}
final ClanConfig clanConfig = GDHooks.getInstance().getClanConfigMap().get(clan.getTag());
if (clanConfig == null) {
return;
}
clanConfig.getData().addRankTrust(rank, trustType);
clanConfig.save();
final Component message = MessageConfig.MESSAGE_DATA.getMessage(MessageConfig.CLAN_TRUST_RANK, ImmutableMap.of("rank", rank, "type", trustType.getName()));
audience.sendMessage(message);
}
use of com.griefdefender.hooks.config.ClanConfig in project GDHooks by bloodmc.
the class GuildsClanProvider method addClan.
public void addClan(Guild clan) {
this.getClanMap().put(clan.getPrefix(), new GDClan(clan));
final Path clanConfigPath = CLAN_DATA_PATH.resolve(clan.getPrefix() + ".conf");
if (!clanConfigPath.toFile().exists()) {
final ClanConfig clanConfig = new ClanConfig(clanConfigPath);
GDHooks.getInstance().getClanConfigMap().put(clan.getPrefix(), clanConfig);
}
}
use of com.griefdefender.hooks.config.ClanConfig in project GDHooks by bloodmc.
the class CommandClanUntrustRank method execute.
@CommandCompletion("@gdclanranks @gdtrusttypes @gddummy")
@CommandAlias("clanuntrustrank")
@Description("%clan-untrust-rank")
@Syntax("<rank>")
@Subcommand("clan untrust rank")
public void execute(Player player, String rank) {
final Audience audience = GriefDefender.getAudienceProvider().getSender(player);
final ClanPlayer clanPlayer = GDHooks.getInstance().getClanProvider().getClanPlayer(player.getUniqueId());
if (clanPlayer == null) {
return;
}
final Clan clan = clanPlayer.getClan();
if (clan == null) {
return;
}
if (!clanPlayer.isLeader()) {
return;
}
final ClanConfig clanConfig = GDHooks.getInstance().getClanConfigMap().get(clan.getTag());
if (clanConfig == null) {
return;
}
final TrustType trustType = clanConfig.getData().getRankTrust(rank);
clanConfig.getData().deleteRankTrust(rank);
clanConfig.save();
final Component message = MessageConfig.MESSAGE_DATA.getMessage(MessageConfig.CLAN_UNTRUST_RANK, ImmutableMap.of("rank", rank, "type", trustType.getName()));
audience.sendMessage(message);
}
use of com.griefdefender.hooks.config.ClanConfig in project GDHooks by bloodmc.
the class SimpleClanProvider method addClan.
public void addClan(net.sacredlabyrinth.phaed.simpleclans.Clan clan) {
this.clanMap.put(clan.getTag(), new GDClan(clan));
final Path clanConfigPath = CLAN_DATA_PATH.resolve(clan.getTag() + ".conf");
if (!clanConfigPath.toFile().exists()) {
final ClanConfig clanConfig = new ClanConfig(clanConfigPath);
GDHooks.getInstance().getClanConfigMap().put(clan.getTag(), clanConfig);
}
}
use of com.griefdefender.hooks.config.ClanConfig in project GDHooks by bloodmc.
the class UClansProvider method addClan.
public void addClan(me.ulrich.clans.data.ClanData clan) {
this.getClanMap().put(clan.getTag(), new GDClan(clan));
final Path clanConfigPath = CLAN_DATA_PATH.resolve(clan.getTag() + ".conf");
if (!clanConfigPath.toFile().exists()) {
final ClanConfig clanConfig = new ClanConfig(clanConfigPath);
GDHooks.getInstance().getClanConfigMap().put(clan.getTag(), clanConfig);
}
}
Aggregations