WiIIiam278 / PAPIProxyBridge

A bridge library plugin for using PlaceholderAPI on proxy servers
https://william278.net/project/papiproxybridge
Apache License 2.0
37 stars 11 forks source link

feat: add instance creator and handle velocity event #66

Closed Jarva closed 1 year ago

Jarva commented 1 year ago

Adds the ability to create instances of PlaceholderAPI to manage caching separately

Also fixes an issue where the Velocity event for the placeholder was still forwarded to the client

Jarva commented 1 year ago

I've updated the documentation to mention the new method in getInstance and updated the readme to reflect the multi-instance based approach, I'd prefer to deprecate getInstance, alternatively we could transparently change getInstance to provide a new instance each time? Shouldn't impact usage given only one plugin uses expiry currently?

WiIIiam278 commented 1 year ago

alternatively we could transparently change getInstance to provide a new instance each time? Shouldn't impact usage given only one plugin uses expiry currently?

This would break setups that call #getInstance() each time to set the cache time / make a placeholder query rather than saving the instance.

given only one plugin uses expiry currently?

Not sure exactly how popular this feature is, but it is a relatively smaller feature at least. Tbh though, I suspect devs calling the setCacheExpiry method probably aren't running getInstance() every time (at least, I'd like to think); it also wouldn't be particularly breaking as correcting the functionality.

I suggest we deprecate getInstance(), add an @apiNote about this change to the JavaDocs & make it clear in the changelogs, and have getInstance() start serving unique instances (mirroring createInstance())

Jarva commented 1 year ago

Updated as requested