Preemptive event deregistration

This commit is contained in:
fullwall 2021-07-18 19:30:45 +08:00
parent 0ff3ee72e9
commit 55cf0c4ccd

View File

@ -12,6 +12,7 @@ import java.util.concurrent.Callable;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
@ -283,6 +284,7 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
Bukkit.getPluginManager().callEvent(new CitizensDisableEvent());
Editor.leaveAll();
despawnNPCs(true);
HandlerList.unregisterAll(this);
npcRegistry = null;
NMS.shutdown();
enabled = false;