Save Name (Performance)

Save the names to file instead of having to do heavy operations each time to load the data.
This commit is contained in:
TrueDarkLord 2024-12-28 12:17:33 -07:00
parent aee0169d61
commit 8ab0fafd62
No known key found for this signature in database
GPG Key ID: 02AA15A3B1FAFE4F
2 changed files with 3 additions and 0 deletions

View File

@ -327,6 +327,7 @@ public class AuctionCommand implements CommandExecutor {
for (; data.contains("Items." + num); num++) ;
data.set("Items." + num + ".Price", price);
data.set("Items." + num + ".Seller", seller);
data.set("Items." + num + ".SellerName", player.getName());
if (args[0].equalsIgnoreCase("bid")) {
data.set("Items." + num + ".Time-Till-Expire", Methods.convertToMill(config.getString("Settings.Bid-Time", "2m 30s")));
@ -356,6 +357,7 @@ public class AuctionCommand implements CommandExecutor {
}
data.set("Items." + num + ".TopBidder", "None");
data.set("Items." + num + ".TopBidderName", "None");
ItemStack stack = item.clone();
stack.setAmount(amount);

View File

@ -816,6 +816,7 @@ public class GuiListener implements Listener {
data.set("Items." + ID + ".Price", bid);
data.set("Items." + ID + ".TopBidder", player.getUniqueId().toString());
data.set("Items." + ID + ".TopBidderName", player.getName());
Map<String, String> placeholders = new HashMap<>();
placeholders.put("%Bid%", bid + "");