mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-02-03 17:11:20 +01:00
2.49.0
This commit is contained in:
parent
b738f9e30d
commit
c901c0d8dd
@ -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]));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user