mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-12-18 14:57:35 +01:00
Add isRegisteredPlaceholder method to the API
This commit is contained in:
parent
a7a7fcc68b
commit
588e2ed394
@ -66,6 +66,11 @@ public interface HolographicDisplaysAPI {
|
||||
*/
|
||||
void registerPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull PlaceholderReplacer replacer);
|
||||
|
||||
/**
|
||||
* @since 1
|
||||
*/
|
||||
boolean isRegisteredPlaceholder(@NotNull String identifier);
|
||||
|
||||
/**
|
||||
* Returns all the registered placeholder identifiers.
|
||||
*
|
||||
|
@ -47,6 +47,13 @@ public class DefaultHolographicDisplaysAPI implements HolographicDisplaysAPI {
|
||||
placeholderRegistry.registerReplacer(plugin, identifier, refreshIntervalTicks, replacer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRegisteredPlaceholder(String identifier) {
|
||||
Preconditions.notNull(identifier, "identifier");
|
||||
|
||||
return placeholderRegistry.isRegisteredIdentifier(plugin, identifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Hologram> getHolograms() {
|
||||
return apiHologramManager.getHologramsByPlugin(plugin);
|
||||
|
@ -87,4 +87,8 @@ public class PlaceholderRegistry {
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public boolean isRegisteredIdentifier(Plugin plugin, String identifier) {
|
||||
return placeholderExpansions.contains(new PlaceholderIdentifier(identifier), new PluginName(plugin));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user