Commit 9d130852895671692914f0d7378884d59f2c7861
1 parent
d97239f4
write warning message when file ending .litemod.zip is discovered.
Showing
1 changed file
with
16 additions
and
1 deletions
java/common/com/mumfrey/liteloader/core/api/EnumeratorModuleFolder.java
... | ... | @@ -114,6 +114,12 @@ public class EnumeratorModuleFolder implements FilenameFilter, EnumeratorModule |
114 | 114 | public boolean accept(File dir, String fileName) |
115 | 115 | { |
116 | 116 | fileName = fileName.toLowerCase(); |
117 | + | |
118 | + if (fileName.endsWith(".litemod.zip") && !this.readZipFiles) | |
119 | + { | |
120 | + LiteLoaderLogger.warning("Found %s with unsupported extension .litemod.zip. Please change file extension to .litemod to allow this file to be loaded!", fileName); | |
121 | + } | |
122 | + | |
117 | 123 | return fileName.endsWith(".litemod") |
118 | 124 | || (this.readZipFiles && fileName.endsWith(".zip")) |
119 | 125 | || (this.readJarFiles && fileName.endsWith(".jar")); |
... | ... | @@ -139,7 +145,7 @@ public class EnumeratorModuleFolder implements FilenameFilter, EnumeratorModule |
139 | 145 | */ |
140 | 146 | private void findValidFiles(ModularEnumerator enumerator) |
141 | 147 | { |
142 | - for (File candidateFile : this.directory.listFiles(this)) | |
148 | + for (File candidateFile : this.directory.listFiles(this.getFilenameFilter())) | |
143 | 149 | { |
144 | 150 | ZipFile candidateZip = null; |
145 | 151 | |
... | ... | @@ -196,6 +202,15 @@ public class EnumeratorModuleFolder implements FilenameFilter, EnumeratorModule |
196 | 202 | } |
197 | 203 | |
198 | 204 | /** |
205 | + * @return | |
206 | + */ | |
207 | + protected FilenameFilter getFilenameFilter() | |
208 | + { | |
209 | + // Stub for subclasses | |
210 | + return this; | |
211 | + } | |
212 | + | |
213 | + /** | |
199 | 214 | * @param candidateFile |
200 | 215 | * @param strVersion |
201 | 216 | */ | ... | ... |