fix(ball-bukkit): 修复执行指令时的异步异常
This commit is contained in:
@@ -101,7 +101,7 @@ public class BallBukkitListener implements Listener {
|
||||
if (event.getServerID() != null && !BallAPI.getInstance().isLocalServer(event.getServerID())) {
|
||||
return;
|
||||
}
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), event.getCommand());
|
||||
HamsterBallPlugin.sync(() -> Bukkit.dispatchCommand(Bukkit.getConsoleSender(), event.getCommand()));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -114,11 +114,11 @@ public class BallBukkitListener implements Listener {
|
||||
if (player == null) {
|
||||
return;
|
||||
}
|
||||
Bukkit.dispatchCommand(player, event.getCommand());
|
||||
HamsterBallPlugin.sync(() -> Bukkit.dispatchCommand(player, event.getCommand()));
|
||||
return;
|
||||
}
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
Bukkit.dispatchCommand(player, event.getCommand());
|
||||
HamsterBallPlugin.sync(() -> Bukkit.dispatchCommand(player, event.getCommand()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user