Move asm to onLoad just incase other plugins are weird loading

This commit is contained in:
libraryaddict 2020-02-20 12:11:22 +13:00
parent 51296f1cae
commit 7fcd90a338
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
2 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ public class LibsDisguises extends JavaPlugin {
@Override @Override
public void onLoad() { public void onLoad() {
if (Bukkit.getServer().getWorlds().isEmpty()) { if (Bukkit.getServer().getWorlds().isEmpty()) {
WatcherSanitizer.init();
return; return;
} }
@ -79,7 +80,6 @@ public class LibsDisguises extends JavaPlugin {
return; return;
} }
WatcherSanitizer.init();
ReflectionManager.init(); ReflectionManager.init();
PacketsManager.init(); PacketsManager.init();

View File

@ -55,7 +55,6 @@ public class ReflectionManager {
private static Field trackerField; private static Field trackerField;
@NmsRemovedIn(val = NmsVersion.v1_14) @NmsRemovedIn(val = NmsVersion.v1_14)
private static Field entitiesField; private static Field entitiesField;
@Getter
private static NmsVersion version; private static NmsVersion version;
public static void init() { public static void init() {
@ -360,6 +359,14 @@ public class ReflectionManager {
return null; return null;
} }
public static NmsVersion getVersion() {
if (version == null) {
getBukkitVersion();
}
return version;
}
public static String getBukkitVersion() { public static String getBukkitVersion() {
if (bukkitVersion == null) { if (bukkitVersion == null) {
bukkitVersion = Bukkit.getServer().getClass().getName().split("\\.")[3]; bukkitVersion = Bukkit.getServer().getClass().getName().split("\\.")[3];