From 3042e49ddb51646f6b7ac2f3dd3789be3e5382f8 Mon Sep 17 00:00:00 2001 From: extendedclip Date: Sun, 5 May 2019 10:37:01 -0400 Subject: [PATCH] Move ServerLoadEvent listener to its own class --- .../ServerLoadEventListener.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/me/clip/placeholderapi/ServerLoadEventListener.java diff --git a/src/main/java/me/clip/placeholderapi/ServerLoadEventListener.java b/src/main/java/me/clip/placeholderapi/ServerLoadEventListener.java new file mode 100644 index 0000000..cff46b1 --- /dev/null +++ b/src/main/java/me/clip/placeholderapi/ServerLoadEventListener.java @@ -0,0 +1,22 @@ +package me.clip.placeholderapi; + +import org.bukkit.Bukkit; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.server.ServerLoadEvent; + +public class ServerLoadEventListener implements Listener { + + private PlaceholderAPIPlugin plugin; + + public ServerLoadEventListener(PlaceholderAPIPlugin instance) { + plugin = instance; + Bukkit.getPluginManager().registerEvents(this, instance); + } + + @EventHandler + public void onServerLoad(ServerLoadEvent e) { + plugin.getLogger().info("Placeholder expansion registration initializing..."); + plugin.getExpansionManager().registerAllExpansions(); + } +}