Check if canRegister in LocalExpansionManager.register rather than in Expansion#register

This commit is contained in:
extendedclip 2020-08-03 10:24:56 -04:00
parent 0982505574
commit 12a358fbd0
2 changed files with 5 additions and 1 deletions

View File

@ -137,7 +137,7 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
* @return true if this expansion is now registered with PlaceholderAPI
*/
public boolean register() {
return canRegister() && getPlaceholderAPI().getLocalExpansionManager().register(this);
return getPlaceholderAPI().getLocalExpansionManager().register(this);
}
/**

View File

@ -159,6 +159,10 @@ public final class LocalExpansionManager implements Listener {
public boolean register(@NotNull final PlaceholderExpansion expansion) {
final String identifier = expansion.getIdentifier().toLowerCase();
if (!expansion.canRegister()) {
return false;
}
if (expansion instanceof Configurable) {
Map<String, Object> defaults = ((Configurable) expansion).getDefaults();
String pre = "expansions." + identifier + ".";