Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Badbird5907 committed Oct 13, 2024
2 parents 5d60907 + faff78c commit 3428132
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p>
<img src="https://img.shields.io/github/license/TriumphTeam/triumph-gui?color=blue&style=flat-square" alt="license"/>
<a href="https://search.maven.org/artifact/dev.triumphteam/triumph-gui"><img src="https://img.shields.io/github/v/release/TriumphTeam/triumph-gui?color=green&style=flat-square" alt="release"></a>
<a href="https://mattstudios.me/discord"><img src="https://img.shields.io/discord/493380790718038028?label=discord&style=flat-square" alt="language"/></a>
<a href="https://triumphteam.dev/discord"><img src="https://img.shields.io/discord/493380790718038028?label=discord&style=flat-square" alt="language"/></a>
</p>

> This lib was made to simplify the creation of GUIs.
Expand All @@ -12,7 +12,7 @@

👤 **TriumphTeam**

* Documentation: https://triumphteam.dev/library/triumph-gui 🚧 **work in progress**
* Documentation: https://triumphteam.dev/docs/triumph-gui 🚧 **work in progress**
* Maven Central: https://search.maven.org/artifact/dev.triumphteam/triumph-gui
* Github: [@ipsk](https://github.com/ipsk)

Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/dev/triumphteam/gui/guis/PaginatedGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,13 @@ public int getPagesNum() {
protected void populatePage() {
// Adds the paginated items to the page
int slot = 0;
final int inventorySize = getInventory().getSize();
final Iterator<GuiItem> iterator = getPageNum(pageNum).iterator();
while (iterator.hasNext()) {
if (slot >= inventorySize) {
break; // Exit the loop if slot exceeds inventory size
}

if (getGuiItem(slot) != null || getInventory().getItem(slot) != null) {
slot++; // skip the slot if it's already taken
continue;
Expand Down

0 comments on commit 3428132

Please sign in to comment.