use HIGHEST priority on disable, so "on script unload" can still work

This commit is contained in:
Govindass
2020-10-29 09:47:18 +02:00
parent 2ee28a5450
commit dd6b9b6ee6
2 changed files with 7 additions and 27 deletions

View File

@@ -3,6 +3,8 @@ import net.limework.core.commands.ReloadRedis;
import net.limework.core.hooks.SkriptHook;
import net.limework.core.managers.RedisManager;
import org.bukkit.command.PluginCommand;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.plugin.java.JavaPlugin;
public class RediSkript extends JavaPlugin {
@@ -32,6 +34,8 @@ public class RediSkript extends JavaPlugin {
}
@Override
//using HIGHEST event priority so it shuts down last and code can still execute well in "on script unload" and "on skript unload" events
@EventHandler(priority = EventPriority.HIGHEST)
public void onDisable() {
if (rm != null) {
rm.shutdown();