Fix some plugin loading issue
This commit is contained in:
parent
49024bf3f8
commit
126d5df619
@ -13,6 +13,7 @@ import fr.pandacube.lib.chat.Chat;
|
|||||||
import fr.pandacube.lib.commands.BrigadierCommand;
|
import fr.pandacube.lib.commands.BrigadierCommand;
|
||||||
import fr.pandacube.lib.commands.SuggestionsSupplier;
|
import fr.pandacube.lib.commands.SuggestionsSupplier;
|
||||||
import fr.pandacube.lib.paper.permissions.PandalibPaperPermissions;
|
import fr.pandacube.lib.paper.permissions.PandalibPaperPermissions;
|
||||||
|
import fr.pandacube.lib.paper.reflect.PandalibPaperReflect;
|
||||||
import fr.pandacube.lib.paper.reflect.wrapper.craftbukkit.CraftServer;
|
import fr.pandacube.lib.paper.reflect.wrapper.craftbukkit.CraftServer;
|
||||||
import fr.pandacube.lib.paper.reflect.wrapper.craftbukkit.CraftVector;
|
import fr.pandacube.lib.paper.reflect.wrapper.craftbukkit.CraftVector;
|
||||||
import fr.pandacube.lib.paper.reflect.wrapper.craftbukkit.VanillaCommandWrapper;
|
import fr.pandacube.lib.paper.reflect.wrapper.craftbukkit.VanillaCommandWrapper;
|
||||||
@ -66,6 +67,7 @@ public abstract class PaperBrigadierCommand extends BrigadierCommand<BukkitBriga
|
|||||||
private static final CommandDispatcher<BukkitBrigadierCommandSource> nmsDispatcher;
|
private static final CommandDispatcher<BukkitBrigadierCommandSource> nmsDispatcher;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
PandalibPaperReflect.init();
|
||||||
vanillaCommandDispatcher = ReflectWrapper.wrapTyped(Bukkit.getServer(), CraftServer.class)
|
vanillaCommandDispatcher = ReflectWrapper.wrapTyped(Bukkit.getServer(), CraftServer.class)
|
||||||
.getServer()
|
.getServer()
|
||||||
.vanillaCommandDispatcher();
|
.vanillaCommandDispatcher();
|
||||||
|
@ -71,11 +71,18 @@ import static fr.pandacube.lib.reflect.wrapper.WrapperRegistry.initWrapper;
|
|||||||
*/
|
*/
|
||||||
public class PandalibPaperReflect {
|
public class PandalibPaperReflect {
|
||||||
|
|
||||||
|
private static boolean isInit = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the reflect tools in {@code pandalib-paper-reflect} module.
|
* Initializes the reflect tools in {@code pandalib-paper-reflect} module.
|
||||||
*/
|
*/
|
||||||
public static void init() {
|
public static void init() {
|
||||||
NMSReflect.init();
|
NMSReflect.init();
|
||||||
|
synchronized (PandalibPaperReflect.class) {
|
||||||
|
if (isInit)
|
||||||
|
return;
|
||||||
|
isInit = true;
|
||||||
|
}
|
||||||
initWrapperClasses();
|
initWrapperClasses();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,11 +7,12 @@ public class PandaLibPaper {
|
|||||||
|
|
||||||
private static Plugin plugin;
|
private static Plugin plugin;
|
||||||
|
|
||||||
public static void init(Plugin plugin) {
|
public static void onLoad(Plugin plugin) {
|
||||||
PandaLibPaper.plugin = plugin;
|
PandaLibPaper.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onEnable() {
|
||||||
PerformanceAnalysisManager.getInstance(); // initialize
|
PerformanceAnalysisManager.getInstance(); // initialize
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user