We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` backButton.setListener(event -> { PaginatedGUI menu = (PaginatedGUI) event.getClickedInventory().getHolder(); if(currentPage <= 0) { event.getWhoClicked().sendMessage(ChatColor.translateAlternateColorCodes('&', "&8\u00bb &fThere are no more previous pages.")); return; } menu.previousPage(); event.getWhoClicked().closeInventory(); event.getWhoClicked().openInventory(getInventory()); });
nextButton.setListener(event -> { PaginatedGUI menu = (PaginatedGUI) event.getClickedInventory().getHolder(); if(currentPage >= getMaxPage()) { event.getWhoClicked().sendMessage(ChatColor.translateAlternateColorCodes('&', "&8\u00bb &fThere are no more extra pages.")); return; } menu.nextPage(); event.getWhoClicked().closeInventory(); event.getWhoClicked().openInventory(getInventory()); });`
You have no checks to see if they're pressing the buttons on the first or last page, I added some for myself
The text was updated successfully, but these errors were encountered:
Thank you
Sorry, something went wrong.
7416d79
Anyone interested customizing the pagination items and messages, please see: https://github.com/masterdoctor/SpigotPaginatedGUI/wiki/Customizing-the-pagination-items
masterdoctor
No branches or pull requests
`
backButton.setListener(event -> {
PaginatedGUI menu = (PaginatedGUI) event.getClickedInventory().getHolder();
if(currentPage <= 0) {
event.getWhoClicked().sendMessage(ChatColor.translateAlternateColorCodes('&', "&8\u00bb &fThere are no more previous pages."));
return;
}
menu.previousPage();
event.getWhoClicked().closeInventory();
event.getWhoClicked().openInventory(getInventory());
});
nextButton.setListener(event -> {
PaginatedGUI menu = (PaginatedGUI) event.getClickedInventory().getHolder();
if(currentPage >= getMaxPage()) {
event.getWhoClicked().sendMessage(ChatColor.translateAlternateColorCodes('&', "&8\u00bb &fThere are no more extra pages."));
return;
}
menu.nextPage();
event.getWhoClicked().closeInventory();
event.getWhoClicked().openInventory(getInventory());
});`
You have no checks to see if they're pressing the buttons on the first or last page, I added some for myself
The text was updated successfully, but these errors were encountered: