From be5d7ef4a62b17290c356810230a5e25027f053f Mon Sep 17 00:00:00 2001 From: Kiran Hart Date: Fri, 28 Oct 2022 15:10:00 -0400 Subject: [PATCH] GUISellListingType listingtype callback used in placeitem gui Took 40 minutes --- .../auctionhouse/guis/sell/GUISellListingType.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/sell/GUISellListingType.java b/src/main/java/ca/tweetzy/auctionhouse/guis/sell/GUISellListingType.java index ec31dbc..4e7dc43 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/sell/GUISellListingType.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/sell/GUISellListingType.java @@ -62,7 +62,11 @@ public final class GUISellListingType extends AbstractPlaceholderGui { .of(Objects.requireNonNull(Settings.GUI_SELL_LISTING_TYPE_ITEMS_AUCTION_ITEM.getMaterial().parseItem())) .name(Settings.GUI_SELL_LISTING_TYPE_ITEMS_AUCTION_NAME.getString()) .lore(Settings.GUI_SELL_LISTING_TYPE_ITEMS_AUCTION_LORE.getStringList()) - .make(), click -> this.listingType.accept(ListingType.AUCTION)); + .make(), click -> { + + if (this.listingType != null) + this.listingType.accept(ListingType.AUCTION); + }); } private void drawBinButton(int col) { @@ -70,6 +74,10 @@ public final class GUISellListingType extends AbstractPlaceholderGui { .of(Objects.requireNonNull(Settings.GUI_SELL_LISTING_TYPE_ITEMS_BIN_ITEM.getMaterial().parseItem())) .name(Settings.GUI_SELL_LISTING_TYPE_ITEMS_BIN_NAME.getString()) .lore(Settings.GUI_SELL_LISTING_TYPE_ITEMS_BIN_LORE.getStringList()) - .make(), click -> this.listingType.accept(ListingType.BIN)); + .make(), click -> { + + if (this.listingType != null) + this.listingType.accept(ListingType.BIN); + }); } }