This commit is contained in:
Driftay 2020-04-13 13:09:15 -04:00
parent 6205bbca9f
commit 7ea81a6c10
2 changed files with 7 additions and 10 deletions

View File

@ -86,24 +86,20 @@ public class CmdAdmin extends FCommand {
FactionsPlugin.instance.getFlogManager().log(targetFaction, FLogType.RANK_EDIT, context.fPlayer.getName(), fyou.getName(), ChatColor.RED + "Admin");
// Inform all players
if(FactionsPlugin.instance.getConfig().getBoolean("faction-leader-broadcast")) {
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
fplayer.msg(TL.COMMAND_ADMIN_PROMOTED,
context.player == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fplayer, true),
fyou.describeTo(fplayer), targetFaction.describeTo(fplayer));
fplayer.msg(TL.COMMAND_ADMIN_PROMOTED, context.player == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fplayer, true), fyou.describeTo(fplayer), targetFaction.describeTo(fplayer));
}
}
});
}
private void setRole(FPlayer fp, Role r) {
FactionsPlugin.getInstance().getServer().getScheduler().runTask(FactionsPlugin.instance, () -> {
fp.setRole(r);
});
FactionsPlugin.getInstance().getServer().getScheduler().runTask(FactionsPlugin.instance, () -> fp.setRole(r));
}
private void promoteNewLeader(Faction f) {
FactionsPlugin.getInstance().getServer().getScheduler().runTask(FactionsPlugin.instance, () -> {
f.promoteNewLeader();
});
FactionsPlugin.getInstance().getServer().getScheduler().runTask(FactionsPlugin.instance, (Runnable) f::promoteNewLeader);
}
public TL getUsageTranslation() {

View File

@ -600,6 +600,7 @@ fwarp-gui:
faction-creation-broadcast: true #Disabling this will not make faction creation broadcasts appear in chat.
faction-disband-broadcast: true #Disabling this will not make faction disband broadcasts appear in chat.
faction-open-broadcast: true #Disabling this will not make faction open broadcasts appear in chat.
faction-leader-broadcast: true #Disabling this will not make leader changes appear in chat.
############################################################
# +------------------------------------------------------+ #