mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-06 00:08:04 +01:00
Fix AIOOB. Fixes #303
Fixed an AIOOB when players had the list perm, but not perm to view any world.
This commit is contained in:
parent
bf0b70cbcd
commit
d7c1b8b0e2
@ -42,8 +42,11 @@ public abstract class PaginatedCommand<T> extends Command {
|
||||
}
|
||||
|
||||
protected void showPage(int page, CommandSender sender, List<T> cmds) {
|
||||
// Ensure the page is at least 1.
|
||||
page = (page <= 0) ? 1 : page;
|
||||
int start = (page - 1) * ITEMS_PER_PAGE;
|
||||
int end = start + ITEMS_PER_PAGE;
|
||||
|
||||
for (int i = start; i < end; i++) {
|
||||
// For consistancy, print some extra lines if it's a player:
|
||||
if (i < cmds.size()) {
|
||||
|
Loading…
Reference in New Issue
Block a user