Tweak header/footer index incrementation order

This commit is contained in:
William278 2023-03-31 15:09:05 +01:00
parent 18086fffa4
commit 8cbaa6f70f

View File

@ -96,11 +96,10 @@ public final class TabPlayer implements Comparable<TabPlayer> {
} }
public void incrementHeaderIndex(@NotNull Velocitab plugin) { public void incrementHeaderIndex(@NotNull Velocitab plugin) {
headerIndex++;
if (headerIndex >= plugin.getSettings().getHeaderListSize(getServerGroup(plugin))) { if (headerIndex >= plugin.getSettings().getHeaderListSize(getServerGroup(plugin))) {
headerIndex = 0; headerIndex = 0;
return;
} }
headerIndex++;
} }
public int getFooterIndex() { public int getFooterIndex() {
@ -108,11 +107,10 @@ public final class TabPlayer implements Comparable<TabPlayer> {
} }
public void incrementFooterIndex(@NotNull Velocitab plugin) { public void incrementFooterIndex(@NotNull Velocitab plugin) {
footerIndex++;
if (footerIndex >= plugin.getSettings().getFooterListSize(getServerGroup(plugin))) { if (footerIndex >= plugin.getSettings().getFooterListSize(getServerGroup(plugin))) {
footerIndex = 0; footerIndex = 0;
return;
} }
footerIndex++;
} }
@Override @Override