From 5d6c8c19cd716ea065d7c1651c94f49a92d265c7 Mon Sep 17 00:00:00 2001 From: extendedclip Date: Sat, 24 Mar 2018 11:46:00 -0400 Subject: [PATCH] Added method to specify if the expansion should persist through papi reloads --- .../expansion/PlaceholderExpansion.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java b/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java index 2132216..29bbd33 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java +++ b/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java @@ -38,6 +38,16 @@ public abstract class PlaceholderExpansion extends PlaceholderHook { public String getName() { 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 * @return placeholder identifier that is associated with this class @@ -92,8 +102,6 @@ public abstract class PlaceholderExpansion extends PlaceholderHook { return PlaceholderAPI.registerPlaceholderHook(getIdentifier(), this); } - - /** * Quick getter for the {@link PlaceholderAPIPlugin} instance * @return {@link PlaceholderAPIPlugin} instance