KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
679 stars 104 forks source link

feat(api): Expand the supported resource pack operations for 1.20.3 #1005

Closed zml2008 closed 6 months ago

zml2008 commented 6 months ago

This PR makes it easy to handle multiple resource packs, and adds a callback system to track pack application.

(note, this does change some API used in snapshots so it'd be a binary break for any current testers)

zml2008 commented 6 months ago

hm, looking at adding Iterable overloads, type erasure means we can't support all the individual types for each method. Right now, i feel like the best signature for implementations would be thing(List<RPRequest>), where for API end users, the thing(Iterable<? extends RPRequestLike>) signature would make most sense -- but then we have to be careful about unboxing *Like instances pretty eagerly maybe?

zml2008 commented 6 months ago

Looking at Vanilla again, it appears that while the client will accept multiple packs, it only uses the last required and prompt values sent, not one per pack. Maybe we want to push those values up to Request from Info?