Skip to content

Commit

Permalink
Fix towny gui regression
Browse files Browse the repository at this point in the history
Fixes items not being added to the page if one was newly created.
  • Loading branch information
Warriorrrr committed Dec 2, 2021
1 parent 86033fb commit 4156b1b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/com/palmergames/bukkit/towny/utils/ResidentUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,17 @@ public static void openSelectionGUI(Resident resident, SelectionGUI.SelectionTyp
private static void createTownyGUI(Resident resident, ArrayList<ItemStack> items, String name) {

Inventory page = getBlankPage(name);
ArrayList<Inventory> pages = new ArrayList<Inventory>();
ArrayList<Inventory> pages = new ArrayList<>();

for (int i = 0; i < items.size(); i++) {
for (ItemStack item : items) {
if (page.firstEmpty() == 46) {
pages.add(page);
page = getBlankPage(name);
} else {
//Add the item to the current page as per normal
page.addItem(items.get(i));
}

page.addItem(item);
}

pages.add(page);
resident.setGUIPages(pages);
resident.setGUIPageNum(0);
Expand Down

0 comments on commit 4156b1b

Please sign in to comment.