Better flag system. Permission to change faction flags of choice. Possibility for other plugins to add faction flags, and more.
This commit is contained in:
@ -26,7 +26,6 @@ public class CmdFactions extends FactionsCommand
|
||||
public CmdFactionsDescription cmdFactionsDescription = new CmdFactionsDescription();
|
||||
public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome();
|
||||
public CmdFactionsUnsethome cmdFactionsUnsethome = new CmdFactionsUnsethome();
|
||||
public CmdFactionsOpen cmdFactionsOpen = new CmdFactionsOpen();
|
||||
public CmdFactionsInvite cmdFactionsInvite = new CmdFactionsInvite();
|
||||
public CmdFactionsKick cmdFactionsKick = new CmdFactionsKick();
|
||||
public CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle();
|
||||
@ -72,7 +71,6 @@ public class CmdFactions extends FactionsCommand
|
||||
this.addSubCommand(this.cmdFactionsDescription);
|
||||
this.addSubCommand(this.cmdFactionsSethome);
|
||||
this.addSubCommand(this.cmdFactionsUnsethome);
|
||||
this.addSubCommand(this.cmdFactionsOpen);
|
||||
this.addSubCommand(this.cmdFactionsInvite);
|
||||
this.addSubCommand(this.cmdFactionsKick);
|
||||
this.addSubCommand(this.cmdFactionsTitle);
|
||||
|
@ -4,6 +4,8 @@ import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.massivecore.cmd.arg.ARBoolean;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.util.IdUtil;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class CmdFactionsAdmin extends FactionsCommand
|
||||
{
|
||||
@ -20,7 +22,6 @@ public class CmdFactionsAdmin extends FactionsCommand
|
||||
this.addOptionalArg("on/off", "flip");
|
||||
|
||||
// Requirements
|
||||
// this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.ADMIN.node));
|
||||
}
|
||||
|
||||
@ -30,22 +31,22 @@ public class CmdFactionsAdmin extends FactionsCommand
|
||||
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
{
|
||||
// Args
|
||||
Boolean target = this.arg(0, ARBoolean.get(), !msender.isUsingAdminMode());
|
||||
if (target == null) return;
|
||||
|
||||
// Apply
|
||||
msender.setUsingAdminMode(target);
|
||||
|
||||
if (msender.isUsingAdminMode())
|
||||
{
|
||||
msender.msg("<i>You have enabled admin bypass mode.");
|
||||
Factions.get().log(msender.getId() + " has ENABLED admin bypass mode.");
|
||||
}
|
||||
else
|
||||
{
|
||||
msender.msg("<i>You have disabled admin bypass mode.");
|
||||
Factions.get().log(msender.getId() + " DISABLED admin bypass mode.");
|
||||
}
|
||||
// Inform
|
||||
String desc = Txt.parse(msender.isUsingAdminMode() ? "<g>ENABLED" : "<b>DISABLED");
|
||||
|
||||
String messageYou = Txt.parse("<i>%s %s <i>admin bypass mode.", msender.getDisplayName(msender), desc);
|
||||
String messageLog = Txt.parse("<i>%s %s <i>admin bypass mode.", msender.getDisplayName(IdUtil.getConsole()), desc);
|
||||
|
||||
msender.sendMessage(messageYou);
|
||||
Factions.get().log(messageLog);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
import com.massivecraft.factions.entity.FactionColl;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.event.EventFactionsDisband;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||
import com.massivecraft.factions.FFlag;
|
||||
import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -49,7 +49,7 @@ public class CmdFactionsDisband extends FactionsCommand
|
||||
if ( ! FPerm.DISBAND.has(msender, faction, true)) return;
|
||||
|
||||
// Verify
|
||||
if (faction.getFlag(FFlag.PERMANENT))
|
||||
if (faction.getFlag(MFlag.getPermanent()))
|
||||
{
|
||||
msg("<i>This faction is designated as permanent, so you cannot disband it.");
|
||||
return;
|
||||
|
@ -8,11 +8,11 @@ import java.util.Map;
|
||||
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.FFlag;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.PlayerRoleComparator;
|
||||
import com.massivecraft.factions.Rel;
|
||||
@ -59,6 +59,12 @@ public class CmdFactionsFaction extends FactionsCommand
|
||||
// INFO: Title
|
||||
msg(Txt.titleize("Faction " + faction.getName(msender)));
|
||||
|
||||
// INFO: Id (admin mode output only)
|
||||
if (msender.isUsingAdminMode())
|
||||
{
|
||||
msg("<a>ID: <i>%s", faction.getId());
|
||||
}
|
||||
|
||||
// INFO: Description
|
||||
msg("<a>Description: <i>%s", faction.getDescription());
|
||||
|
||||
@ -71,7 +77,8 @@ public class CmdFactionsFaction extends FactionsCommand
|
||||
msg("<a>Age: <i>%s", ageString);
|
||||
|
||||
// INFO: Open
|
||||
msg("<a>Open: <i>"+(faction.isOpen() ? "<lime>Yes<i>, anyone can join" : "<rose>No<i>, only invited people can join"));
|
||||
// TODO: Why hardcode displaying the open flag only? We should rather display everything publicly editable.
|
||||
msg("<a>Open: <i>"+(faction.getFlag(MFlag.getOpen()) ? "<lime>Yes<i>, anyone can join" : "<rose>No<i>, only invited people can join"));
|
||||
|
||||
// INFO: Power
|
||||
double powerBoost = faction.getPowerBoost();
|
||||
@ -113,12 +120,12 @@ public class CmdFactionsFaction extends FactionsCommand
|
||||
|
||||
// Display important flags
|
||||
// TODO: Find the non default flags, and display them instead.
|
||||
if (faction.getFlag(FFlag.PERMANENT))
|
||||
if (faction.getFlag(MFlag.getPermanent()))
|
||||
{
|
||||
msg("<a>This faction is permanent - remaining even with no followers.");
|
||||
}
|
||||
|
||||
if (faction.getFlag(FFlag.PEACEFUL))
|
||||
if (faction.getFlag(MFlag.getPeaceful()))
|
||||
{
|
||||
msg("<a>This faction is peaceful - in truce with everyone.");
|
||||
}
|
||||
@ -129,7 +136,7 @@ public class CmdFactionsFaction extends FactionsCommand
|
||||
// List the relations to other factions
|
||||
Map<Rel, List<String>> relationNames = faction.getFactionNamesPerRelation(msender, true);
|
||||
|
||||
if (faction.getFlag(FFlag.PEACEFUL))
|
||||
if (faction.getFlag(MFlag.getPeaceful()))
|
||||
{
|
||||
sendMessage(Txt.parse("<a>In Truce with:<i> *everyone*"));
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FFlag;
|
||||
import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.cmd.arg.ARFFlag;
|
||||
import com.massivecraft.factions.cmd.arg.ARMFlag;
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.factions.event.EventFactionsFlagChange;
|
||||
import com.massivecraft.massivecore.cmd.arg.ARBoolean;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
@ -36,39 +38,67 @@ public class CmdFactionsFlag extends FactionsCommand
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
// Arg: Faction
|
||||
Faction faction = this.arg(0, ARFaction.get(), msenderFaction);
|
||||
if (faction == null) return;
|
||||
|
||||
// Case: Show All
|
||||
if ( ! this.argIsSet(1))
|
||||
{
|
||||
msg(Txt.titleize("Flags for " + faction.describeTo(msender, true)));
|
||||
for (FFlag flag : FFlag.values())
|
||||
for (MFlag mflag : MFlag.getAll())
|
||||
{
|
||||
msg(flag.getStateInfo(faction.getFlag(flag), true));
|
||||
if (!mflag.isVisible() && !msender.isUsingAdminMode()) continue;
|
||||
msg(mflag.getStateInfo(faction.getFlag(mflag), true));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
FFlag flag = this.arg(1, ARFFlag.get());
|
||||
if (flag == null) return;
|
||||
// Arg: MFlag
|
||||
MFlag mflag = this.arg(1, ARMFlag.get());
|
||||
if (mflag == null) return;
|
||||
|
||||
// Case: Show One
|
||||
if ( ! this.argIsSet(2))
|
||||
{
|
||||
msg(Txt.titleize("Flag for " + faction.describeTo(msender, true)));
|
||||
msg(flag.getStateInfo(faction.getFlag(flag), true));
|
||||
msg(mflag.getStateInfo(faction.getFlag(mflag), true));
|
||||
return;
|
||||
}
|
||||
|
||||
// Do the sender have the right to change flags for this faction?
|
||||
if ( ! FPerm.PERMS.has(msender, faction, true)) return;
|
||||
|
||||
// Is this flag editable?
|
||||
if (!msender.isUsingAdminMode() && !mflag.isEditable())
|
||||
{
|
||||
msg("<b>The flag <h>%s <b>is not editable.", mflag.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
// Arg: Target Value
|
||||
Boolean targetValue = this.arg(2, ARBoolean.get());
|
||||
if (targetValue == null) return;
|
||||
|
||||
// Do the sender have the right to change flags?
|
||||
if ( ! Perm.FLAG_SET.has(sender, true)) return;
|
||||
|
||||
// Do the change
|
||||
msg(Txt.titleize("Flag for " + faction.describeTo(msender, true)));
|
||||
faction.setFlag(flag, targetValue);
|
||||
msg(flag.getStateInfo(faction.getFlag(flag), true));
|
||||
// Event
|
||||
EventFactionsFlagChange event = new EventFactionsFlagChange(sender, faction, mflag, targetValue);
|
||||
event.run();
|
||||
if (event.isCancelled()) return;
|
||||
targetValue = event.isNewValue();
|
||||
|
||||
// Apply
|
||||
faction.setFlag(mflag, targetValue);
|
||||
|
||||
// Inform
|
||||
String stateInfo = mflag.getStateInfo(faction.getFlag(mflag), true);
|
||||
if (msender.getFaction() != faction)
|
||||
{
|
||||
// Send message to sender
|
||||
msg("<h>%s <i>set a flag for <h>%s", msender.describeTo(msender, true), faction.describeTo(msender, true));
|
||||
msg(stateInfo);
|
||||
}
|
||||
faction.msg("<h>%s <i>set a flag for <h>%s", msender.describeTo(faction, true), faction.describeTo(faction, true));
|
||||
faction.msg(stateInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.massivecraft.factions.FFlag;
|
||||
import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -12,6 +11,7 @@ import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.event.EventFactionsHomeTeleport;
|
||||
@ -98,7 +98,7 @@ public class CmdFactionsHome extends FactionsCommandHome
|
||||
(
|
||||
MConf.get().homesTeleportAllowedEnemyDistance > 0
|
||||
&&
|
||||
factionHere.getFlag(FFlag.PVP)
|
||||
factionHere.getFlag(MFlag.getPvp())
|
||||
&&
|
||||
(
|
||||
! msender.isInOwnTerritory()
|
||||
|
@ -5,6 +5,7 @@ import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.cmd.arg.ARMPlayer;
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||
@ -79,7 +80,7 @@ public class CmdFactionsJoin extends FactionsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if( ! (faction.isOpen() || faction.isInvited(mplayer) || msender.isUsingAdminMode() || Perm.JOIN_ANY.has(sender, false)))
|
||||
if( ! (faction.getFlag(MFlag.getOpen()) || faction.isInvited(mplayer) || msender.isUsingAdminMode() || Perm.JOIN_ANY.has(sender, false)))
|
||||
{
|
||||
msg("<i>This faction requires invitation.");
|
||||
if (samePlayer)
|
||||
|
@ -1,56 +0,0 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
||||
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
||||
import com.massivecraft.factions.event.EventFactionsOpenChange;
|
||||
import com.massivecraft.massivecore.cmd.arg.ARBoolean;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
|
||||
public class CmdFactionsOpen extends FactionsCommand
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public CmdFactionsOpen()
|
||||
{
|
||||
// Aliases
|
||||
this.addAliases("open");
|
||||
|
||||
// Args
|
||||
this.addOptionalArg("yes/no", "toggle");
|
||||
|
||||
// Requirements
|
||||
this.addRequirements(ReqHasPerm.get(Perm.OPEN.node));
|
||||
this.addRequirements(ReqHasFaction.get());
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
// Args
|
||||
Boolean newOpen = this.arg(0, ARBoolean.get(), !msenderFaction.isOpen());
|
||||
if (newOpen == null) return;
|
||||
|
||||
// Event
|
||||
EventFactionsOpenChange event = new EventFactionsOpenChange(sender, msenderFaction, newOpen);
|
||||
event.run();
|
||||
if (event.isCancelled()) return;
|
||||
newOpen = event.isNewOpen();
|
||||
|
||||
// Apply
|
||||
msenderFaction.setOpen(newOpen);
|
||||
|
||||
// Inform
|
||||
String descTarget = msenderFaction.isOpen() ? "open" : "closed";
|
||||
msenderFaction.msg("%s<i> changed the faction to <h>%s<i>.", msender.describeTo(msenderFaction, true), descTarget);
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FFlag;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.cmd.arg.ARFaction;
|
||||
@ -8,6 +7,7 @@ import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
||||
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.factions.event.EventFactionsRelationChange;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
|
||||
@ -89,13 +89,13 @@ public abstract class CmdFactionsRelationAbstract extends FactionsCommand
|
||||
|
||||
// TODO: The ally case should work!!
|
||||
// * this might have to be bumped up to make that happen, & allow ALLY,NEUTRAL only
|
||||
if ( newRelation != Rel.TRUCE && otherFaction.getFlag(FFlag.PEACEFUL))
|
||||
if ( newRelation != Rel.TRUCE && otherFaction.getFlag(MFlag.getPeaceful()))
|
||||
{
|
||||
otherFaction.msg("<i>This will have no effect while your faction is peaceful.");
|
||||
msenderFaction.msg("<i>This will have no effect while their faction is peaceful.");
|
||||
}
|
||||
|
||||
if ( newRelation != Rel.TRUCE && msenderFaction.getFlag(FFlag.PEACEFUL))
|
||||
if ( newRelation != Rel.TRUCE && msenderFaction.getFlag(MFlag.getPeaceful()))
|
||||
{
|
||||
otherFaction.msg("<i>This will have no effect while their faction is peaceful.");
|
||||
msenderFaction.msg("<i>This will have no effect while your faction is peaceful.");
|
||||
|
@ -24,7 +24,6 @@ public class CmdFactionsSeeChunk extends FactionsCommand
|
||||
this.addAliases("sc", "seechunk");
|
||||
|
||||
// Requirements
|
||||
// this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.SEE_CHUNK.node));
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
}
|
||||
|
@ -1,51 +0,0 @@
|
||||
package com.massivecraft.factions.cmd.arg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.FFlag;
|
||||
import com.massivecraft.massivecore.cmd.arg.ARAbstractSelect;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ARFFlag extends ARAbstractSelect<FFlag>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static ARFFlag i = new ARFFlag();
|
||||
public static ARFFlag get() { return i; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public String typename()
|
||||
{
|
||||
return "faction flag";
|
||||
}
|
||||
|
||||
@Override
|
||||
public FFlag select(String str, CommandSender sender)
|
||||
{
|
||||
return FFlag.parse(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> altNames(CommandSender sender)
|
||||
{
|
||||
List<String> ret = new ArrayList<String>();
|
||||
|
||||
for (FFlag fflag : FFlag.values())
|
||||
{
|
||||
ret.add(Txt.getNicedEnum(fflag));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
88
src/main/java/com/massivecraft/factions/cmd/arg/ARMFlag.java
Normal file
88
src/main/java/com/massivecraft/factions/cmd/arg/ARMFlag.java
Normal file
@ -0,0 +1,88 @@
|
||||
package com.massivecraft.factions.cmd.arg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
import com.massivecraft.massivecore.cmd.arg.ARAbstractSelect;
|
||||
import com.massivecraft.massivecore.util.Txt;
|
||||
|
||||
public class ARMFlag extends ARAbstractSelect<MFlag>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static ARMFlag i = new ARMFlag();
|
||||
public static ARMFlag get() { return i; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public String typename()
|
||||
{
|
||||
return "faction flag";
|
||||
}
|
||||
|
||||
@Override
|
||||
public MFlag select(String arg, CommandSender sender)
|
||||
{
|
||||
if (arg == null) return null;
|
||||
arg = getComparable(arg);
|
||||
|
||||
// Algorithmic General Detection
|
||||
int startswithCount = 0;
|
||||
MFlag startswith = null;
|
||||
for (MFlag mflag : MFlag.getAll())
|
||||
{
|
||||
String comparable = getComparable(mflag);
|
||||
if (comparable.equals(arg)) return mflag;
|
||||
if (comparable.startsWith(arg))
|
||||
{
|
||||
startswith = mflag;
|
||||
startswithCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (startswithCount == 1)
|
||||
{
|
||||
return startswith;
|
||||
}
|
||||
|
||||
// Nothing found
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> altNames(CommandSender sender)
|
||||
{
|
||||
List<String> ret = new ArrayList<String>();
|
||||
|
||||
for (MFlag mflag : MFlag.getAll())
|
||||
{
|
||||
ret.add(Txt.upperCaseFirst(mflag.getName()));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// UTIL
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static String getComparable(String string)
|
||||
{
|
||||
return string.toLowerCase();
|
||||
}
|
||||
|
||||
public static String getComparable(MFlag mflag)
|
||||
{
|
||||
return getComparable(mflag.getName());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user