From 89dd975a6e80eb98a61a022ccb8f659b67eddb3f Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 3 Feb 2016 05:06:49 +0100 Subject: [PATCH] MassiveCore - Comparators, Predicates and Map Editor --- src/com/massivecraft/factions/FactionEqualsPredicate.java | 2 +- src/com/massivecraft/factions/PredicateRole.java | 2 +- .../massivecraft/factions/cmd/CmdFactionsFlagShow.java | 2 +- .../massivecraft/factions/cmd/CmdFactionsInviteAdd.java | 2 +- .../factions/cmd/CmdFactionsInviteRemove.java | 2 +- src/com/massivecraft/factions/cmd/CmdFactionsList.java | 6 +++--- .../massivecraft/factions/cmd/CmdFactionsPermShow.java | 2 +- src/com/massivecraft/factions/cmd/type/TypeFaction.java | 4 ++-- src/com/massivecraft/factions/entity/Faction.java | 8 ++++---- src/com/massivecraft/factions/entity/MFlag.java | 6 +++--- src/com/massivecraft/factions/entity/MPerm.java | 6 +++--- .../factions/event/EventFactionsExpansions.java | 4 ++-- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/com/massivecraft/factions/FactionEqualsPredicate.java b/src/com/massivecraft/factions/FactionEqualsPredicate.java index 8e79f158..cc3c7dba 100644 --- a/src/com/massivecraft/factions/FactionEqualsPredicate.java +++ b/src/com/massivecraft/factions/FactionEqualsPredicate.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; -import com.massivecraft.massivecore.Predicate; +import com.massivecraft.massivecore.predicate.Predicate; import com.massivecraft.massivecore.util.MUtil; public class FactionEqualsPredicate implements Predicate, Serializable diff --git a/src/com/massivecraft/factions/PredicateRole.java b/src/com/massivecraft/factions/PredicateRole.java index 79735b2e..177825d5 100644 --- a/src/com/massivecraft/factions/PredicateRole.java +++ b/src/com/massivecraft/factions/PredicateRole.java @@ -1,7 +1,7 @@ package com.massivecraft.factions; import com.massivecraft.factions.entity.MPlayer; -import com.massivecraft.massivecore.Predicate; +import com.massivecraft.massivecore.predicate.Predicate; public class PredicateRole implements Predicate { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java index 7ead9106..93349af9 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagShow.java @@ -11,7 +11,7 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; -import com.massivecraft.massivecore.command.type.collection.TypeSet; +import com.massivecraft.massivecore.command.type.container.TypeSet; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsFlagShow extends FactionsCommand diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java index e5f1e3dc..027cc196 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteAdd.java @@ -12,7 +12,7 @@ import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsInvitedChange; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; -import com.massivecraft.massivecore.command.type.collection.TypeSet; +import com.massivecraft.massivecore.command.type.container.TypeSet; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.Txt; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java index 24367f9b..2151d3b2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInviteRemove.java @@ -15,7 +15,7 @@ import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsInvitedChange; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; -import com.massivecraft.massivecore.command.type.collection.TypeSet; +import com.massivecraft.massivecore.command.type.container.TypeSet; import com.massivecraft.massivecore.mson.Mson; import com.massivecraft.massivecore.util.Txt; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/com/massivecraft/factions/cmd/CmdFactionsList.java index e937c7c0..d9895adc 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -11,13 +11,13 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.Predicate; -import com.massivecraft.massivecore.PredicateAnd; -import com.massivecraft.massivecore.PredicateVisibleTo; import com.massivecraft.massivecore.command.Parameter; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; +import com.massivecraft.massivecore.predicate.Predicate; +import com.massivecraft.massivecore.predicate.PredicateAnd; +import com.massivecraft.massivecore.predicate.PredicateVisibleTo; import com.massivecraft.massivecore.store.SenderColl; import com.massivecraft.massivecore.util.Txt; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java index c20ea3d3..b2ff8dc5 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPermShow.java @@ -11,7 +11,7 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.requirement.RequirementHasPerm; -import com.massivecraft.massivecore.command.type.collection.TypeSet; +import com.massivecraft.massivecore.command.type.container.TypeSet; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsPermShow extends FactionsCommand diff --git a/src/com/massivecraft/factions/cmd/type/TypeFaction.java b/src/com/massivecraft/factions/cmd/type/TypeFaction.java index 009f2c4f..81628961 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeFaction.java +++ b/src/com/massivecraft/factions/cmd/type/TypeFaction.java @@ -11,10 +11,10 @@ import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayerColl; -import com.massivecraft.massivecore.CaseInsensitiveComparator; import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.type.TypeAbstract; +import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive; import com.massivecraft.massivecore.util.IdUtil; public class TypeFaction extends TypeAbstract @@ -78,7 +78,7 @@ public class TypeFaction extends TypeAbstract @Override public Collection getTabList(CommandSender sender, String arg) { - Set ret = new TreeSet(CaseInsensitiveComparator.get()); + Set ret = new TreeSet(ComparatorCaseInsensitive.get()); for (Faction faction : FactionColl.get().getAll()) { diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index 8f9cdd79..919843c2 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -26,13 +26,13 @@ import com.massivecraft.factions.Rel; import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.util.MiscUtil; import com.massivecraft.factions.util.RelationUtil; -import com.massivecraft.massivecore.CaseInsensitiveComparator; import com.massivecraft.massivecore.Named; -import com.massivecraft.massivecore.Predicate; import com.massivecraft.massivecore.collections.MassiveMapDef; import com.massivecraft.massivecore.collections.MassiveTreeSetDef; +import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.money.Money; +import com.massivecraft.massivecore.predicate.Predicate; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.store.Entity; import com.massivecraft.massivecore.store.SenderColl; @@ -138,7 +138,7 @@ public class Faction extends Entity implements EconomyParticipator, Nam // This is the ids of the invited players. // They are actually "senderIds" since you can invite "@console" to your faction. // Null means no one is invited - private MassiveTreeSetDef invitedPlayerIds = new MassiveTreeSetDef(CaseInsensitiveComparator.get()); + private MassiveTreeSetDef invitedPlayerIds = new MassiveTreeSetDef(ComparatorCaseInsensitive.get()); // The keys in this map are factionIds. // Null means no special relation whishes. @@ -451,7 +451,7 @@ public class Faction extends Entity implements EconomyParticipator, Nam public void setInvitedPlayerIds(Collection invitedPlayerIds) { // Clean input - MassiveTreeSetDef target = new MassiveTreeSetDef(CaseInsensitiveComparator.get()); + MassiveTreeSetDef target = new MassiveTreeSetDef(ComparatorCaseInsensitive.get()); if (invitedPlayerIds != null) { for (String invitedPlayerId : invitedPlayerIds) diff --git a/src/com/massivecraft/factions/entity/MFlag.java b/src/com/massivecraft/factions/entity/MFlag.java index a5f83616..7b3ad534 100644 --- a/src/com/massivecraft/factions/entity/MFlag.java +++ b/src/com/massivecraft/factions/entity/MFlag.java @@ -4,11 +4,11 @@ import java.util.List; import com.massivecraft.factions.event.EventFactionsCreateFlags; import com.massivecraft.massivecore.Named; -import com.massivecraft.massivecore.PredicateIsRegistered; import com.massivecraft.massivecore.Prioritized; -import com.massivecraft.massivecore.PriorityComparator; import com.massivecraft.massivecore.Registerable; import com.massivecraft.massivecore.collections.MassiveList; +import com.massivecraft.massivecore.comparator.ComparatorPriority; +import com.massivecraft.massivecore.predicate.PredicateIsRegistered; import com.massivecraft.massivecore.store.Entity; import com.massivecraft.massivecore.util.Txt; @@ -66,7 +66,7 @@ public class MFlag extends Entity implements Prioritized, Registerable, N { setupStandardFlags(); new EventFactionsCreateFlags(isAsync).run(); - return MFlagColl.get().getAll(PredicateIsRegistered.get(), PriorityComparator.get()); + return MFlagColl.get().getAll(PredicateIsRegistered.get(), ComparatorPriority.get()); } public static void setupStandardFlags() diff --git a/src/com/massivecraft/factions/entity/MPerm.java b/src/com/massivecraft/factions/entity/MPerm.java index 9ba6abc7..b8307834 100644 --- a/src/com/massivecraft/factions/entity/MPerm.java +++ b/src/com/massivecraft/factions/entity/MPerm.java @@ -13,10 +13,10 @@ import com.massivecraft.factions.Rel; import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.event.EventFactionsCreatePerms; import com.massivecraft.massivecore.Named; -import com.massivecraft.massivecore.PredicateIsRegistered; import com.massivecraft.massivecore.Prioritized; -import com.massivecraft.massivecore.PriorityComparator; import com.massivecraft.massivecore.Registerable; +import com.massivecraft.massivecore.comparator.ComparatorPriority; +import com.massivecraft.massivecore.predicate.PredicateIsRegistered; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.store.Entity; import com.massivecraft.massivecore.util.MUtil; @@ -99,7 +99,7 @@ public class MPerm extends Entity implements Prioritized, Registerable, N setupStandardPerms(); new EventFactionsCreatePerms().run(); - return MPermColl.get().getAll(PredicateIsRegistered.get(), PriorityComparator.get()); + return MPermColl.get().getAll(PredicateIsRegistered.get(), ComparatorPriority.get()); } public static void setupStandardPerms() diff --git a/src/com/massivecraft/factions/event/EventFactionsExpansions.java b/src/com/massivecraft/factions/event/EventFactionsExpansions.java index 55bcfea7..e0a98fb3 100644 --- a/src/com/massivecraft/factions/event/EventFactionsExpansions.java +++ b/src/com/massivecraft/factions/event/EventFactionsExpansions.java @@ -5,8 +5,8 @@ import java.util.Map; import org.bukkit.command.CommandSender; import org.bukkit.event.HandlerList; -import com.massivecraft.massivecore.CaseInsensitiveComparator; import com.massivecraft.massivecore.collections.MassiveTreeMap; +import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive; public class EventFactionsExpansions extends EventFactionsAbstractSender { @@ -22,7 +22,7 @@ public class EventFactionsExpansions extends EventFactionsAbstractSender // FIELDS // -------------------------------------------- // - private final MassiveTreeMap expansions = new MassiveTreeMap(CaseInsensitiveComparator.get()); + private final MassiveTreeMap expansions = new MassiveTreeMap(ComparatorCaseInsensitive.get()); public Map getExpansions() { return this.expansions; } // -------------------------------------------- //