Registered placeholders are not displayed properly
PapiCapi opened this issue ยท 2 comments
Confirmation
- I have read the FAQ.
- I have tested the latest development build of Holographic Displays and the bug is still present.
- I have updated Spigot to the latest release for my particular Minecraft version.
- I made sure the bug hasn't already been reported on the issue tracker.
Description
Registering placeholders using the API ( v2 ) does not seems to work anymore.
How to reproduce
- Create a plugin containing :
HologramsAPI.registerPlaceholder(this, "%papicapi_placeholder%", 1, new PlaceholderReplacer() {
@Override
public String update() {
return "Placeholders are working";
}
});
- Create a hologram with this placeholder inside.
- It displays only "%papicapi_placeholder%"
Server version
This server is running Paper version git-Paper-130 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: eb98398) You are 20 version(s) behind Download the new version at: https://papermc.io/downloads Previous version: git-Paper-404 (MC: 1.17.1)
Holographic Displays version
HolographicDisplays version 3.0.0-SNAPSHOT-b191
Installed plugins that allow players to join with multiple Minecraft versions
ViaVersion, ViaBackwards
Additional information
I saw other reports about the placeholders and i suppose their issues are related to mine but none was talking about the API.
Unfortunately old placeholders did not have strict rules on formatting, so they were more like arbitrary replacements. The fix is to wrap automatically with curly braces those who do not respect the traditional format, in your example you would need to use {%papicapi_placeholder%}
to display it, even if you registered it as %papicapi_placeholder%
. The plugin will also print a warning when they are registered to inform server admins.