mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-12-03 23:53:27 +01:00
Merge coleader
This commit is contained in:
commit
104e7916f8
@ -36,10 +36,11 @@ public class Conf {
|
||||
public static double powerOfflineLossLimit = 0.0; // players will no longer lose power from being offline once their power drops to this amount or less
|
||||
public static double powerFactionMax = 0.0; // if greater than 0, the cap on how much power a faction can have (additional power from players beyond that will act as a "buffer" of sorts)
|
||||
|
||||
public static String prefixAdmin = "**";
|
||||
public static String prefixAdmin = "***";
|
||||
public static String prefixColeader = "**";
|
||||
public static String prefixMod = "*";
|
||||
public static String prefixRecruit = "-";
|
||||
public static String prefixNormal = "+";
|
||||
public static String prefixRecruit = "-";
|
||||
|
||||
public static int factionTagLengthMin = 3;
|
||||
public static int factionTagLengthMax = 10;
|
||||
|
@ -41,11 +41,19 @@ public class CmdKick extends FCommand {
|
||||
String s = player.getName();
|
||||
msg.then(s + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_KICK_CLICKTOKICK.toString() + s).command("/" + Conf.baseCommandAliases.get(0) + " kick " + s);
|
||||
}
|
||||
if (fme.getRole() == Role.ADMIN) {
|
||||
if (fme.getRole().isAtLeast(Role.COLEADER)) {
|
||||
// For both coleader and admin, add mods.
|
||||
for (FPlayer player : myFaction.getFPlayersWhereRole(Role.MODERATOR)) {
|
||||
String s = player.getName();
|
||||
msg.then(s + " ").color(ChatColor.GRAY).tooltip(TL.COMMAND_KICK_CLICKTOKICK.toString() + s).command("/" + Conf.baseCommandAliases.get(0) + " kick " + s);
|
||||
}
|
||||
if (fme.getRole() == Role.ADMIN) {
|
||||
// Only add coleader to this for the leader.
|
||||
for (FPlayer player : myFaction.getFPlayersWhereRole(Role.COLEADER)) {
|
||||
String s = player.getName();
|
||||
msg.then(s + " ").color(ChatColor.RED).tooltip(TL.COMMAND_KICK_CLICKTOKICK.toString() + s).command("/" + Conf.baseCommandAliases.get(0) + " kick " + s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sendFancyMessage(msg);
|
||||
@ -115,7 +123,6 @@ public class CmdKick extends FCommand {
|
||||
}
|
||||
|
||||
if (Conf.logFactionKick) {
|
||||
//TODO:TL
|
||||
P.p.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum Role implements Permissable {
|
||||
ADMIN(3, TL.ROLE_ADMIN),
|
||||
ADMIN(4, TL.ROLE_ADMIN),
|
||||
COLEADER(3, TL.ROLE_COLEADER),
|
||||
MODERATOR(2, TL.ROLE_MODERATOR),
|
||||
NORMAL(1, TL.ROLE_NORMAL),
|
||||
RECRUIT(0, TL.ROLE_RECRUIT);
|
||||
@ -52,6 +53,8 @@ public enum Role implements Permissable {
|
||||
case 2:
|
||||
return MODERATOR;
|
||||
case 3:
|
||||
return COLEADER;
|
||||
case 4 :
|
||||
return ADMIN;
|
||||
}
|
||||
|
||||
@ -62,6 +65,9 @@ public enum Role implements Permissable {
|
||||
switch (check.toLowerCase()) {
|
||||
case "admin":
|
||||
return ADMIN;
|
||||
case "coleader":
|
||||
case "coowner":
|
||||
return COLEADER;
|
||||
case "mod":
|
||||
case "moderator":
|
||||
return MODERATOR;
|
||||
@ -90,6 +96,10 @@ public enum Role implements Permissable {
|
||||
return Conf.prefixAdmin;
|
||||
}
|
||||
|
||||
if (this == Role.COLEADER) {
|
||||
return Conf.prefixColeader;
|
||||
}
|
||||
|
||||
if (this == Role.MODERATOR) {
|
||||
return Conf.prefixMod;
|
||||
}
|
||||
|
@ -803,8 +803,12 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
||||
|
||||
FPlayer oldLeader = this.getFPlayerAdmin();
|
||||
|
||||
// get list of moderators, or list of normal members if there are no moderators
|
||||
ArrayList<FPlayer> replacements = this.getFPlayersWhereRole(Role.MODERATOR);
|
||||
// get list of coleaders, or mods, or list of normal members if there are no moderators
|
||||
ArrayList<FPlayer> replacements = this.getFPlayersWhereRole(Role.COLEADER);
|
||||
if (replacements == null || replacements.isEmpty()) {
|
||||
replacements = this.getFPlayersWhereRole(Role.MODERATOR);
|
||||
}
|
||||
|
||||
if (replacements == null || replacements.isEmpty()) {
|
||||
replacements = this.getFPlayersWhereRole(Role.NORMAL);
|
||||
}
|
||||
|
@ -706,6 +706,7 @@ public enum TL {
|
||||
* Roles
|
||||
*/
|
||||
ROLE_ADMIN("admin"),
|
||||
ROLE_COLEADER("coleader"),
|
||||
ROLE_MODERATOR("moderator"),
|
||||
ROLE_NORMAL("normal member"),
|
||||
ROLE_RECRUIT("recruit"),
|
||||
|
@ -399,15 +399,17 @@ fperm-gui:
|
||||
recruit: 10
|
||||
normal: 11
|
||||
moderator: 12
|
||||
truce: 13
|
||||
ally: 14
|
||||
enemy: 15
|
||||
neutral: 16
|
||||
coleader: 13
|
||||
truce: 14
|
||||
ally: 15
|
||||
enemy: 16
|
||||
neutral: 17
|
||||
# Material to be displayed
|
||||
materials:
|
||||
recruit: WOOD_SWORD
|
||||
normal: STONE_SWORD
|
||||
moderator: IRON_SWORD
|
||||
coleader: SPONGE
|
||||
truce: IRON_AXE
|
||||
ally: DIAMOND_SWORD
|
||||
enemy: DIAMOND_AXE
|
||||
|
Loading…
Reference in New Issue
Block a user