From 5569f18053b57f239e8bda8583e007dd92aba93a Mon Sep 17 00:00:00 2001 From: Eradev Date: Thu, 21 Aug 2025 11:10:06 -0400 Subject: [PATCH] Remove param --- forge-gui/src/main/java/forge/model/FModel.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/forge-gui/src/main/java/forge/model/FModel.java b/forge-gui/src/main/java/forge/model/FModel.java index e38691f5747..adc8c8464a2 100644 --- a/forge-gui/src/main/java/forge/model/FModel.java +++ b/forge-gui/src/main/java/forge/model/FModel.java @@ -408,8 +408,7 @@ public final class FModel { final List typeListFile = FileUtil.readFile(ForgeConstants.TYPE_LIST_FILE); - Set addTo = null; - loadTypes(addTo, typeListFile); + loadTypes(typeListFile); File customTypesFilesDir = new File(ForgeConstants.USER_CUSTOM_TYPE_LIST_DIR); if (customTypesFilesDir.exists() && customTypesFilesDir.isDirectory()) { @@ -423,7 +422,7 @@ public final class FModel { for (File file : txtFiles) { try { final List customTypeListFile = FileUtil.readFile(file); - loadTypes(addTo, customTypeListFile); + loadTypes(customTypeListFile); } catch (Exception e) { System.err.println("Failed to load custom types from file " + file.getAbsolutePath()); } @@ -448,7 +447,9 @@ public final class FModel { } } - private static void loadTypes(Set addTo, List fileContent) { + private static void loadTypes(List fileContent) { + Set addTo = null; + for (final String s : fileContent) { if (s.equals("[BasicTypes]")) { addTo = CardType.Constant.BASIC_TYPES; @@ -471,6 +472,10 @@ public final class FModel { } else if (s.equals("[PlanarTypes]")) { addTo = CardType.Constant.PLANAR_TYPES; } else if (s.length() > 1) { + if (addTo == null) { + continue; + } + if (s.contains(":")) { String[] k = s.split(":");