Unregister variable on disable

This commit is contained in:
games647
2020-05-14 13:43:13 +02:00
parent c58eda983a
commit 42790b27f8
2 changed files with 8 additions and 0 deletions

View File

@ -103,6 +103,9 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
}
bungeeManager.cleanup();
if (getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")) {
PremiumPlaceholder.unregisterAll(this);
}
}
public FastLoginCore<Player, CommandSender, FastLoginBukkit> getCore() {

View File

@ -1,5 +1,6 @@
package com.github.games647.fastlogin.bukkit;
import me.clip.placeholderapi.PlaceholderAPI;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.entity.Player;
@ -14,6 +15,10 @@ public class PremiumPlaceholder extends PlaceholderExpansion {
this.plugin = plugin;
}
public static void unregisterAll(FastLoginBukkit plugin) {
PlaceholderAPI.unregisterPlaceholderHook(plugin.getName());
}
@Override
public String onPlaceholderRequest(Player player, String identifier) {
// player is null if offline