Add patern to placeholder
orblazer opened this issue ยท 2 comments
Hello,
I make that issue for propose implement pattern for custom placeholder (like world
or bungeecord
placeholder).
This is useful for pass variable to placeholder.
For me i see that usage :
- With matcher
HologramsAPI.registerPlaceholder(plugin, pattern, refresfreshRate, (matcher) -> {});
- With directly matches
HologramsAPI.registerPlaceholder(plugin, pattern, refresfreshRate, (matches) -> {});
The usage that new format :
-
HologramsAPI.registerPlaceholder(this, Pattern.compile("\{serverMap\:(\w+)\}"), 1, (matcher) -> { return getServerMap(matcher.group(1)); });
-
HologramsAPI.registerPlaceholder(this, Pattern.compile("\{serverMap\:(\w+)\}"), 1, (matches) -> { return getServerMap(matches[1]); });
Thanks.