From 4a91e9f0682f895669c0b68bbbb48d4e77ce3c4e Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Sun, 24 Apr 2016 08:38:51 +0200 Subject: [PATCH] MassiveCore - Working on DataItemStack. Not done yet. --- src/com/massivecraft/factions/FactionListComparator.java | 3 ++- src/com/massivecraft/factions/entity/MFlag.java | 4 ++-- src/com/massivecraft/factions/entity/MPerm.java | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/massivecraft/factions/FactionListComparator.java b/src/com/massivecraft/factions/FactionListComparator.java index 95c53c84..4342aaad 100644 --- a/src/com/massivecraft/factions/FactionListComparator.java +++ b/src/com/massivecraft/factions/FactionListComparator.java @@ -3,6 +3,7 @@ package com.massivecraft.factions; import java.util.Comparator; import com.massivecraft.factions.entity.Faction; +import com.massivecraft.massivecore.comparator.ComparatorComparable; import com.massivecraft.massivecore.util.MUtil; public class FactionListComparator implements Comparator @@ -44,7 +45,7 @@ public class FactionListComparator implements Comparator if (ret != 0) return ret; // Tie by Id - return MUtil.compare(f1.getId(), f2.getId()); + return ComparatorComparable.get().compare(f1.getId(), f2.getId()); } } diff --git a/src/com/massivecraft/factions/entity/MFlag.java b/src/com/massivecraft/factions/entity/MFlag.java index 7b3ad534..1bfd2b96 100644 --- a/src/com/massivecraft/factions/entity/MFlag.java +++ b/src/com/massivecraft/factions/entity/MFlag.java @@ -7,7 +7,7 @@ import com.massivecraft.massivecore.Named; import com.massivecraft.massivecore.Prioritized; import com.massivecraft.massivecore.Registerable; import com.massivecraft.massivecore.collections.MassiveList; -import com.massivecraft.massivecore.comparator.ComparatorPriority; +import com.massivecraft.massivecore.comparator.ComparatorSmart; 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(), ComparatorPriority.get()); + return MFlagColl.get().getAll(PredicateIsRegistered.get(), ComparatorSmart.get()); } public static void setupStandardFlags() diff --git a/src/com/massivecraft/factions/entity/MPerm.java b/src/com/massivecraft/factions/entity/MPerm.java index 2045ed35..aec1b600 100644 --- a/src/com/massivecraft/factions/entity/MPerm.java +++ b/src/com/massivecraft/factions/entity/MPerm.java @@ -15,7 +15,7 @@ import com.massivecraft.factions.event.EventFactionsCreatePerms; import com.massivecraft.massivecore.Named; import com.massivecraft.massivecore.Prioritized; import com.massivecraft.massivecore.Registerable; -import com.massivecraft.massivecore.comparator.ComparatorPriority; +import com.massivecraft.massivecore.comparator.ComparatorSmart; import com.massivecraft.massivecore.predicate.PredicateIsRegistered; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.store.Entity; @@ -99,7 +99,7 @@ public class MPerm extends Entity implements Prioritized, Registerable, N setupStandardPerms(); new EventFactionsCreatePerms().run(); - return MPermColl.get().getAll(PredicateIsRegistered.get(), ComparatorPriority.get()); + return MPermColl.get().getAll(PredicateIsRegistered.get(), ComparatorSmart.get()); } public static void setupStandardPerms()