mirror of
				https://github.com/PlaceholderAPI/PlaceholderAPI
				synced 2025-10-31 06:12:28 +01:00 
			
		
		
		
	Check if canRegister in LocalExpansionManager.register rather than in Expansion#register
This commit is contained in:
		| @@ -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 + "."; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user