Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
v0.7.3 | PagedGUI.java Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWylot committed Mar 31, 2022
1 parent 6c76bcb commit 07a3ae9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>ir.wy</groupId>
<artifactId>WyCore</artifactId>
<packaging>jar</packaging>
<version>0.7</version>
<version>0.7.3</version>


<properties>
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/ir/wy/wycore/gui/PagedGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ public boolean isPaged() {

@Override
public void onInventoryClick(InventoryClickEvent event) {
if (!isPaged()) return;
if (event.getSlot() == getInventory().getSize() - 7) {
if (page > 1) {
page--;
event.getWhoClicked().openInventory(getInventory());
if (isPaged()) {
if (event.getSlot() == getInventory().getSize() - 7) {
if (page > 1) {
page--;
event.getWhoClicked().openInventory(getInventory());
}
} else if (previousInventory != null && backButton != null) {
if (event.getSlot() == event.getInventory().getSize() + backButton.slot) {
event.getWhoClicked().openInventory(previousInventory);
}
} else if (event.getSlot() == getInventory().getSize() - 3) {
if ((event.getInventory().getSize() - 9) * page < getPageObjects().size()) {
Expand All @@ -105,4 +109,4 @@ public void onInventoryClick(InventoryClickEvent event) {
event.getWhoClicked().openInventory(previousInventory);
}
}
}
}}

0 comments on commit 07a3ae9

Please sign in to comment.