mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2025-01-20 21:21:21 +01:00
use inventory holder for the close event
This commit is contained in:
parent
f87947c916
commit
7a0678ff45
@ -1,9 +1,7 @@
|
||||
package com.badbones69.crazyauctions.controllers;
|
||||
|
||||
import com.badbones69.crazyauctions.Methods;
|
||||
import com.badbones69.crazyauctions.api.enums.misc.Files;
|
||||
import com.badbones69.crazyauctions.api.guis.HolderManager;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import com.badbones69.crazyauctions.api.guis.types.transactions.BidMenu;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -13,10 +11,8 @@ public class MiscListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onInvClose(InventoryCloseEvent event) {
|
||||
FileConfiguration config = Files.config.getConfiguration();
|
||||
|
||||
Player player = (Player) event.getPlayer();
|
||||
|
||||
if (event.getView().getTitle().contains(Methods.strip(config.getString("Settings.Bidding-On-Item")))) HolderManager.removeBidding(player);
|
||||
if (event.getInventory().getHolder(false) instanceof BidMenu) HolderManager.removeBidding(player);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user