From 4165d4e01f3eb44040a5a379536ad6a65b238088 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 23 Jun 2016 11:54:41 +0200 Subject: [PATCH] MassiveCore - Automatic Collection Constructors --- src/com/massivecraft/factions/Const.java | 2 +- src/com/massivecraft/factions/entity/BoardColl.java | 4 ---- src/com/massivecraft/factions/entity/FactionColl.java | 6 ------ src/com/massivecraft/factions/entity/MConfColl.java | 7 ------- src/com/massivecraft/factions/entity/MFlagColl.java | 4 ---- src/com/massivecraft/factions/entity/MPermColl.java | 4 ---- src/com/massivecraft/factions/entity/MPlayerColl.java | 6 ------ src/com/massivecraft/factions/update/OldConfColl.java | 6 ++---- 8 files changed, 3 insertions(+), 36 deletions(-) diff --git a/src/com/massivecraft/factions/Const.java b/src/com/massivecraft/factions/Const.java index 0f1f9750..7f68a1e6 100644 --- a/src/com/massivecraft/factions/Const.java +++ b/src/com/massivecraft/factions/Const.java @@ -22,7 +22,7 @@ public class Const public static final int MAP_HEIGHT = 8; public static final int MAP_HEIGHT_FULL = 17; - public static final char[] MAP_KEY_CHARS = "\\/#?笣$%=&^ABCDEFGHJKLMNOPQRSTUVWXYZÄÖÜÆØÅ1234567890abcdeghjmnopqrsuvwxyÿzäöüæøåâêîûô".toCharArray(); + public static final char[] MAP_KEY_CHARS = "\\/#?笣$%=&^ABCDEFGHJKLMNOPQRSTUVWXYZ������1234567890abcdeghjmnopqrsuvwxy�z�����������".toCharArray(); public static final String MAP_KEY_WILDERNESS = ChatColor.GRAY.toString() + "-"; public static final String MAP_KEY_SEPARATOR = ChatColor.AQUA.toString() + "+"; public static final String MAP_KEY_OVERFLOW = ChatColor.MAGIC.toString() + "-" + ChatColor.RESET.toString(); diff --git a/src/com/massivecraft/factions/entity/BoardColl.java b/src/com/massivecraft/factions/entity/BoardColl.java index 6312782d..51682f5f 100644 --- a/src/com/massivecraft/factions/entity/BoardColl.java +++ b/src/com/massivecraft/factions/entity/BoardColl.java @@ -9,15 +9,12 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import com.massivecraft.factions.Const; -import com.massivecraft.factions.Factions; import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.massivecore.collections.MassiveMap; import com.massivecraft.massivecore.collections.MassiveSet; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.store.Coll; -import com.massivecraft.massivecore.store.MStore; import com.massivecraft.massivecore.util.MUtil; public class BoardColl extends Coll implements BoardInterface @@ -30,7 +27,6 @@ public class BoardColl extends Coll implements BoardInterface public static BoardColl get() { return i; } private BoardColl() { - super(Const.COLLECTION_BOARD, Board.class, MStore.getDb(), Factions.get()); this.setCreative(true); this.setLowercasing(true); } diff --git a/src/com/massivecraft/factions/entity/FactionColl.java b/src/com/massivecraft/factions/entity/FactionColl.java index 767510fa..f61f87b5 100644 --- a/src/com/massivecraft/factions/entity/FactionColl.java +++ b/src/com/massivecraft/factions/entity/FactionColl.java @@ -3,9 +3,7 @@ package com.massivecraft.factions.entity; import java.util.*; import com.massivecraft.massivecore.store.Coll; -import com.massivecraft.massivecore.store.MStore; import com.massivecraft.massivecore.util.Txt; -import com.massivecraft.factions.Const; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Rel; import com.massivecraft.factions.integration.Econ; @@ -19,10 +17,6 @@ public class FactionColl extends Coll private static FactionColl i = new FactionColl(); public static FactionColl get() { return i; } - private FactionColl() - { - super(Const.COLLECTION_FACTION, Faction.class, MStore.getDb(), Factions.get()); - } // -------------------------------------------- // // STACK TRACEABILITY diff --git a/src/com/massivecraft/factions/entity/MConfColl.java b/src/com/massivecraft/factions/entity/MConfColl.java index 2716bbb8..ee4b683c 100644 --- a/src/com/massivecraft/factions/entity/MConfColl.java +++ b/src/com/massivecraft/factions/entity/MConfColl.java @@ -1,10 +1,7 @@ package com.massivecraft.factions.entity; -import com.massivecraft.factions.Const; -import com.massivecraft.factions.Factions; import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.store.Coll; -import com.massivecraft.massivecore.store.MStore; public class MConfColl extends Coll { @@ -14,10 +11,6 @@ public class MConfColl extends Coll private static MConfColl i = new MConfColl(); public static MConfColl get() { return i; } - private MConfColl() - { - super(Const.COLLECTION_MCONF, MConf.class, MStore.getDb(), Factions.get()); - } // -------------------------------------------- // // STACK TRACEABILITY diff --git a/src/com/massivecraft/factions/entity/MFlagColl.java b/src/com/massivecraft/factions/entity/MFlagColl.java index 9ec9c1c2..80f37d0c 100644 --- a/src/com/massivecraft/factions/entity/MFlagColl.java +++ b/src/com/massivecraft/factions/entity/MFlagColl.java @@ -3,10 +3,7 @@ package com.massivecraft.factions.entity; import java.util.ArrayList; import java.util.List; -import com.massivecraft.factions.Const; -import com.massivecraft.factions.Factions; import com.massivecraft.massivecore.store.Coll; -import com.massivecraft.massivecore.store.MStore; public class MFlagColl extends Coll { @@ -18,7 +15,6 @@ public class MFlagColl extends Coll public static MFlagColl get() { return i; } private MFlagColl() { - super(Const.COLLECTION_MFLAG, MFlag.class, MStore.getDb(), Factions.get()); this.setLowercasing(true); } diff --git a/src/com/massivecraft/factions/entity/MPermColl.java b/src/com/massivecraft/factions/entity/MPermColl.java index ba61f733..16bcc5be 100644 --- a/src/com/massivecraft/factions/entity/MPermColl.java +++ b/src/com/massivecraft/factions/entity/MPermColl.java @@ -3,10 +3,7 @@ package com.massivecraft.factions.entity; import java.util.ArrayList; import java.util.List; -import com.massivecraft.factions.Const; -import com.massivecraft.factions.Factions; import com.massivecraft.massivecore.store.Coll; -import com.massivecraft.massivecore.store.MStore; public class MPermColl extends Coll { @@ -18,7 +15,6 @@ public class MPermColl extends Coll public static MPermColl get() { return i; } private MPermColl() { - super(Const.COLLECTION_MPERM, MPerm.class, MStore.getDb(), Factions.get()); this.setLowercasing(true); } diff --git a/src/com/massivecraft/factions/entity/MPlayerColl.java b/src/com/massivecraft/factions/entity/MPlayerColl.java index 028e1458..2c7affb3 100644 --- a/src/com/massivecraft/factions/entity/MPlayerColl.java +++ b/src/com/massivecraft/factions/entity/MPlayerColl.java @@ -4,9 +4,7 @@ import java.util.Collection; import org.bukkit.Bukkit; -import com.massivecraft.factions.Const; import com.massivecraft.factions.Factions; -import com.massivecraft.massivecore.store.MStore; import com.massivecraft.massivecore.store.SenderColl; import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.Txt; @@ -19,10 +17,6 @@ public class MPlayerColl extends SenderColl private static MPlayerColl i = new MPlayerColl(); public static MPlayerColl get() { return i; } - private MPlayerColl() - { - super(Const.COLLECTION_MPLAYER, MPlayer.class, MStore.getDb(), Factions.get()); - } // -------------------------------------------- // // STACK TRACEABILITY diff --git a/src/com/massivecraft/factions/update/OldConfColl.java b/src/com/massivecraft/factions/update/OldConfColl.java index 2822e063..44b5bfda 100644 --- a/src/com/massivecraft/factions/update/OldConfColl.java +++ b/src/com/massivecraft/factions/update/OldConfColl.java @@ -1,9 +1,7 @@ package com.massivecraft.factions.update; -import com.massivecraft.factions.Factions; import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.store.Coll; -import com.massivecraft.massivecore.store.MStore; public class OldConfColl extends Coll { @@ -11,9 +9,9 @@ public class OldConfColl extends Coll // CONSTRUCT // -------------------------------------------- // - public OldConfColl(String name) + public OldConfColl(String id) { - super(name, OldConf.class, MStore.getDb(), Factions.get()); + super(id); } // -------------------------------------------- //