add target uuid key

This commit is contained in:
Ryder Belserion 2024-10-31 11:33:44 -04:00
parent 3f52824e5b
commit d7e3f775d6
No known key found for this signature in database
3 changed files with 9 additions and 2 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;
}