When a faction admin is kicked from his faction for whatever reason (not logging in for too long, a server admin running the /f kick command on him, the player being banned from server), another player will now be promoted to faction admin in his place. If the faction has at least one moderator, one of them will be chosen. Otherwise, a normal member will be promoted. If the faction admin was the last/only member, the faction will of course be disbanded.
This commit is contained in:
@@ -6,6 +6,7 @@ import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
|
||||
public class CmdKick extends FCommand
|
||||
{
|
||||
@@ -75,24 +76,14 @@ public class CmdKick extends FCommand
|
||||
fme.msg("<i>You kicked %s<i> from the faction %s<i>!", you.describeTo(fme), yourFaction.describeTo(fme));
|
||||
}
|
||||
|
||||
if (Conf.logFactionKick)
|
||||
P.p.log((senderIsConsole ? "A console command" : fme.getName())+" kicked "+you.getName()+" from the faction: "+yourFaction.getTag());
|
||||
|
||||
if (you.getRole() == Role.ADMIN)
|
||||
yourFaction.promoteNewLeader();
|
||||
|
||||
yourFaction.deinvite(you);
|
||||
you.resetFactionData();
|
||||
|
||||
if (Conf.logFactionKick)
|
||||
P.p.log(fme.getName()+" kicked "+you.getName()+" from the faction: "+yourFaction.getTag());
|
||||
|
||||
if (yourFaction.getFPlayers().isEmpty() && !yourFaction.isPermanent())
|
||||
{
|
||||
// Remove this faction
|
||||
for (FPlayer fplayer : FPlayers.i.getOnline())
|
||||
{
|
||||
fplayer.msg("The faction %s<i> was disbanded.", yourFaction.getTag(fplayer));
|
||||
}
|
||||
yourFaction.detach();
|
||||
|
||||
if (Conf.logFactionDisband)
|
||||
P.p.log("The faction "+yourFaction.getTag()+" ("+yourFaction.getId()+") was disbanded since the last player was kicked by "+(senderIsConsole ? "console command" : fme.getName())+".");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user