diff --git a/paper/src/main/java/com/badbones69/crazyauctions/api/enums/misc/Keys.java b/paper/src/main/java/com/badbones69/crazyauctions/api/enums/misc/Keys.java index cc68970..bf1b3bf 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/api/enums/misc/Keys.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/api/enums/misc/Keys.java @@ -17,6 +17,8 @@ public enum Keys { // any button in the gui auction_button("auction_button", PersistentDataType.STRING), + auction_uuid("auction_uuid", PersistentDataType.STRING), + // contains the auction item price auction_price("auction_price", PersistentDataType.INTEGER); diff --git a/paper/src/main/java/com/badbones69/crazyauctions/api/guis/types/AuctionsMenu.java b/paper/src/main/java/com/badbones69/crazyauctions/api/guis/types/AuctionsMenu.java index b593000..0d7408a 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/api/guis/types/AuctionsMenu.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/api/guis/types/AuctionsMenu.java @@ -265,7 +265,11 @@ public class AuctionsMenu extends Holder { final UUID uuid = player.getUniqueId(); - final AuctionItem auction = this.userManager.getAuctionItemById(uuid, container.getOrDefault(Keys.auction_store_id.getNamespacedKey(), PersistentDataType.STRING, "")); + final String target_uuid = container.getOrDefault(Keys.auction_uuid.getNamespacedKey(), PersistentDataType.STRING, ""); + + if (target_uuid.isEmpty()) return; + + final AuctionItem auction = this.userManager.getAuctionItemById(UUID.fromString(target_uuid), container.getOrDefault(Keys.auction_store_id.getNamespacedKey(), PersistentDataType.STRING, "")); if (auction == null) return; diff --git a/paper/src/main/java/com/badbones69/crazyauctions/tasks/objects/AuctionItem.java b/paper/src/main/java/com/badbones69/crazyauctions/tasks/objects/AuctionItem.java index 0ffda54..b9b223c 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/tasks/objects/AuctionItem.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/tasks/objects/AuctionItem.java @@ -169,7 +169,8 @@ public class AuctionItem { itemBuilder.setLore(lore) .addString(this.id, Keys.auction_number.getNamespacedKey()) - .addString(getStoreID(), Keys.auction_store_id.getNamespacedKey()); + .addString(getStoreID(), Keys.auction_store_id.getNamespacedKey()) + .addString(this.uuid.toString(), Keys.auction_uuid.getNamespacedKey()); return itemBuilder; }