[build] only update the data.yml if the value is not a uuid

This commit is contained in:
Ryder Belserion 2024-06-16 22:12:24 -04:00
parent 8cfe439830
commit 8cbf7e553f
No known key found for this signature in database
3 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,2 @@
### Changes:
- Migrated `data.yml` to use uuids instead of player names. Existing data.yml should migrate to this format.
### Fixed:
- Bid now button wasn't using the value from the `config.yml`
- Only update the data.yml if the value is not a uuid

View File

@ -7,7 +7,7 @@ plugins {
val buildNumber: String? = System.getenv("BUILD_NUMBER")
rootProject.version = if (buildNumber != null) "1.4.3-$buildNumber" else "1.4.3"
rootProject.version = if (buildNumber != null) "1.4.4-$buildNumber" else "1.4.4"
val isSnapshot = false

View File

@ -96,9 +96,11 @@ public class CrazyAuctions extends JavaPlugin {
if (uuid != null) {
OfflinePlayer player = Methods.getOfflinePlayer(uuid);
configuration.set("Items." + key + ".Seller", player.getUniqueId().toString());
if (!uuid.equals(player.getUniqueId().toString())) {
configuration.set("Items." + key + ".Seller", player.getUniqueId().toString());
FileManager.Files.DATA.saveFile();
FileManager.Files.DATA.saveFile();
}
}
final String bidder = configuration.getString("Items." + key + ".TopBidder");
@ -106,9 +108,11 @@ public class CrazyAuctions extends JavaPlugin {
if (bidder != null && !bidder.equals("None")) {
OfflinePlayer player = Methods.getOfflinePlayer(bidder);
configuration.set("Items." + key + ".TopBidder", player.getUniqueId().toString());
if (!bidder.equals(player.getUniqueId().toString())) {
configuration.set("Items." + key + ".TopBidder", player.getUniqueId().toString());
FileManager.Files.DATA.saveFile();
FileManager.Files.DATA.saveFile();
}
}
}
}