PublicAPI icon indicating copy to clipboard operation
PublicAPI copied to clipboard

Adding new pets + reordering pets.

Open Picsou993 opened this issue 3 years ago • 5 comments

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

Picsou993 avatar Dec 09 '21 02:12 Picsou993

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.

TheNullicorn avatar Dec 09 '21 02:12 TheNullicorn

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 avatar Dec 11 '21 02:12 ConnorLinfoot

@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.

ConnorLinfoot avatar Dec 11 '21 13:12 ConnorLinfoot

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

TheNullicorn avatar Dec 11 '21 15:12 TheNullicorn

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 avatar Dec 11 '21 15:12 ConnorLinfoot

Closed in favor of #557

ConnorLinfoot avatar Jun 26 '23 09:06 ConnorLinfoot