Back to onenable tasks

This commit is contained in:
Nassim Jahnke 2024-10-22 18:10:18 +02:00
parent 90878517db
commit f27c977be2
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -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