Fix NoSuchElementException in EntityTransformEvent for slimes#12510
Merged
lynxplay merged 3 commits intoMay 2, 2025
Conversation
Contributor
|
I am a bit torn between early exiting there vs potentially just not running the event and skipping it if the list is for some reason empty. E.g. if there is some logic down below, an empty list of slimes to spawn should still run that, just not call the transform event given the slime isn't transforming into anything. |
… wake up and code its like code in the night :)
Instead of returning if slime list is empty, skip the event call and progress with the rest of the method (which is a noop rn). If for some reason slimes can normally be removed with size > 1 and no children (via e.g. future event calls prior), follow up logic should not be skipped because the transform event cannot be called.
5aa539c to
99d5160
Compare
lynxplay
approved these changes
May 2, 2025
Owen1212055
approved these changes
May 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to #12509 the current code from NMS can have the edge case where the slimes from a convertion can be null and not added to the list causing later pass an empty list to the event and fails when try to get the first entity, this PR just skip the call if that happen.
also include a minor cleanup of the event class