Fixing the comparator and starting to use the standardized version command.

This commit is contained in:
Olof Larsson 2013-04-16 13:17:42 +02:00
parent 4b9bdf0d94
commit 6ef15bc2db
4 changed files with 14 additions and 32 deletions

View File

@ -1,6 +1,7 @@
main: com.massivecraft.factions.Factions
name: Factions
version: 2.0.0_dev
main: com.massivecraft.factions.Factions
website: http://massivecraft.com/factions
authors: [Olof "Cayorion" Larsson, Brett Flannigan]
depend: [mcore]
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag]

View File

@ -22,24 +22,24 @@ public class FactionListComparator implements Comparator<Faction>
{
int ret = 0;
// Null --> Low
// Null
if (f1 == null && f2 == null) ret = 0;
if (f1 == null) ret = -1;
if (f2 == null) ret = +1;
if (ret != 0) return ret;
// None --> High
// None
if (f1.isNone() && f2.isNone()) ret = 0;
if (f1.isNone()) ret = +1;
if (f2.isNone()) ret = -1;
if (f1.isNone()) ret = -1;
if (f2.isNone()) ret = +1;
if (ret != 0) return ret;
// Players Online --> High
ret = f1.getFPlayersWhereOnline(true).size() - f2.getFPlayersWhereOnline(true).size();
// Players Online
ret = f2.getFPlayersWhereOnline(true).size() - f1.getFPlayersWhereOnline(true).size();
if (ret != 0) return ret;
// Players Total --> High
ret = f1.getFPlayers().size() - f2.getFPlayers().size();
// Players Total
ret = f2.getFPlayers().size() - f1.getFPlayers().size();
if (ret != 0) return ret;
// Tie by Id

View File

@ -3,7 +3,10 @@ package com.massivecraft.factions.cmd;
import java.util.Collections;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.VersionCommand;
public class CmdFactions extends FCommand
{
@ -44,7 +47,7 @@ public class CmdFactions extends FCommand
public CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle();
public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim();
public CmdFactionsUnclaimall cmdFactionsUnclaimall = new CmdFactionsUnclaimall();
public CmdFactionsVersion cmdFactionsVersion = new CmdFactionsVersion();
public VersionCommand cmdFactionsVersion = new VersionCommand(Factions.get(), Perm.VERSION.node, "v", "version");
public CmdFactions()
{

View File

@ -1,22 +0,0 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdFactionsVersion extends FCommand
{
public CmdFactionsVersion()
{
this.addAliases("version");
this.addRequirements(ReqHasPerm.get(Perm.VERSION.node));
}
@Override
public void perform()
{
msg("<i>You are running "+Factions.get().getDescription().getFullName());
}
}