mirror of
https://e.coding.net/circlecloud/MiaoBoard.git
synced 2024-11-22 01:49:05 +00:00
fix: 异步事件未转移到异步线程
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
840c42d39c
commit
a6585f11db
@ -29,19 +29,21 @@ public class SidebarBoard extends Board {
|
||||
|
||||
@Override
|
||||
public void update(final Player player) {
|
||||
final SiderbarBoardPage boardPage = this.getBoardPage(player);
|
||||
if (boardPage == null) { return; }
|
||||
TitleUpdateEvent te = new TitleUpdateEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(te);
|
||||
String title = te.getTitle();
|
||||
if (title == null) {
|
||||
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
||||
return;
|
||||
}
|
||||
boardPage.setTitle(title);
|
||||
BodyUpdateEvent be = new BodyUpdateEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(be);
|
||||
boardPage.setBody(be.getBody());
|
||||
player.setScoreboard(boardPage.getBoard());
|
||||
Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> {
|
||||
final SiderbarBoardPage boardPage = this.getBoardPage(player);
|
||||
if (boardPage == null) { return; }
|
||||
TitleUpdateEvent te = new TitleUpdateEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(te);
|
||||
String title = te.getTitle();
|
||||
if (title == null) {
|
||||
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
||||
return;
|
||||
}
|
||||
boardPage.setTitle(title);
|
||||
BodyUpdateEvent be = new BodyUpdateEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(be);
|
||||
boardPage.setBody(be.getBody());
|
||||
player.setScoreboard(boardPage.getBoard());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user