HypixelDev / PublicAPI

Official Java implementation of the Hypixel Public API.
https://api.hypixel.net
MIT License
533 stars 152 forks source link

Adding new pets + reordering pets. #495

Closed Picsou993 closed 1 year ago

Picsou993 commented 2 years ago

Adding all new pets with their name and rarity and reordering all pets to use the Collectibles Menu Format.

TheNullicorn commented 2 years ago

Alternatively, could PetTypes get its own /resource endpoint? I don't know how much work that would entail on the backend, but I think it would be nicer than maintaining a 120+ element enum for a feature that (I assume) isn't used very frequently.

ConnorLinfoot commented 2 years ago

mfw I didn't even know this code existed 🙃 we should definitely look at a resource endpoint and look at hooking that in. I will see if I can get to that soon and then you can feel free to implement that into the Java API if you wish 🙂

ConnorLinfoot commented 2 years ago

@Picsou993 I've added 2 new resources to the API, one for pets and one for companions. You can see it here https://api.hypixel.net/#tag/Resources/paths/~1resources~1vanity~1pets/get

For implementation, I would suggest adding methods to poll these endpoints as objects, so there is a similar result as with the enum. As for the enum, I think it's best we deprecate it with a link to the new methods, so then there aren't any breaking changes if developers are relying on this.

I'm not sure if other vanity based information would ever be useful, but we could look at expanding it in the future if people see uses for it.

TheNullicorn commented 2 years ago

Is the plan to keep the enum going as well, or drop it in favor of the resource?

ConnorLinfoot commented 2 years ago

Is the plan to keep the enum going as well, or drop it in favor of the resource?

Personally, I think the best idea is to just deprecate and no longer update the enum. And instead, build "Pet" objects based on the resource or similar, so the end result to someone using the API would be the same but just not using the enum.

ConnorLinfoot commented 1 year ago

Closed in favor of #557