SpongeAPI
SpongeAPI copied to clipboard
[API-8] Expose PaginationCalculator
Closes #2138.
Also, this could target api-7 as well.
I think it's worth noting in the documentation that this assumes the vanilla font. In ChatUILib I have FontData
which reads a .png to determine character sizes, allowing non-vanilla ascii.png measurements.
For unicode characters there's glyph_sizes.bin
, though I'm not sure if this is modifiable in a datapack.
Also, to centre text means knowing the width of the chat box. SpongeCommon assumes the default (320), but it is customizable (see https://ore.spongepowered.org/simon816/Chat-UI-Library#player-settings)
I think it's entirely fine that the Sponge Common implementation only supports vanilla content. Perhaps it could be expanded to be able to load data from resource packs and automatically configure based on the server pack, but it is a service and can be replaced by other more customizable implementations.
Another theoretical implementation could integrate with a client mod that passed the necessary sizing and resource pack information to the server,but that would be imo out of scope for sponge itself. However, to make this more friendly to such an implementation, the getCalculator
method should probably take a Player
parameter?
This has sat around for some time - what do we want to do with this?
Hey! You seem to be running an unsupported version (API 8) of SpongeAPI. Support for API 8 ended in October 2023.
API-8 is now end-of-life. We will not be issuing any more API updates for version 8 of our API^1
As part of our legacy cleanup we are closing issues relating to API8/1.16
If you wish to move this forward, please rebase this PR on the current branch and reopen it.