Commit a8d48f3173f53b4f43f9eadfd881ee6edf427f30
1 parent
1d4f6f14
dependency check should ignore enumerator state
Showing
1 changed file
with
23 additions
and
4 deletions
java/common/com/mumfrey/liteloader/core/LiteLoaderEnumerator.java
| ... | ... | @@ -284,7 +284,7 @@ public class LiteLoaderEnumerator implements LoaderEnumerator |
| 284 | 284 | { |
| 285 | 285 | this.checkState(EnumeratorState.FINALISED, "getModMetaData"); |
| 286 | 286 | |
| 287 | - return this.getContainer(modClass).getMetaValue(metaDataKey, defaultValue); | |
| 287 | + return this.getContainerForMod(modClass).getMetaValue(metaDataKey, defaultValue); | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
| ... | ... | @@ -296,7 +296,17 @@ public class LiteLoaderEnumerator implements LoaderEnumerator |
| 296 | 296 | { |
| 297 | 297 | this.checkState(EnumeratorState.FINALISED, "getContainer"); |
| 298 | 298 | |
| 299 | - return this.enabledContainers.get(identifier); | |
| 299 | + return this.getContainerById(identifier); | |
| 300 | + } | |
| 301 | + | |
| 302 | + /** | |
| 303 | + * @param identifier | |
| 304 | + * @return | |
| 305 | + */ | |
| 306 | + private LoadableMod<?> getContainerById(String identifier) | |
| 307 | + { | |
| 308 | + LoadableMod<?> container = this.enabledContainers.get(identifier); | |
| 309 | + return container != null ? container : LoadableMod.NONE; | |
| 300 | 310 | } |
| 301 | 311 | |
| 302 | 312 | /** |
| ... | ... | @@ -308,6 +318,15 @@ public class LiteLoaderEnumerator implements LoaderEnumerator |
| 308 | 318 | { |
| 309 | 319 | this.checkState(EnumeratorState.FINALISED, "getContainer"); |
| 310 | 320 | |
| 321 | + return this.getContainerForMod(modClass); | |
| 322 | + } | |
| 323 | + | |
| 324 | + /** | |
| 325 | + * @param modClass | |
| 326 | + * @return | |
| 327 | + */ | |
| 328 | + private LoadableMod<?> getContainerForMod(Class<? extends LiteMod> modClass) | |
| 329 | + { | |
| 311 | 330 | for (ModInfo<LoadableMod<?>> mod : this.modsToLoad) |
| 312 | 331 | { |
| 313 | 332 | if (modClass.equals(mod.getModClass())) |
| ... | ... | @@ -825,8 +844,8 @@ public class LiteLoaderEnumerator implements LoaderEnumerator |
| 825 | 844 | { |
| 826 | 845 | circularDependencySet.add(dependency); |
| 827 | 846 | |
| 828 | - LoadableMod<?> dependencyContainer = this.getContainer(dependency); | |
| 829 | - if (dependencyContainer != null) | |
| 847 | + LoadableMod<?> dependencyContainer = this.getContainerById(dependency); | |
| 848 | + if (dependencyContainer != LoadableMod.NONE) | |
| 830 | 849 | { |
| 831 | 850 | if (this.environment.getEnabledModsList().isEnabled(this.environment.getProfile(), dependency)) |
| 832 | 851 | { | ... | ... |