diff --git a/src/com/massivecraft/factions/Board.java b/src/com/massivecraft/factions/Board.java index e9b10caa..25473cb9 100644 --- a/src/com/massivecraft/factions/Board.java +++ b/src/com/massivecraft/factions/Board.java @@ -18,7 +18,7 @@ import com.massivecraft.mcore.store.Entity; import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; -public class Board extends Entity implements BoardInterface +public class Board extends Entity implements BoardInterface { public static final transient Type MAP_TYPE = new TypeToken>(){}.getType(); diff --git a/src/com/massivecraft/factions/BoardColl.java b/src/com/massivecraft/factions/BoardColl.java index 6e114427..4212f0cf 100644 --- a/src/com/massivecraft/factions/BoardColl.java +++ b/src/com/massivecraft/factions/BoardColl.java @@ -15,7 +15,7 @@ import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; -public class BoardColl extends Coll implements BoardInterface +public class BoardColl extends Coll implements BoardInterface { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -25,7 +25,7 @@ public class BoardColl extends Coll implements BoardInterface public static BoardColl get() { return i; } private BoardColl() { - super(MStore.getDb(ConfServer.dburi), Factions.get(), "ai", Const.COLLECTION_BASENAME_BOARD, Board.class, String.class, true); + super(MStore.getDb(ConfServer.dburi), Factions.get(), "uuid", Const.COLLECTION_BASENAME_BOARD, Board.class, true); } // -------------------------------------------- // diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index b87bac9b..d6d081db 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -17,7 +17,7 @@ import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.xlib.gson.annotations.SerializedName; -public class Faction extends Entity implements EconomyParticipator +public class Faction extends Entity implements EconomyParticipator { // -------------------------------------------- // // META diff --git a/src/com/massivecraft/factions/FactionColl.java b/src/com/massivecraft/factions/FactionColl.java index a77aceda..e28033e5 100644 --- a/src/com/massivecraft/factions/FactionColl.java +++ b/src/com/massivecraft/factions/FactionColl.java @@ -9,7 +9,6 @@ import org.bukkit.ChatColor; import com.massivecraft.mcore.store.Coll; import com.massivecraft.mcore.store.MStore; -import com.massivecraft.mcore.store.idstrategy.IdStrategyAiAbstract; import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; @@ -17,7 +16,7 @@ import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.util.MiscUtil; -public class FactionColl extends Coll +public class FactionColl extends Coll { // -------------------------------------------- // // INSTANCE & CONSTRUCT @@ -27,7 +26,7 @@ public class FactionColl extends Coll public static FactionColl get() { return i; } private FactionColl() { - super(MStore.getDb(ConfServer.dburi), Factions.get(), "ai", Const.COLLECTION_BASENAME_FACTION, Faction.class, String.class, false); + super(MStore.getDb(ConfServer.dburi), Factions.get(), "uuid", Const.COLLECTION_BASENAME_FACTION, Faction.class, false); } // -------------------------------------------- // @@ -65,34 +64,15 @@ public class FactionColl extends Coll Type type = new TypeToken>(){}.getType(); Map id2faction = Factions.get().gson.fromJson(DiscUtil.readCatch(oldFile), type); - // We need to find the next AI id! - int highestId = 0; - // Set the data for (Entry entry : id2faction.entrySet()) { String factionId = entry.getKey(); Faction faction = entry.getValue(); - try - { - int intFactionId = Integer.valueOf(factionId); - if (highestId < intFactionId) - { - highestId = intFactionId; - } - } - catch (Exception e) - { - // Just ignore - } - FactionColl.get().create(factionId).load(faction); } - IdStrategyAiAbstract idStrategy = (IdStrategyAiAbstract) FactionColl.get().getIdStrategy(); - idStrategy.setNext(this, highestId + 1); - // Mark as migrated oldFile.renameTo(newFile); }