Java Code Examples for me.clip.placeholderapi.PlaceholderAPI#isRegistered()

The following examples show how to use me.clip.placeholderapi.PlaceholderAPI#isRegistered() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PAPIHook.java    From Parties with GNU Affero General Public License v3.0 5 votes vote down vote up
public boolean register() {
	boolean ret = false;
	try {
		Class.forName("me.clip.placeholderapi.PlaceholderHook").getMethod("onRequest", OfflinePlayer.class, String.class);
		
		if (PlaceholderAPI.isRegistered(plugin.getPluginFallbackName())) {
			PlaceholderAPI.unregisterPlaceholderHook(plugin.getPluginFallbackName());
		}
		ret = PlaceholderAPI.registerPlaceholderHook(plugin.getPluginFallbackName(), this);
	} catch (Exception ex) {
		plugin.getLoggerManager().printError(Constants.DEBUG_ADDON_OUTDATED
				.replace("{addon}", "PlaceholderAPI"));
	}
	return ret;
}
 
Example 2
Source File: PlaceholderExpansion.java    From PlaceholderAPI with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Check if this placeholder identifier has already been registered
 *
 * @return true if the identifier for this expansion is already registered
 */
public boolean isRegistered() {
  Validate.notNull(getIdentifier(), "Placeholder identifier can not be null!");
  return PlaceholderAPI.isRegistered(getIdentifier());
}