From 6ef15bc2db8d03623bbbbf774f0f67f1a91ddcd2 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Tue, 16 Apr 2013 13:17:42 +0200 Subject: [PATCH] Fixing the comparator and starting to use the standardized version command. --- plugin.yml | 3 ++- .../factions/FactionListComparator.java | 16 +++++++------- .../factions/cmd/CmdFactions.java | 5 ++++- .../factions/cmd/CmdFactionsVersion.java | 22 ------------------- 4 files changed, 14 insertions(+), 32 deletions(-) delete mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsVersion.java diff --git a/plugin.yml b/plugin.yml index 1f9add2d..5e364882 100644 --- a/plugin.yml +++ b/plugin.yml @@ -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] diff --git a/src/com/massivecraft/factions/FactionListComparator.java b/src/com/massivecraft/factions/FactionListComparator.java index a795af13..9c08495c 100644 --- a/src/com/massivecraft/factions/FactionListComparator.java +++ b/src/com/massivecraft/factions/FactionListComparator.java @@ -22,24 +22,24 @@ public class FactionListComparator implements Comparator { 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 diff --git a/src/com/massivecraft/factions/cmd/CmdFactions.java b/src/com/massivecraft/factions/cmd/CmdFactions.java index 470d7691..88037a07 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactions.java +++ b/src/com/massivecraft/factions/cmd/CmdFactions.java @@ -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() { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsVersion.java b/src/com/massivecraft/factions/cmd/CmdFactionsVersion.java deleted file mode 100644 index 1f8121d8..00000000 --- a/src/com/massivecraft/factions/cmd/CmdFactionsVersion.java +++ /dev/null @@ -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("You are running "+Factions.get().getDescription().getFullName()); - } -}