From 7f911d602c00c8830bff22253655d8cd06d554a5 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Sun, 11 Jun 2017 19:47:54 +0200 Subject: [PATCH] Restore proper activation order of Faction collections --- src/com/massivecraft/factions/Factions.java | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index 24fb98ab..b5e093c5 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -9,9 +9,16 @@ import com.massivecraft.factions.cmd.type.TypeFactionChunkChangeType; import com.massivecraft.factions.cmd.type.TypeRel; import com.massivecraft.factions.engine.EngineEcon; import com.massivecraft.factions.entity.Board; +import com.massivecraft.factions.entity.BoardColl; +import com.massivecraft.factions.entity.FactionColl; +import com.massivecraft.factions.entity.MConfColl; +import com.massivecraft.factions.entity.MFlagColl; +import com.massivecraft.factions.entity.MPermColl; +import com.massivecraft.factions.entity.MPlayerColl; import com.massivecraft.factions.event.EventFactionsChunkChangeType; import com.massivecraft.factions.mixin.PowerMixin; import com.massivecraft.massivecore.MassivePlugin; +import com.massivecraft.massivecore.collections.MassiveList; import com.massivecraft.massivecore.command.type.RegistryType; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.xlib.gson.GsonBuilder; @@ -72,6 +79,27 @@ public class Factions extends MassivePlugin } + @Override + public List> getClassesActiveColls() + { + // MConf should always be activated first for all plugins. It's simply a standard. The config should have no dependencies. + // MFlag and MPerm are both dependency free. + // Next we activate Faction, MPlayer and Board. The order is carefully chosen based on foreign keys and indexing direction. + // MPlayer --> Faction + // We actually only have an index that we maintain for the MPlayer --> Faction one. + // The Board could currently be activated in any order but the current placement is an educated guess. + // In the future we might want to find all chunks from the faction or something similar. + // We also have the /f access system where the player can be granted specific access, possibly supporting the idea of such a reverse index. + return new MassiveList>( + MConfColl.class, + MFlagColl.class, + MPermColl.class, + FactionColl.class, + MPlayerColl.class, + BoardColl.class + ); + } + @Override public List> getClassesActiveEngines() {