mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-20 01:27:07 +00:00
fix pages again.....
This commit is contained in:
parent
294a8a5031
commit
089c5d8e5f
@ -134,7 +134,6 @@ public class CommandRedisBungee extends AdventureBaseCommand {
|
|||||||
} else currentPage = 1;
|
} else currentPage = 1;
|
||||||
|
|
||||||
var data = new ArrayList<>(plugin.proxyDataManager().eachProxyCount().entrySet());
|
var data = new ArrayList<>(plugin.proxyDataManager().eachProxyCount().entrySet());
|
||||||
|
|
||||||
// there is no way this runs because there is always an heartbeat.
|
// there is no way this runs because there is always an heartbeat.
|
||||||
// if not could be some shenanigans done by devs :P
|
// if not could be some shenanigans done by devs :P
|
||||||
if (data.isEmpty()) {
|
if (data.isEmpty()) {
|
||||||
@ -142,7 +141,7 @@ public class CommandRedisBungee extends AdventureBaseCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// compute the total pages
|
// compute the total pages
|
||||||
int maxPages = data.size() < pageSize ? 1 : data.size() / pageSize ;
|
int maxPages = (int) Math.ceil(data.size() / (double) pageSize);
|
||||||
if (currentPage > maxPages) currentPage = maxPages;
|
if (currentPage > maxPages) currentPage = maxPages;
|
||||||
var subList = subListProxies(data, currentPage, pageSize);
|
var subList = subListProxies(data, currentPage, pageSize);
|
||||||
TextComponent.Builder builder = Component.text();
|
TextComponent.Builder builder = Component.text();
|
||||||
|
Loading…
Reference in New Issue
Block a user