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
public void onLoad() {
if (Bukkit.getServer().getWorlds().isEmpty()) {
WatcherSanitizer.init();
return;
}
@ -79,7 +80,6 @@ public class LibsDisguises extends JavaPlugin {
return;
}
WatcherSanitizer.init();
ReflectionManager.init();
PacketsManager.init();

View File

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