From 416003b410f06ce02c9a7eceacfcac7e15725998 Mon Sep 17 00:00:00 2001 From: Kiran Hart Date: Thu, 1 Dec 2022 22:31:53 -0500 Subject: [PATCH] closes #23 and #22 Took 5 minutes --- pom.xml | 2 +- .../tweetzy/auctionhouse/guis/GUIBundleCreation.java | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 4fdd067..cfc6e07 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ AuctionHouse The ultimate auction solution for your server - 2.80.1 + 2.80.2 jar diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/GUIBundleCreation.java b/src/main/java/ca/tweetzy/auctionhouse/guis/GUIBundleCreation.java index 551af95..fcc3f7e 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/GUIBundleCreation.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/GUIBundleCreation.java @@ -32,12 +32,10 @@ import ca.tweetzy.core.compatibility.XMaterial; import ca.tweetzy.core.utils.PlayerUtils; import ca.tweetzy.core.utils.nms.NBTEditor; import org.bukkit.ChatColor; +import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; /** @@ -62,9 +60,7 @@ public final class GUIBundleCreation extends AbstractPlaceholderGui { for (int i = 0; i < 45; i++) setItem(i, XMaterial.AIR.parseItem()); - setActionForRange(45, 53, e -> { - e.event.setCancelled(true); - }); + Arrays.asList(45, 46, 47, 48, 49,50, 51, 52, 53).forEach(i -> setAction(i, e -> e.event.setCancelled(true))); setOnClose(close -> { for (int i = 0; i < 45; i++) { @@ -74,7 +70,7 @@ public final class GUIBundleCreation extends AbstractPlaceholderGui { } }); - setButton(49, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CREATE_BUNDLE_CONFIRM_ITEM.getString(), Settings.GUI_CREATE_BUNDLE_CONFIRM_NAME.getString(), Settings.GUI_CREATE_BUNDLE_CONFIRM_LORE.getStringList(), new HashMap<>()), e -> { + setButton(getRows() - 1, 4, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_CREATE_BUNDLE_CONFIRM_ITEM.getString(), Settings.GUI_CREATE_BUNDLE_CONFIRM_NAME.getString(), Settings.GUI_CREATE_BUNDLE_CONFIRM_LORE.getStringList(), new HashMap<>()), ClickType.LEFT, e -> { ItemStack firstItem = null; List validItems = new ArrayList<>();