From 85cfd4cbe5ad16f44cd13aecf9c7d6468f126e70 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 8 May 2022 14:39:19 +0200 Subject: [PATCH] Fix for newer BTLP versions --- src/de/steamwar/bungeecore/Persistent.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/Persistent.java b/src/de/steamwar/bungeecore/Persistent.java index f169710..c5d9476 100644 --- a/src/de/steamwar/bungeecore/Persistent.java +++ b/src/de/steamwar/bungeecore/Persistent.java @@ -19,10 +19,10 @@ package de.steamwar.bungeecore; +import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.bungeepluginmanager.ModifiedPluginEventBus; import net.md_5.bungee.api.bungeepluginmanager.PluginUtils; import net.md_5.bungee.api.bungeepluginmanager.ReflectionUtils; -import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.plugin.Command; import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.api.plugin.PluginManager; @@ -35,11 +35,15 @@ public class Persistent extends Plugin { private static String chatPrefix = ""; private static String lobbyServer = ""; + @Override + public void onLoad() { + ReflectionUtils.setFieldValue(getProxy().getPluginManager(), "eventBus", new ModifiedPluginEventBus()); + } + @Override public void onEnable(){ instance = this; - ReflectionUtils.setFieldValue(getProxy().getPluginManager(), "eventBus", new ModifiedPluginEventBus()); getProxy().getPluginManager().registerCommand(this, new Command("softreload", "bungeecore.softreload"){ @Override public void execute(CommandSender sender, String[] args) {