From 208434972f618ab4a8fc0519a993d14634ede9b1 Mon Sep 17 00:00:00 2001 From: Kakifrucht Date: Sat, 17 Dec 2016 02:06:44 +0100 Subject: [PATCH] Also exempt from /f list --- .../com/massivecraft/factions/cmd/CmdList.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdList.java b/src/main/java/com/massivecraft/factions/cmd/CmdList.java index 41424057..82e93d50 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdList.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdList.java @@ -3,13 +3,12 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Conf; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; +import com.massivecraft.factions.P; import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TagUtil; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; +import java.util.*; public class CmdList extends FCommand { @@ -50,6 +49,18 @@ public class CmdList extends FCommand { factionList.remove(Factions.getInstance().getSafeZone()); factionList.remove(Factions.getInstance().getWarZone()); + // remove exempt factions + if (!fme.getPlayer().hasPermission("factions.show.bypassexempt")) { + List exemptFactions = P.p.getConfig().getStringList("show-exempt"); + Iterator factionIterator = factionList.iterator(); + while (factionIterator.hasNext()) { + Faction next = factionIterator.next(); + if (exemptFactions.contains(next.getTag())) { + factionIterator.remove(); + } + } + } + // Sort by total followers first Collections.sort(factionList, new Comparator() { @Override