diff --git a/paper/src/main/java/com/badbones69/crazyauctions/controllers/MiscListener.java b/paper/src/main/java/com/badbones69/crazyauctions/controllers/MiscListener.java index a97475e..70d9c27 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/controllers/MiscListener.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/controllers/MiscListener.java @@ -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); + } } \ No newline at end of file