Added method to specify if the expansion should persist through papi reloads

This commit is contained in:
extendedclip 2018-03-24 11:46:00 -04:00
parent af68dbcf8b
commit 5d6c8c19cd

View File

@ -38,6 +38,16 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
public String getName() { public String getName() {
return getIdentifier(); return getIdentifier();
} }
/**
* Expansions that do not use the ecloud and instead register from the dependency should set this to false
* to ensure that your placeholder expansion is not unregistered when the papi reload command is used
* @return if the expansion should persist through reloads
*/
public boolean persist() {
return false;
}
/** /**
* Get the identifier that this placeholder expansion uses to be passed placeholder requests * Get the identifier that this placeholder expansion uses to be passed placeholder requests
* @return placeholder identifier that is associated with this class * @return placeholder identifier that is associated with this class
@ -92,8 +102,6 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
return PlaceholderAPI.registerPlaceholderHook(getIdentifier(), this); return PlaceholderAPI.registerPlaceholderHook(getIdentifier(), this);
} }
/** /**
* Quick getter for the {@link PlaceholderAPIPlugin} instance * Quick getter for the {@link PlaceholderAPIPlugin} instance
* @return {@link PlaceholderAPIPlugin} instance * @return {@link PlaceholderAPIPlugin} instance