diff --git a/forge-game/src/main/java/forge/game/GameFormat.java b/forge-game/src/main/java/forge/game/GameFormat.java index 28e0fe3ba2d..84821c57913 100644 --- a/forge-game/src/main/java/forge/game/GameFormat.java +++ b/forge-game/src/main/java/forge/game/GameFormat.java @@ -280,6 +280,11 @@ public class GameFormat implements Comparable { } return result; } + + @Override + public void add(GameFormat item) { + naturallyOrdered.add(item); + } } public final Predicate editionLegalPredicate = new Predicate() { diff --git a/forge-gui/src/main/java/forge/model/FModel.java b/forge-gui/src/main/java/forge/model/FModel.java index fc37861ff0a..b6ea6ab34bc 100644 --- a/forge-gui/src/main/java/forge/model/FModel.java +++ b/forge-gui/src/main/java/forge/model/FModel.java @@ -93,6 +93,8 @@ public final class FModel { private static IStorage worlds; private static GameFormat.Collection formats; + private static GameFormat.Collection customFormats; + public static void initialize(final IProgressBar progressBar, Function adjustPrefs) { ImageKeys.initializeDirs( ForgeConstants.CACHE_CARD_PICS_DIR, ForgeConstants.CACHE_CARD_PICS_SUBDIR, @@ -162,6 +164,12 @@ public final class FModel { ForgePreferences.UPLOAD_DRAFT = ForgePreferences.NET_CONN; formats = new GameFormat.Collection(new GameFormat.Reader(new File(ForgeConstants.BLOCK_DATA_DIR + "formats.txt"))); + //add user custom formats if file present + customFormats = new GameFormat.Collection(new GameFormat.Reader(new File(ForgeConstants.USER_PREFS_DIR + "customformats.txt"))); + for (GameFormat format:customFormats){ + formats.add(format); + } + blocks = new StorageBase<>("Block definitions", new CardBlock.Reader(ForgeConstants.BLOCK_DATA_DIR + "blocks.txt", magicDb.getEditions())); questPreferences = new QuestPreferences(); conquestPreferences = new ConquestPreferences();