+ fix MenuBuilder

This commit is contained in:
sky 2019-12-03 20:12:09 +08:00
parent c7573226a5
commit b8084fe02e
2 changed files with 10 additions and 2 deletions

View File

@ -36,8 +36,8 @@ class ClickListener implements Listener {
@EventHandler
public void e(InventoryOpenEvent e) {
if (e.getInventory().getHolder() instanceof MenuHolder) {
Bukkit.getScheduler().runTask(TabooLib.getPlugin(), () -> ((MenuHolder) e.getInventory().getHolder()).getBuilder().open((OpenTask) -> e.getInventory()));
Bukkit.getScheduler().runTaskAsynchronously(TabooLib.getPlugin(), () -> ((MenuHolder) e.getInventory().getHolder()).getBuilder().openAsync((OpenTask) -> e.getInventory()));
Bukkit.getScheduler().runTask(TabooLib.getPlugin(), () -> ((MenuHolder) e.getInventory().getHolder()).getBuilder().getBuildTask().run(e.getInventory()));
Bukkit.getScheduler().runTaskAsynchronously(TabooLib.getPlugin(), () -> ((MenuHolder) e.getInventory().getHolder()).getBuilder().getBuildTaskAsync().run(e.getInventory()));
}
}

View File

@ -155,6 +155,14 @@ public class MenuBuilder {
return closeTask;
}
public BuildTask getBuildTask() {
return buildTask;
}
public BuildTask getBuildTaskAsync() {
return buildTaskAsync;
}
public boolean isLockHand() {
return lockHand;
}