From 819cbdcd938b7ca8e0c465f5179320cc18b09ede Mon Sep 17 00:00:00 2001 From: Len <40720638+destro174@users.noreply.github.com> Date: Sat, 13 Aug 2022 16:10:10 +0200 Subject: [PATCH] make shop id a UUID --- src/main/java/com/alttd/playershops/shop/PlayerShop.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/alttd/playershops/shop/PlayerShop.java b/src/main/java/com/alttd/playershops/shop/PlayerShop.java index e932556..c7a8ec3 100644 --- a/src/main/java/com/alttd/playershops/shop/PlayerShop.java +++ b/src/main/java/com/alttd/playershops/shop/PlayerShop.java @@ -21,7 +21,7 @@ import java.util.UUID; public class PlayerShop { @Getter - private int id; + private UUID shopID; @Getter @Setter // TODO a way to check if the player changed name and update if needed private String ownerName; @Getter @@ -50,6 +50,7 @@ public class PlayerShop { } public PlayerShop(Location shopLocation, Location signLocation, UUID uuid, String playerName) { + this.shopID = UUID.randomUUID(); this.shopLocation = shopLocation; this.signLocation = signLocation; this.ownerUUID = uuid; @@ -57,12 +58,12 @@ public class PlayerShop { updateSign(); } - public static PlayerShop create(int id, String ownerName, UUID ownerUUID, ShopType shopType, String server, + public static PlayerShop create(UUID shopID, String ownerName, UUID ownerUUID, ShopType shopType, String server, Location shopLocation, Location signLocation, double price, int amount, double balance, ItemStack item, long lastTransaction) { PlayerShop playerShop = new PlayerShop(shopLocation, signLocation, ownerUUID, ownerName); - playerShop.id = id; + playerShop.shopID = shopID; playerShop.type = shopType; playerShop.server = server; playerShop.price = price;