Fix TropicalFishData spawning incorrect type#7744
Conversation
APickledWalrus
left a comment
There was a problem hiding this comment.
Looks good. Is moving the generic pattern "tropical fish" to the end necessary though? Wouldn't patterns[matchedPattern - 1] also work? Not a major issue though, just curious.
In truth when I was making this pr, I knew next to nothing about the handling of entitydata, due to lack of javadocs and was also working on near zero hours of sleep. I could most likely swap this to being handled with match pattern -1. However I believe I'd prefer holding that off for now as I wouldn't be able to test it, and I believe it's likely best for a future PR to change this to use a enum implementation due to safety concerns regarding ordinals. |
Description
This PR aims to fix an issue with the TropticalFIsh entity data always spawning the next fish in enum ordinal instead of the expected type.
I.e. Snooper always was Dasher, Spotty was always Flopper, ect...
The fix for this was to not do
+ 1for ordinals and move "tropical fish" to the end of the code names listTarget Minecraft Versions: any
Requirements: none
Related Issues: none
Before
After
and just to show random still works when undefined
