Skip to content

Commit

Permalink
Fixed top islands are not updated according to the sorting types afte…
Browse files Browse the repository at this point in the history
…r changing them (#956)
  • Loading branch information
OmerBenGera committed Feb 26, 2022
1 parent f32b9b3 commit 6441762
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Expand Up @@ -31,14 +31,18 @@ public PagedSuperiorMenu(PagedMenuPattern<M, T> menuPattern, SuperiorPlayer supe
}

public int getCurrentPage() {
return currentPage;
return this.currentPage;
}

public List<T> getPagedObjects() {
if (objects == null)
objects = requestObjects();
if (this.objects == null)
updatePagedObjects();

return Collections.unmodifiableList(objects);
return Collections.unmodifiableList(this.objects);
}

public void updatePagedObjects() {
this.objects = requestObjects();
}

public void movePage(int newPage) {
Expand Down
Expand Up @@ -48,6 +48,7 @@ public SortingType getSortingType() {

public boolean setSortingType(SortingType sortingType) {
this.sortingType = sortingType;
this.updatePagedObjects();
return this.alreadySorted.add(sortingType);
}

Expand Down

0 comments on commit 6441762

Please sign in to comment.