Fixes a bug in inventory clicking
Fixes a bug where players clicking items in their own inventory while a custom inventory is open triggers items in the custom inventory.
This commit is contained in:
parent
1aa33e87c5
commit
d839955808
@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
/**
|
||||
@ -36,7 +37,8 @@ public class GUIListener implements Listener {
|
||||
AbstractGUI gui = GUIRegistry.getOpenGUI(player);
|
||||
|
||||
//Not our GUI
|
||||
if (gui == null) {
|
||||
if (gui == null || event.getClickedInventory() == null ||
|
||||
event.getClickedInventory().getType() == InventoryType.PLAYER) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user