1
mirror of https://github.com/CarmJos/UserPrefix.git synced 2024-09-19 20:15:47 +00:00

[v2.3.1] [F] 修复前缀数量超过一页时翻页可能出现错误的问题

This commit is contained in:
Carm Jos 2022-01-13 01:00:46 +08:00
parent 548f1d366f
commit d752461c74
2 changed files with 71 additions and 65 deletions

View File

@ -13,7 +13,7 @@
<groupId>cc.carm.plugin</groupId>
<artifactId>userprefix</artifactId>
<version>2.3.0</version>
<version>2.3.1</version>
<name>UserPrefix</name>
<description>轻便、高效、实时的用户前缀系统。</description>

View File

@ -49,7 +49,7 @@ public class AutoPagedGUI extends CommonPagedGUI {
@Override
public void openGUI(Player user) {
if (previousPageSlot >= 0)
if (previousPageSlot >= 0) {
if (hasPreviousPage()) {
setItem(previousPageSlot, new GUIItem(previousPageUI == null ? PluginConfig.GUI.Items.PREVIOUS_PAGE.get() : previousPageUI) {
@Override
@ -63,9 +63,12 @@ public class AutoPagedGUI extends CommonPagedGUI {
openGUI(user);
}
});
} else {
setItem(previousPageSlot, null);
}
}
if (nextPageSlot >= 0)
if (nextPageSlot >= 0) {
if (hasNextPage()) {
setItem(nextPageSlot, new GUIItem(nextPageUI == null ? PluginConfig.GUI.Items.NEXT_PAGE.get() : nextPageUI) {
@Override
@ -79,6 +82,9 @@ public class AutoPagedGUI extends CommonPagedGUI {
openGUI(user);
}
});
} else {
setItem(nextPageSlot, null);
}
}
super.openGUI(user);