mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-12-29 04:18:02 +01:00
Check if canRegister in LocalExpansionManager.register rather than in Expansion#register
This commit is contained in:
parent
0982505574
commit
12a358fbd0
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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 + ".";
|
||||
|
Loading…
Reference in New Issue
Block a user