update auction caches on start/reload

This commit is contained in:
Ryder Belserion 2024-10-13 17:05:08 -04:00
parent 52f3ee62b9
commit d205cdb500
No known key found for this signature in database
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,8 @@ import com.ryderbelserion.vital.paper.util.scheduler.FoliaRunnable;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.PluginCommand;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
@ -54,6 +56,7 @@ public class CrazyAuctions extends Vital {
InventoryManager.loadButtons();
this.userManager = new UserManager();
this.userManager.updateAuctionsCache();
this.crazyManager = new CrazyManager();

View File

@ -88,6 +88,12 @@ public class AuctionCommand implements CommandExecutor {
this.fileManager.reloadFiles().init();
// update it again!
this.plugin.getUserManager().updateAuctionsCache();
//todo() close inventories by tracking viewers, so the cache can be updated than re-open their inventories
//todo() we need to track the specific inventory they opened, and if it's for them or another player
this.crazyManager.load();
InventoryManager.loadButtons();