Move asm to onLoad just incase other plugins are weird loading
This commit is contained in:
parent
51296f1cae
commit
7fcd90a338
@ -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();
|
||||||
|
@ -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];
|
||||||
|
Loading…
Reference in New Issue
Block a user