diff --git a/src/main/scala/io/izzel/taboolib/util/item/inventory/ClickListener.java b/src/main/scala/io/izzel/taboolib/util/item/inventory/ClickListener.java index fecf4c5..529bee5 100644 --- a/src/main/scala/io/izzel/taboolib/util/item/inventory/ClickListener.java +++ b/src/main/scala/io/izzel/taboolib/util/item/inventory/ClickListener.java @@ -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())); } } diff --git a/src/main/scala/io/izzel/taboolib/util/item/inventory/MenuBuilder.java b/src/main/scala/io/izzel/taboolib/util/item/inventory/MenuBuilder.java index 75a5ee2..9e6cd79 100644 --- a/src/main/scala/io/izzel/taboolib/util/item/inventory/MenuBuilder.java +++ b/src/main/scala/io/izzel/taboolib/util/item/inventory/MenuBuilder.java @@ -155,6 +155,14 @@ public class MenuBuilder { return closeTask; } + public BuildTask getBuildTask() { + return buildTask; + } + + public BuildTask getBuildTaskAsync() { + return buildTaskAsync; + } + public boolean isLockHand() { return lockHand; }