mirror of
				https://github.com/PlaceholderAPI/PlaceholderAPI
				synced 2025-11-04 07:22:30 +01:00 
			
		
		
		
	Allow cancelling expansion registration
This commit is contained in:
		@@ -323,11 +323,12 @@ public class PlaceholderAPI {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public static boolean registerExpansion(PlaceholderExpansion ex) {
 | 
			
		||||
    if (registerPlaceholderHook(ex.getIdentifier(), ex)) {
 | 
			
		||||
      Bukkit.getPluginManager().callEvent(new ExpansionRegisterEvent(ex));
 | 
			
		||||
      return true;
 | 
			
		||||
    ExpansionRegisterEvent ev = new ExpansionRegisterEvent(ex);
 | 
			
		||||
    Bukkit.getPluginManager().callEvent(ev);
 | 
			
		||||
    if (ev.isCancelled()) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
    return registerPlaceholderHook(ex.getIdentifier(), ex);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public static boolean unregisterExpansion(PlaceholderExpansion ex) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user