clear cache on quit

This commit is contained in:
Ryder Belserion 2024-10-11 20:05:02 -04:00
parent 81149facc4
commit a74d063392
No known key found for this signature in database

View File

@ -6,13 +6,25 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerQuitEvent;
public class MiscListener implements Listener {
@EventHandler
public void onInvClose(InventoryCloseEvent event) {
public void onInventoryClose(InventoryCloseEvent event) {
Player player = (Player) event.getPlayer();
if (event.getInventory().getHolder(false) instanceof BidMenu) HolderManager.removeBidding(player);
}
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
HolderManager.removeBidding(player);
HolderManager.removeId(player);
HolderManager.removeShopCategory(player);
HolderManager.removeShopType(player);
HolderManager.removePage(player);
}
}