From c5f63c4dbf3c0bf0beddba59c7f162b8bb4a4456 Mon Sep 17 00:00:00 2001 From: AfkF24 Date: Sun, 14 Jan 2024 03:53:04 +0100 Subject: [PATCH] Set back button to correct slot if GUI trim is off --- .../com/leonardobishop/quests/bukkit/menu/PaginatedQMenu.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/PaginatedQMenu.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/PaginatedQMenu.java index 8f0f9b272..76d3bacb3 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/PaginatedQMenu.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/menu/PaginatedQMenu.java @@ -141,7 +141,8 @@ public void populate(String customElementsPath, List menuElementsTo // else find a place for the back button if needed } else if (backMenuElement != null && backMenuElement.isEnabled()) { - int slot = MenuUtils.getHigherOrEqualMultiple(menuElements.size() + menuElementsToFill.size() + customStaticElements, 9); + int slot = trim ? MenuUtils.getHigherOrEqualMultiple(menuElements.size() + menuElementsToFill.size() + customStaticElements, 9) + : backMenuElement.getSlot(); // place the back button at the defined slot staticMenuElements[slot] = backMenuElement; }