MassiveCore - Comparators, Predicates and Map Editor
This commit is contained in:
parent
c8433a4770
commit
89dd975a6e
@ -6,7 +6,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
import com.massivecraft.factions.entity.MPlayer;
|
import com.massivecraft.factions.entity.MPlayer;
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.massivecore.Predicate;
|
import com.massivecraft.massivecore.predicate.Predicate;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
|
|
||||||
public class FactionEqualsPredicate implements Predicate<CommandSender>, Serializable
|
public class FactionEqualsPredicate implements Predicate<CommandSender>, Serializable
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.massivecraft.factions;
|
package com.massivecraft.factions;
|
||||||
|
|
||||||
import com.massivecraft.factions.entity.MPlayer;
|
import com.massivecraft.factions.entity.MPlayer;
|
||||||
import com.massivecraft.massivecore.Predicate;
|
import com.massivecraft.massivecore.predicate.Predicate;
|
||||||
|
|
||||||
public class PredicateRole implements Predicate<MPlayer>
|
public class PredicateRole implements Predicate<MPlayer>
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,7 @@ import com.massivecraft.factions.entity.Faction;
|
|||||||
import com.massivecraft.factions.entity.MFlag;
|
import com.massivecraft.factions.entity.MFlag;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
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;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
|
||||||
public class CmdFactionsFlagShow extends FactionsCommand
|
public class CmdFactionsFlagShow extends FactionsCommand
|
||||||
|
@ -12,7 +12,7 @@ import com.massivecraft.factions.entity.MPlayer;
|
|||||||
import com.massivecraft.factions.event.EventFactionsInvitedChange;
|
import com.massivecraft.factions.event.EventFactionsInvitedChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
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.mson.Mson;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ import com.massivecraft.factions.entity.MPlayer;
|
|||||||
import com.massivecraft.factions.event.EventFactionsInvitedChange;
|
import com.massivecraft.factions.event.EventFactionsInvitedChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
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.mson.Mson;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
|
||||||
|
@ -11,13 +11,13 @@ import com.massivecraft.factions.entity.Faction;
|
|||||||
import com.massivecraft.factions.entity.FactionColl;
|
import com.massivecraft.factions.entity.FactionColl;
|
||||||
import com.massivecraft.factions.entity.MPlayer;
|
import com.massivecraft.factions.entity.MPlayer;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
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.Parameter;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
import com.massivecraft.massivecore.pager.Pager;
|
import com.massivecraft.massivecore.pager.Pager;
|
||||||
import com.massivecraft.massivecore.pager.Stringifier;
|
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.store.SenderColl;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import com.massivecraft.factions.entity.Faction;
|
|||||||
import com.massivecraft.factions.entity.MPerm;
|
import com.massivecraft.factions.entity.MPerm;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
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;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
|
||||||
public class CmdFactionsPermShow extends FactionsCommand
|
public class CmdFactionsPermShow extends FactionsCommand
|
||||||
|
@ -11,10 +11,10 @@ import com.massivecraft.factions.entity.Faction;
|
|||||||
import com.massivecraft.factions.entity.FactionColl;
|
import com.massivecraft.factions.entity.FactionColl;
|
||||||
import com.massivecraft.factions.entity.MPlayer;
|
import com.massivecraft.factions.entity.MPlayer;
|
||||||
import com.massivecraft.factions.entity.MPlayerColl;
|
import com.massivecraft.factions.entity.MPlayerColl;
|
||||||
import com.massivecraft.massivecore.CaseInsensitiveComparator;
|
|
||||||
import com.massivecraft.massivecore.MassiveCore;
|
import com.massivecraft.massivecore.MassiveCore;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.type.TypeAbstract;
|
import com.massivecraft.massivecore.command.type.TypeAbstract;
|
||||||
|
import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive;
|
||||||
import com.massivecraft.massivecore.util.IdUtil;
|
import com.massivecraft.massivecore.util.IdUtil;
|
||||||
|
|
||||||
public class TypeFaction extends TypeAbstract<Faction>
|
public class TypeFaction extends TypeAbstract<Faction>
|
||||||
@ -78,7 +78,7 @@ public class TypeFaction extends TypeAbstract<Faction>
|
|||||||
@Override
|
@Override
|
||||||
public Collection<String> getTabList(CommandSender sender, String arg)
|
public Collection<String> getTabList(CommandSender sender, String arg)
|
||||||
{
|
{
|
||||||
Set<String> ret = new TreeSet<String>(CaseInsensitiveComparator.get());
|
Set<String> ret = new TreeSet<String>(ComparatorCaseInsensitive.get());
|
||||||
|
|
||||||
for (Faction faction : FactionColl.get().getAll())
|
for (Faction faction : FactionColl.get().getAll())
|
||||||
{
|
{
|
||||||
|
@ -26,13 +26,13 @@ import com.massivecraft.factions.Rel;
|
|||||||
import com.massivecraft.factions.RelationParticipator;
|
import com.massivecraft.factions.RelationParticipator;
|
||||||
import com.massivecraft.factions.util.MiscUtil;
|
import com.massivecraft.factions.util.MiscUtil;
|
||||||
import com.massivecraft.factions.util.RelationUtil;
|
import com.massivecraft.factions.util.RelationUtil;
|
||||||
import com.massivecraft.massivecore.CaseInsensitiveComparator;
|
|
||||||
import com.massivecraft.massivecore.Named;
|
import com.massivecraft.massivecore.Named;
|
||||||
import com.massivecraft.massivecore.Predicate;
|
|
||||||
import com.massivecraft.massivecore.collections.MassiveMapDef;
|
import com.massivecraft.massivecore.collections.MassiveMapDef;
|
||||||
import com.massivecraft.massivecore.collections.MassiveTreeSetDef;
|
import com.massivecraft.massivecore.collections.MassiveTreeSetDef;
|
||||||
|
import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive;
|
||||||
import com.massivecraft.massivecore.mixin.Mixin;
|
import com.massivecraft.massivecore.mixin.Mixin;
|
||||||
import com.massivecraft.massivecore.money.Money;
|
import com.massivecraft.massivecore.money.Money;
|
||||||
|
import com.massivecraft.massivecore.predicate.Predicate;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.store.Entity;
|
import com.massivecraft.massivecore.store.Entity;
|
||||||
import com.massivecraft.massivecore.store.SenderColl;
|
import com.massivecraft.massivecore.store.SenderColl;
|
||||||
@ -138,7 +138,7 @@ public class Faction extends Entity<Faction> implements EconomyParticipator, Nam
|
|||||||
// This is the ids of the invited players.
|
// This is the ids of the invited players.
|
||||||
// They are actually "senderIds" since you can invite "@console" to your faction.
|
// They are actually "senderIds" since you can invite "@console" to your faction.
|
||||||
// Null means no one is invited
|
// Null means no one is invited
|
||||||
private MassiveTreeSetDef<String, CaseInsensitiveComparator> invitedPlayerIds = new MassiveTreeSetDef<String, CaseInsensitiveComparator>(CaseInsensitiveComparator.get());
|
private MassiveTreeSetDef<String, ComparatorCaseInsensitive> invitedPlayerIds = new MassiveTreeSetDef<String, ComparatorCaseInsensitive>(ComparatorCaseInsensitive.get());
|
||||||
|
|
||||||
// The keys in this map are factionIds.
|
// The keys in this map are factionIds.
|
||||||
// Null means no special relation whishes.
|
// Null means no special relation whishes.
|
||||||
@ -451,7 +451,7 @@ public class Faction extends Entity<Faction> implements EconomyParticipator, Nam
|
|||||||
public void setInvitedPlayerIds(Collection<String> invitedPlayerIds)
|
public void setInvitedPlayerIds(Collection<String> invitedPlayerIds)
|
||||||
{
|
{
|
||||||
// Clean input
|
// Clean input
|
||||||
MassiveTreeSetDef<String, CaseInsensitiveComparator> target = new MassiveTreeSetDef<String, CaseInsensitiveComparator>(CaseInsensitiveComparator.get());
|
MassiveTreeSetDef<String, ComparatorCaseInsensitive> target = new MassiveTreeSetDef<String, ComparatorCaseInsensitive>(ComparatorCaseInsensitive.get());
|
||||||
if (invitedPlayerIds != null)
|
if (invitedPlayerIds != null)
|
||||||
{
|
{
|
||||||
for (String invitedPlayerId : invitedPlayerIds)
|
for (String invitedPlayerId : invitedPlayerIds)
|
||||||
|
@ -4,11 +4,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.massivecraft.factions.event.EventFactionsCreateFlags;
|
import com.massivecraft.factions.event.EventFactionsCreateFlags;
|
||||||
import com.massivecraft.massivecore.Named;
|
import com.massivecraft.massivecore.Named;
|
||||||
import com.massivecraft.massivecore.PredicateIsRegistered;
|
|
||||||
import com.massivecraft.massivecore.Prioritized;
|
import com.massivecraft.massivecore.Prioritized;
|
||||||
import com.massivecraft.massivecore.PriorityComparator;
|
|
||||||
import com.massivecraft.massivecore.Registerable;
|
import com.massivecraft.massivecore.Registerable;
|
||||||
import com.massivecraft.massivecore.collections.MassiveList;
|
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.store.Entity;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ public class MFlag extends Entity<MFlag> implements Prioritized, Registerable, N
|
|||||||
{
|
{
|
||||||
setupStandardFlags();
|
setupStandardFlags();
|
||||||
new EventFactionsCreateFlags(isAsync).run();
|
new EventFactionsCreateFlags(isAsync).run();
|
||||||
return MFlagColl.get().getAll(PredicateIsRegistered.get(), PriorityComparator.get());
|
return MFlagColl.get().getAll(PredicateIsRegistered.get(), ComparatorPriority.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setupStandardFlags()
|
public static void setupStandardFlags()
|
||||||
|
@ -13,10 +13,10 @@ import com.massivecraft.factions.Rel;
|
|||||||
import com.massivecraft.factions.TerritoryAccess;
|
import com.massivecraft.factions.TerritoryAccess;
|
||||||
import com.massivecraft.factions.event.EventFactionsCreatePerms;
|
import com.massivecraft.factions.event.EventFactionsCreatePerms;
|
||||||
import com.massivecraft.massivecore.Named;
|
import com.massivecraft.massivecore.Named;
|
||||||
import com.massivecraft.massivecore.PredicateIsRegistered;
|
|
||||||
import com.massivecraft.massivecore.Prioritized;
|
import com.massivecraft.massivecore.Prioritized;
|
||||||
import com.massivecraft.massivecore.PriorityComparator;
|
|
||||||
import com.massivecraft.massivecore.Registerable;
|
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.ps.PS;
|
||||||
import com.massivecraft.massivecore.store.Entity;
|
import com.massivecraft.massivecore.store.Entity;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
@ -99,7 +99,7 @@ public class MPerm extends Entity<MPerm> implements Prioritized, Registerable, N
|
|||||||
setupStandardPerms();
|
setupStandardPerms();
|
||||||
new EventFactionsCreatePerms().run();
|
new EventFactionsCreatePerms().run();
|
||||||
|
|
||||||
return MPermColl.get().getAll(PredicateIsRegistered.get(), PriorityComparator.get());
|
return MPermColl.get().getAll(PredicateIsRegistered.get(), ComparatorPriority.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setupStandardPerms()
|
public static void setupStandardPerms()
|
||||||
|
@ -5,8 +5,8 @@ import java.util.Map;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import com.massivecraft.massivecore.CaseInsensitiveComparator;
|
|
||||||
import com.massivecraft.massivecore.collections.MassiveTreeMap;
|
import com.massivecraft.massivecore.collections.MassiveTreeMap;
|
||||||
|
import com.massivecraft.massivecore.comparator.ComparatorCaseInsensitive;
|
||||||
|
|
||||||
public class EventFactionsExpansions extends EventFactionsAbstractSender
|
public class EventFactionsExpansions extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
@ -22,7 +22,7 @@ public class EventFactionsExpansions extends EventFactionsAbstractSender
|
|||||||
// FIELDS
|
// FIELDS
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private final MassiveTreeMap<String, Boolean, CaseInsensitiveComparator> expansions = new MassiveTreeMap<String, Boolean, CaseInsensitiveComparator>(CaseInsensitiveComparator.get());
|
private final MassiveTreeMap<String, Boolean, ComparatorCaseInsensitive> expansions = new MassiveTreeMap<String, Boolean, ComparatorCaseInsensitive>(ComparatorCaseInsensitive.get());
|
||||||
public Map<String, Boolean> getExpansions() { return this.expansions; }
|
public Map<String, Boolean> getExpansions() { return this.expansions; }
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
Loading…
Reference in New Issue
Block a user