Fixed "async task can't be called from server thread"

This exception occurred at least on Bukkit.
This commit is contained in:
Rsl1122 2019-01-08 11:18:10 +02:00
parent f05108fe63
commit a59e5d65ea
4 changed files with 4 additions and 4 deletions

View File

@ -74,7 +74,7 @@ public class Plan extends BukkitPlugin implements PlanPlugin {
registerCommand("plan", command); registerCommand("plan", command);
new RegisterCommandFilter().registerFilter(); new RegisterCommandFilter().registerFilter();
if (system != null) { if (system != null) {
system.getListenerSystem().callEnableEvent(this); system.getProcessing().submitNonCritical(() -> system.getListenerSystem().callEnableEvent(this));
} }
} }

View File

@ -71,7 +71,7 @@ public class PlanBungee extends BungeePlugin implements PlanPlugin {
command.registerCommands(); command.registerCommands();
registerCommand("planbungee", command); registerCommand("planbungee", command);
if (system != null) { if (system != null) {
system.getListenerSystem().callEnableEvent(this); system.getProcessing().submitNonCritical(() -> system.getListenerSystem().callEnableEvent(this));
} }
} }

View File

@ -106,7 +106,7 @@ public class PlanSponge extends SpongePlugin implements PlanPlugin {
command.registerCommands(); command.registerCommands();
registerCommand("plan", command); registerCommand("plan", command);
if (system != null) { if (system != null) {
system.getListenerSystem().callEnableEvent(this); system.getProcessing().submitNonCritical(() -> system.getListenerSystem().callEnableEvent(this));
} }
} }

View File

@ -97,7 +97,7 @@ public class PlanVelocity extends VelocityPlugin implements PlanPlugin {
command.registerCommands(); command.registerCommands();
registerCommand("planvelocity", command); registerCommand("planvelocity", command);
if (system != null) { if (system != null) {
system.getListenerSystem().callEnableEvent(this); system.getProcessing().submitNonCritical(() -> system.getListenerSystem().callEnableEvent(this));
} }
} }