Add recruit role for factions
The recruit role's goal is to enable factions to invite new members without being afraid of getting griefed instantly. Adds a configuration option "factionRankDefault" for default rank of newly joined faction members. By default this is RECRUIT, but it can be set to any supported rank. Adds the /f promote and /f demote commands, which leaders and officers can use to increase or decrease the rank of a faction member by one level, up to officer, or down to recruit. This version of the recruit feature preserves the /f officer command for backward compatibility.
This commit is contained in:
@@ -24,11 +24,11 @@ import com.massivecraft.factions.iface.RelationParticipator;
|
||||
*/
|
||||
public enum FPerm
|
||||
{
|
||||
BUILD("build", "edit the terrain", Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.ALLY),
|
||||
BUILD("build", "edit the terrain", Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.RECRUIT, Rel.ALLY),
|
||||
PAINBUILD("painbuild", "edit but take damage"),
|
||||
DOOR("door", "use doors", Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.ALLY),
|
||||
BUTTON("button", "use stone buttons", Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.ALLY),
|
||||
LEVER("lever", "use levers", Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.ALLY),
|
||||
DOOR("door", "use doors", Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.RECRUIT, Rel.ALLY),
|
||||
BUTTON("button", "use stone buttons", Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.RECRUIT, Rel.ALLY),
|
||||
LEVER("lever", "use levers", Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.RECRUIT, Rel.ALLY),
|
||||
CONTAINER("container", "use containers", Rel.LEADER, Rel.OFFICER, Rel.MEMBER),
|
||||
INVITE("invite", "invite players", Rel.LEADER, Rel.OFFICER),
|
||||
KICK("kick", "kick members", Rel.LEADER, Rel.OFFICER),
|
||||
|
||||
@@ -18,6 +18,7 @@ public enum Permission
|
||||
CONFIG("config"),
|
||||
CREATE("create"),
|
||||
DEINVITE("deinvite"),
|
||||
DEMOTE("demote"),
|
||||
DESCRIPTION("description"),
|
||||
DISBAND("disband"),
|
||||
FLAG("flag"),
|
||||
@@ -49,6 +50,7 @@ public enum Permission
|
||||
POWER("power"),
|
||||
POWER_ANY("power.any"),
|
||||
POWERBOOST("powerboost"),
|
||||
PROMOTE("promote"),
|
||||
RELATION("relation"),
|
||||
RELOAD("reload"),
|
||||
SAVE("save"),
|
||||
|
||||
@@ -6,9 +6,10 @@ import com.massivecraft.factions.Conf;
|
||||
|
||||
public enum Rel
|
||||
{
|
||||
LEADER (70, "your faction leader", "your faction leader", "", ""),
|
||||
OFFICER (60, "an officer in your faction", "officers in your faction", "", ""),
|
||||
MEMBER (50, "a member in your faction", "members in your faction", "your faction", "your factions"),
|
||||
LEADER (80, "your faction leader", "your faction leader", "", ""),
|
||||
OFFICER (70, "an officer in your faction", "officers in your faction", "", ""),
|
||||
MEMBER (60, "a member in your faction", "members in your faction", "your faction", "your factions"),
|
||||
RECRUIT (50, "a recruit in your faction", "recruits in your faction", "", ""),
|
||||
ALLY (40, "an ally", "allies", "an allied faction", "allied factions"),
|
||||
TRUCE (30, "someone in truce with you", "those in truce with you", "a faction in truce", "factions in truce"),
|
||||
NEUTRAL (20, "someone neutral to you", "those neutral to you", "a neutral faction", "neutral factions"),
|
||||
@@ -64,6 +65,7 @@ public enum Rel
|
||||
if (c == 'l') return LEADER;
|
||||
if (c == 'o') return OFFICER;
|
||||
if (c == 'm') return MEMBER;
|
||||
if (c == 'r') return RECRUIT;
|
||||
if (c == 'a') return ALLY;
|
||||
if (c == 't') return TRUCE;
|
||||
if (c == 'n') return NEUTRAL;
|
||||
@@ -93,7 +95,7 @@ public enum Rel
|
||||
|
||||
public ChatColor getColor()
|
||||
{
|
||||
if (this.isAtLeast(MEMBER))
|
||||
if (this.isAtLeast(RECRUIT))
|
||||
return Conf.colorMember;
|
||||
else if (this == ALLY)
|
||||
return Conf.colorAlly;
|
||||
@@ -117,6 +119,16 @@ public enum Rel
|
||||
return Conf.prefixOfficer;
|
||||
}
|
||||
|
||||
if (this == MEMBER)
|
||||
{
|
||||
return Conf.prefixMember;
|
||||
}
|
||||
|
||||
if (this == RECRUIT)
|
||||
{
|
||||
return Conf.prefixRecruit;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user