Skip to content

Conversation

Picsou993
Copy link

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

Adding all new pets with their name and rarity and reordering all pets to use the Collectibles Menu Format.
@TheNullicorn
Copy link
Contributor

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
Copy link
Member

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
Copy link
Member

ConnorLinfoot commented Dec 11, 2021

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

builder-247 added a commit to HypixelDatabase/HypixelTracking that referenced this pull request Dec 11, 2021
* Add pets and companions to ResourceType.
@TheNullicorn
Copy link
Contributor

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

@ConnorLinfoot
Copy link
Member

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
Copy link
Member

Closed in favor of #557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants