make shop id a UUID

This commit is contained in:
Len 2022-08-13 16:10:10 +02:00
parent cf4431326e
commit 819cbdcd93

View File

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