McModLauncher / modlauncher

Java 21 mod launcher
Other
171 stars 47 forks source link

Fix returning GAME layer resources from beginScanning #108

Closed Su5eD closed 1 year ago

Su5eD commented 2 years ago

The issue

According to its javadoc, ITransformationService#beginScanning should be able to return resources for both PLUGIN and GAME layers. However, due to a bug, GAME resources returned from this function are never used. This happens because the initial scan results are replaced with new ones just before we collect resources for that layer. See the reported issue for full details:

The solution

Instead of overwriting existing scan results with new ones from ITransformationService#completeScan, we assign them to a separate variable. Then, we query both old and new scan data when collecting resources for the GAME layer.

cpw commented 1 year ago

This looks like a bug needing a fix...