This commit is contained in:
Kiran Hart 2022-01-07 11:39:56 -05:00
parent b738f9e30d
commit c901c0d8dd

View File

@ -45,6 +45,8 @@ public final class GUIBundleCreation extends Gui {
ItemStack firstItem = null;
List<ItemStack> validItems = new ArrayList<>();
boolean containsBundle = false;
for (int i = 0; i < 44; i++) {
final ItemStack item = getItem(i);
if (item == null || item.getType() == XMaterial.AIR.parseMaterial()) continue;
@ -86,8 +88,8 @@ public final class GUIBundleCreation extends Gui {
}
if (NBTEditor.contains(item, "AuctionBundleItem")) {
AuctionHouse.getInstance().getLocale().getMessage("general.cannotsellbundleditem").sendPrefixedMessage(e.player);
blocked = true;
containsBundle = true;
}
if (blocked) continue;
@ -104,6 +106,11 @@ public final class GUIBundleCreation extends Gui {
return;
}
if (containsBundle) {
AuctionHouse.getInstance().getLocale().getMessage("general.cannotsellbundleditem").sendPrefixedMessage(e.player);
return;
}
if (validItems.size() == 0) return;
final ItemStack bundle = AuctionAPI.getInstance().createBundledItem(firstItem, validItems.toArray(new ItemStack[0]));