adjust default creation delay to 2 ticks, check if main thread b4 calling auction event

Took 3 minutes
This commit is contained in:
Kiran Hart 2023-02-14 13:37:29 -05:00
parent e3a41dd64c
commit 44eeaf4090
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 7 additions and 2 deletions

View File

@ -114,7 +114,12 @@ public final class AuctionCreator {
auctionItem.setListedWorld(seller.getWorld().getName());
AuctionStartEvent startEvent = new AuctionStartEvent(seller, auctionItem, listingFee);
Bukkit.getServer().getPluginManager().callEvent(startEvent);
if (Bukkit.isPrimaryThread())
Bukkit.getServer().getPluginManager().callEvent(startEvent);
else
Bukkit.getScheduler().runTask(AuctionHouse.getInstance(), () -> Bukkit.getServer().getPluginManager().callEvent(startEvent));
if (startEvent.isCancelled()) {
result.accept(auctionItem, EVENT_CANCELED);
return;

View File

@ -54,7 +54,7 @@ public class Settings {
* ===============================*/
public static final ConfigSetting DEFAULT_BIN_LISTING_TIME = new ConfigSetting(config, "auction setting.listings times.bin item", 86400, "The default listing time for bin items (buy only items) before they expire");
public static final ConfigSetting DEFAULT_AUCTION_LISTING_TIME = new ConfigSetting(config, "auction setting.listings times.auction item", 604800, "The default listing time for auction items before they expire");
public static final ConfigSetting INTERNAL_CREATE_DELAY = new ConfigSetting(config, "auction setting.internal create delay", 3, "How many ticks should auction house wait before actually creating the item.");
public static final ConfigSetting INTERNAL_CREATE_DELAY = new ConfigSetting(config, "auction setting.internal create delay", 2, "How many ticks should auction house wait before actually creating the item.");
public static final ConfigSetting MAX_AUCTION_PRICE = new ConfigSetting(config, "auction setting.pricing.max auction price", 1000000000, "The max price for buy only / buy now items");
public static final ConfigSetting MAX_AUCTION_START_PRICE = new ConfigSetting(config, "auction setting.pricing.max auction start price", 1000000000, "The max price starting a bidding auction");
public static final ConfigSetting MAX_AUCTION_INCREMENT_PRICE = new ConfigSetting(config, "auction setting.pricing.max auction increment price", 1000000000, "The max amount for incrementing a bid.");