Fix async alias loading on 1.19.4 #7247
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes async alias loading on 1.19.4's JUnit run.
What went wrong
While loading the aliases, SimpleEntityData's simple entities would be registered on the alias thread. This would then be registered into EntityData by registering
simple
. After this, parsing would start on the alias thread, specifically the (simple) entityspectral arrow
. While this was happening, the code for registering non-simple EntityDatas would run, which modified the EntityData iterator while parsing ofspectral arrow
(or sometimesarrow
) was ongoing, causing the exception.Solution
As the alias thread seems to only start parsing simple entities when it has completed, my solution is to avoid allowing modification of the iterator while looping. So far, this has not resulted in any problems.
Before, this error would occur on about 2/3rds of my test runs. This seems fixed now, though.
Target Minecraft Versions: 1.19.4
Requirements: none
Related Issues: none