mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2025-01-28 19:21:52 +01:00
Added event when all expansions are loaded for developers.
This commit is contained in:
parent
d5e27252cf
commit
7c404db56b
@ -0,0 +1,28 @@
|
|||||||
|
package me.clip.placeholderapi.events;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event is ran when all expansions are loaded.
|
||||||
|
* This is done when reloading config, on plugin start and on server load.
|
||||||
|
* @author jacobbordas (@ignissak)
|
||||||
|
*/
|
||||||
|
public class ExpansionsLoadedEvent extends Event {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
}
|
@ -36,6 +36,7 @@ import java.util.logging.Level;
|
|||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.events.ExpansionRegisterEvent;
|
import me.clip.placeholderapi.events.ExpansionRegisterEvent;
|
||||||
import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
|
import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
|
||||||
|
import me.clip.placeholderapi.events.ExpansionsLoadedEvent;
|
||||||
import me.clip.placeholderapi.expansion.Cacheable;
|
import me.clip.placeholderapi.expansion.Cacheable;
|
||||||
import me.clip.placeholderapi.expansion.Cleanable;
|
import me.clip.placeholderapi.expansion.Cleanable;
|
||||||
import me.clip.placeholderapi.expansion.Configurable;
|
import me.clip.placeholderapi.expansion.Configurable;
|
||||||
@ -320,6 +321,9 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
Msg.msg(sender,
|
Msg.msg(sender,
|
||||||
registered == 0 ? "&6No expansions were registered!"
|
registered == 0 ? "&6No expansions were registered!"
|
||||||
: registered + "&a placeholder hooks successfully registered!");
|
: registered + "&a placeholder hooks successfully registered!");
|
||||||
|
|
||||||
|
final ExpansionsLoadedEvent event = new ExpansionsLoadedEvent();
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user