Minebench / Tresor

An experimental VaultAPI compatible abstraction layer for Bukkit/Spigot/Paper plugins
https://ci.minebench.de/job/Tresor/
GNU General Public License v3.0
8 stars 3 forks source link

Placeholders #9

Open Phoenix616 opened 2 years ago

Phoenix616 commented 2 years ago

Issuehunt badges

Add a provider abstractions for the different placeholder systems.


IssueHunt Summary ### Backers (Total: $20.00) - [phoenix616 phoenix616](https://oss.issuehunt.io/u/phoenix616) ($20.00) ### Submitted pull Requests - [#29 placeholder abstraction](https://oss.issuehunt.io/r/Minebench/Tresor/pull/29) --- #### [Become a backer now!](https://oss.issuehunt.io/r/Minebench/Tresor/issues/9) #### [Or submit a pull request to get the deposits!](https://oss.issuehunt.io/r/Minebench/Tresor/issues/9) ### Tips - Checkout the [Issuehunt explorer](https://oss.issuehunt.io/r/Minebench/Tresor/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://oss.issuehunt.io/r/new) on IssueHunt to raise funds.
issuehunt-oss[bot] commented 2 months ago

@phoenix616 has funded $20.00 to this issue.


IllusionTheDev commented 2 months ago

The main issue I'm seeing here is the required underscore with PlaceholderAPI but not with MVDW, as well as the PAPI and MVDW formats being different (%name_value% vs {name}). For more specific placeholders ("%island_top_1%") it'd be great to build some kind of context tree. Not sure how fancy I'd like this to be

Phoenix616 commented 2 months ago

I don't think the format difference would be a big issue. The basis is the same after all: A key which gets mapped to a value. How that key is replaced and represented internally in the plugins providing the service interface shouldn't really matter for the interface itself. Imo. an interface providing simple key -> value mapping as well as utility methods to replace in strings should be enough. (Although the more I think about text-related stuff I realise that with components being a thing this might get a lot more complicated as we would ideally want component support in the api but not all platforms or plugins use the same ones (Adventure vs. Bungee-Chat vs. other libraries/NMS access). I guess for now a simple string placeholder querying and replacement would be enough and components support could be part of #8, maybe once the ecosystem finally settles on one implementation...)