1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Improved Guide Search

This commit is contained in:
TheBusyBiscuit 2019-10-17 01:27:00 +02:00
parent a5d0c751d5
commit f71b925a41

View File

@ -808,7 +808,8 @@ public final class SlimefunGuide {
private static void addBackButton(ChestMenu menu, int slot, PlayerProfile profile, boolean book, boolean cheat) { private static void addBackButton(ChestMenu menu, int slot, PlayerProfile profile, boolean book, boolean cheat) {
List<Object> playerHistory = profile.getGuideHistory(); List<Object> playerHistory = profile.getGuideHistory();
if (!playerHistory.isEmpty()) {
if (playerHistory.size() > 1) {
menu.addItem(slot, new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), menu.addItem(slot, new CustomItem(new ItemStack(Material.ENCHANTED_BOOK),
"&7\u21E6 Back", "", "&7\u21E6 Back", "",
@ -921,7 +922,7 @@ public final class SlimefunGuide {
history.add(sfItem != null ? sfItem: item); history.add(sfItem != null ? sfItem: item);
} }
if (history != null && history.size() > 1) { if (history.size() > 1) {
menu.addItem(0, new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&7\u21E6 Back", "", "&rLeft Click: &7Go back to previous Page", "&rShift + left Click: &7Go back to Main Menu")); menu.addItem(0, new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&7\u21E6 Back", "", "&rLeft Click: &7Go back to previous Page", "&rShift + left Click: &7Go back to Main Menu"));
menu.addMenuClickHandler(0, (pl, slot, itemstack, action) -> { menu.addMenuClickHandler(0, (pl, slot, itemstack, action) -> {
if (action.isShiftClicked()) openMainMenuAsync(p, true, book, 1); if (action.isShiftClicked()) openMainMenuAsync(p, true, book, 1);