villChurch / AnimalCrossingNewHorizonAPI

API for Animal Crossing New Horizon data.
MIT License
0 stars 0 forks source link

InsectPun, FishPun and Artwork Controller can throw IndexOutOfBounds #7

Closed villChurch closed 4 years ago

villChurch commented 4 years ago

Currently the random implementation in InsectPunController, FishPunController and ArtworkController isn't right and can return an out of bounds number. This is because its been set to return a number between 0 and the size of all puns but the list is 0 indexed so the max value is size -1 not size.

Also it would be better to use ThreadLocalRandom instead of the Math.random

villChurch commented 4 years ago

Completed on master and push live