Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use "/" (slash) character in a pattern #76

Closed
Khotul opened this issue Jan 10, 2025 · 1 comment
Closed

Can't use "/" (slash) character in a pattern #76

Khotul opened this issue Jan 10, 2025 · 1 comment
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@Khotul
Copy link

Khotul commented Jan 10, 2025

Trying to make a pattern that uses two placeholder variables, with a slash character separating them

pattern: "[papi:player_health_rounded]/[papi:player_max_health_rounded]"

However it results in an error

this placeholder not found: [papi
(full stack trace at the bottom)

As far as I know, double slash (//) is used for dividing, but I don't want to divide, I want a displayable slash character.
I tried escaping it with a backslash \ \/ but it doesn't work sadly.

It works when I replace slash with another character, for example the letter M.
pattern: "[papi:player_health_rounded]M[papi:player_max_health_rounded]"
image

Full stacktrace of the error:

[18:21:48 INFO]: [BetterHud] Reloading HudManagerImpl...
[18:21:48 WARN]: [BetterHud] Stack trace:
[18:21:48 WARN]: [BetterHud] java.lang.RuntimeException: this placeholder not found: [papi
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.manager.PlaceholderManagerImpl.find(PlaceholderManagerImpl.kt:260)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.manager.PlaceholderManagerImpl.parse(PlaceholderManagerImpl.kt:317)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.renderer.TextRenderer.<init>(TextRenderer.kt:47)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.hud.HudTextParser.<init>(HudTextParser.kt:113)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.hud.HudParser.<init>(HudParser.kt:26)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.hud.HudImpl.elements$lambda$6(HudImpl.kt:59)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.FilesKt.mapSubConfiguration(Files.kt:46)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.hud.HudImpl.<init>(HudImpl.kt:45)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.manager.HudManagerImpl.reload$lambda$2$lambda$1$lambda$0(HudManagerImpl.kt:26)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.MapsKt.putSync(Maps.kt:6)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.manager.HudManagerImpl.reload$lambda$2$lambda$1(HudManagerImpl.kt:25)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.FunctionsKt.runWithExceptionHandling(Functions.kt:31)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.manager.HudManagerImpl.reload$lambda$2(HudManagerImpl.kt:24)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.YamlsKt.forEachAllYaml$lambda$6$lambda$5(Yamls.kt:55)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.FunctionsKt.runWithExceptionHandling(Functions.kt:31)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.YamlsKt.forEachAllYaml$lambda$6(Yamls.kt:52)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.FilesKt.forEachAllFolder(Files.kt:30)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.FilesKt.forEachAllFolder$lambda$5(Files.kt:28)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.FilesKt.forEach(Files.kt:50)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.FilesKt.forEachAllFolder(Files.kt:27)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.YamlsKt.forEachAllYaml(Yamls.kt:50)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.manager.HudManagerImpl.reload(HudManagerImpl.kt:23)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.BetterHudImpl$reload$result$1.get$lambda$4(BetterHudImpl.kt:118)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.util.FunctionsKt.runWithExceptionHandling(Functions.kt:31)
        at BetterHud-bukkit-1.11.3.jar//kr.toxicity.hud.BetterHudImpl$reload$result$1.get(BetterHudImpl.kt:111)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)```
@Khotul Khotul added bug Something isn't working question Further information is requested labels Jan 10, 2025
@Khotul Khotul mentioned this issue Jan 11, 2025
@toxicity188
Copy link
Owner

Use //

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants