1
mirror of https://github.com/CarmJos/UserPrefix.git synced 2026-06-05 00:35:02 +08:00

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

This commit is contained in:
2022-01-13 01:00:46 +08:00
parent 548f1d366f
commit d752461c74
2 changed files with 71 additions and 65 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
<groupId>cc.carm.plugin</groupId> <groupId>cc.carm.plugin</groupId>
<artifactId>userprefix</artifactId> <artifactId>userprefix</artifactId>
<version>2.3.0</version> <version>2.3.1</version>
<name>UserPrefix</name> <name>UserPrefix</name>
<description>轻便、高效、实时的用户前缀系统。</description> <description>轻便、高效、实时的用户前缀系统。</description>
@@ -49,7 +49,7 @@ public class AutoPagedGUI extends CommonPagedGUI {
@Override @Override
public void openGUI(Player user) { public void openGUI(Player user) {
if (previousPageSlot >= 0) if (previousPageSlot >= 0) {
if (hasPreviousPage()) { if (hasPreviousPage()) {
setItem(previousPageSlot, new GUIItem(previousPageUI == null ? PluginConfig.GUI.Items.PREVIOUS_PAGE.get() : previousPageUI) { setItem(previousPageSlot, new GUIItem(previousPageUI == null ? PluginConfig.GUI.Items.PREVIOUS_PAGE.get() : previousPageUI) {
@Override @Override
@@ -63,9 +63,12 @@ public class AutoPagedGUI extends CommonPagedGUI {
openGUI(user); openGUI(user);
} }
}); });
} else {
setItem(previousPageSlot, null);
}
} }
if (nextPageSlot >= 0) if (nextPageSlot >= 0) {
if (hasNextPage()) { if (hasNextPage()) {
setItem(nextPageSlot, new GUIItem(nextPageUI == null ? PluginConfig.GUI.Items.NEXT_PAGE.get() : nextPageUI) { setItem(nextPageSlot, new GUIItem(nextPageUI == null ? PluginConfig.GUI.Items.NEXT_PAGE.get() : nextPageUI) {
@Override @Override
@@ -79,6 +82,9 @@ public class AutoPagedGUI extends CommonPagedGUI {
openGUI(user); openGUI(user);
} }
}); });
} else {
setItem(nextPageSlot, null);
}
} }
super.openGUI(user); super.openGUI(user);