mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-12-31 21:37:51 +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
|
* @return true if this expansion is now registered with PlaceholderAPI
|
||||||
*/
|
*/
|
||||||
public boolean register() {
|
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) {
|
public boolean register(@NotNull final PlaceholderExpansion expansion) {
|
||||||
final String identifier = expansion.getIdentifier().toLowerCase();
|
final String identifier = expansion.getIdentifier().toLowerCase();
|
||||||
|
|
||||||
|
if (!expansion.canRegister()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (expansion instanceof Configurable) {
|
if (expansion instanceof Configurable) {
|
||||||
Map<String, Object> defaults = ((Configurable) expansion).getDefaults();
|
Map<String, Object> defaults = ((Configurable) expansion).getDefaults();
|
||||||
String pre = "expansions." + identifier + ".";
|
String pre = "expansions." + identifier + ".";
|
||||||
|
Loading…
Reference in New Issue
Block a user