diff --git a/gradle.properties b/gradle.properties index 1fe7390d..58aa41e3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ # # Fairy -fairy.version = 0.7.1b2-SNAPSHOT +fairy.version = 0.7.1b3-SNAPSHOT gradle-plugin.version = 1.2.0b9 mongojack.version = 4.2.0 diff --git a/io.fairyproject.modules/platform.bukkit/bukkit-gui/src/main/java/io/fairyproject/bukkit/gui/slot/GuiSlot.java b/io.fairyproject.modules/platform.bukkit/bukkit-gui/src/main/java/io/fairyproject/bukkit/gui/slot/GuiSlot.java index 6f711a4e..fa8fee58 100644 --- a/io.fairyproject.modules/platform.bukkit/bukkit-gui/src/main/java/io/fairyproject/bukkit/gui/slot/GuiSlot.java +++ b/io.fairyproject.modules/platform.bukkit/bukkit-gui/src/main/java/io/fairyproject/bukkit/gui/slot/GuiSlot.java @@ -77,18 +77,34 @@ static GuiSlot nextPage(PaginatedPane pane, ItemStack itemStack) { return new ModPageGuiSlot(pane, itemStack, 1, null); } + static GuiSlot nextPage(PaginatedPane pane, ItemStack itemStack, @Nullable BiConsumer clickCallback) { + return new ModPageGuiSlot(pane, itemStack, 1, clickCallback != null ? event -> clickCallback.accept((Player) event.getWhoClicked(), event.getClick()) : null); + } + static GuiSlot previousPage(PaginatedPane pane, ItemStack itemStack) { return new ModPageGuiSlot(pane, itemStack, -1, null); } + static GuiSlot previousPage(PaginatedPane pane, ItemStack itemStack, @Nullable BiConsumer clickCallback) { + return new ModPageGuiSlot(pane, itemStack, -1, clickCallback != null ? event -> clickCallback.accept((Player) event.getWhoClicked(), event.getClick()) : null); + } + static GuiSlot nextPage(PaginatedPane pane) { return new ModPageGuiSlot(pane, ItemBuilder.of(XMaterial.ARROW).name("&aNext Page").build(), 1, null); } + static GuiSlot nextPage(PaginatedPane pane, @Nullable BiConsumer clickCallback) { + return new ModPageGuiSlot(pane, ItemBuilder.of(XMaterial.ARROW).name("&aNext Page").build(), 1, clickCallback != null ? event -> clickCallback.accept((Player) event.getWhoClicked(), event.getClick()) : null); + } + static GuiSlot previousPage(PaginatedPane pane) { return new ModPageGuiSlot(pane, ItemBuilder.of(XMaterial.ARROW).name("&aPrevious Page").build(), -1, null); } + static GuiSlot previousPage(PaginatedPane pane, @Nullable BiConsumer clickCallback) { + return new ModPageGuiSlot(pane, ItemBuilder.of(XMaterial.ARROW).name("&aPrevious Page").build(), -1, clickCallback != null ? event -> clickCallback.accept((Player) event.getWhoClicked(), event.getClick()) : null); + } + static GuiSlot modPage(PaginatedPane pane, ItemStack itemStack, int mod, @Nullable BiConsumer clickCallback) { return new ModPageGuiSlot(pane, itemStack, mod, clickCallback != null ? event -> clickCallback.accept((Player) event.getWhoClicked(), event.getClick()) : null); }