From f27c977be2ba93f1b194894d1c9f2397cedf8c9e Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 22 Oct 2024 18:10:18 +0200 Subject: [PATCH] Back to onenable tasks --- .../com/viaversion/viabackwards/BukkitPlugin.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/com/viaversion/viabackwards/BukkitPlugin.java b/bukkit/src/main/java/com/viaversion/viabackwards/BukkitPlugin.java index 9e91ea5f..32d3f77a 100644 --- a/bukkit/src/main/java/com/viaversion/viabackwards/BukkitPlugin.java +++ b/bukkit/src/main/java/com/viaversion/viabackwards/BukkitPlugin.java @@ -36,7 +36,16 @@ public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform { public BukkitPlugin() { Via.getManager().addEnableListener(() -> init(new File(getDataFolder(), "config.yml"))); - Via.getManager().addPostEnableListener(this::enable); + } + + @Override + public void onEnable() { + if (Via.getManager().getInjector().lateProtocolVersionSetting()) { + // Enable in the next tick + Via.getPlatform().runSync(this::enable, 1); + } else { + enable(); + } } @Override