From bf44577e176a10a5e64bf2cc00bef969fe6ab1d5 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 20 May 2021 12:03:11 +1200 Subject: [PATCH] Potentially fix an error with linkage. Probably not hey --- .../utilities/reflection/asm/LibsDisguisesCompat.java | 7 +++++++ .../utilities/reflection/asm/WatcherSanitizer.java | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/LibsDisguisesCompat.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/LibsDisguisesCompat.java index 7620e3ed..24a0af8f 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/LibsDisguisesCompat.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/LibsDisguisesCompat.java @@ -1,9 +1,16 @@ package me.libraryaddict.disguise.utilities.reflection.asm; +import me.libraryaddict.disguise.utilities.reflection.ClassGetter; import org.bukkit.plugin.java.JavaPlugin; +import java.util.ArrayList; + /** * Created by libraryaddict on 20/05/2021. */ public class LibsDisguisesCompat extends JavaPlugin { + @Override + public void onLoad() { + ClassGetter.getClassesForPackage("me.libraryaddict.disguise.disguisetypes"); + } } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/WatcherSanitizer.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/WatcherSanitizer.java index 0a98cca9..66eb0ed2 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/WatcherSanitizer.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/WatcherSanitizer.java @@ -69,14 +69,16 @@ public class WatcherSanitizer { public static void init() { try { checkPreLoaded(); - } catch (NoSuchFieldException | IllegalAccessException ignored) { + } catch (NoSuchFieldException | IllegalAccessException e) { + LibsDisguises.getInstance().getLogger().info("Failed to check for early class access, this shouldn't be an issue"); } if (Bukkit.getPluginManager().getPlugin("LibsDisguisesVersioning") != null) { throw new IllegalStateException("Why is LibsDisguisesVersioning already active? Did the server owner do something.. Weird?"); } - LibsDisguises.getInstance().getLogger().info("Due to issues with Java 16, you may notice harmless errors saying plugin loaded another plugin that isnt a soft depend or so on"); + LibsDisguises.getInstance().getLogger() + .info("Due to issues with Java 16, you may notice harmless errors saying plugin loaded another plugin that isnt a soft depend or so on"); FakePluginCreator fakePluginCreator = new FakePluginCreator();