mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
Move all scheduler initialization to BukkitCommandManager #394
The create Locale task is happening DURING object construction so initializing the scheduler in the PaperCommandManager initialization step is too late due to the bukkit/paper modules extending. This should fix the issues
This commit is contained in:
@@ -93,7 +93,12 @@ public class BukkitCommandManager extends CommandManager<
|
||||
public BukkitCommandManager(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
this.scheduler = new ACFBukkitScheduler();
|
||||
try {
|
||||
this.scheduler = new ACFPaperScheduler(Bukkit.getAsyncScheduler());
|
||||
} catch (NoSuchMethodError e) {
|
||||
// Ignored to use Bukkit Scheduler
|
||||
this.scheduler = new ACFBukkitScheduler();
|
||||
}
|
||||
|
||||
String prefix = this.plugin.getDescription().getPrefix();
|
||||
this.logger = Logger.getLogger(prefix != null ? prefix : this.plugin.getName());
|
||||
|
||||
@@ -45,11 +45,6 @@ public class PaperCommandManager extends BukkitCommandManager {
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
// Ignored
|
||||
}
|
||||
try {
|
||||
this.scheduler = new ACFPaperScheduler(Bukkit.getAsyncScheduler());
|
||||
} catch (NoSuchMethodError e) {
|
||||
// Ignored - BukkitCommandManager initializes the BukkitScheduler
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user