mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-23 02:35:22 +01:00
Fixing the comparator and starting to use the standardized version command.
This commit is contained in:
parent
4b9bdf0d94
commit
6ef15bc2db
@ -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]
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user