mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 13:15:28 +01:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
bd64f94e13
@ -12,6 +12,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType.SlotType;
|
import org.bukkit.event.inventory.InventoryType.SlotType;
|
||||||
|
import org.bukkit.event.player.PlayerKickEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.event.server.PluginDisableEvent;
|
import org.bukkit.event.server.PluginDisableEvent;
|
||||||
import org.bukkit.inventory.InventoryView;
|
import org.bukkit.inventory.InventoryView;
|
||||||
@ -31,7 +32,8 @@ public class PanelListenerManager implements Listener {
|
|||||||
InventoryView view = event.getView();
|
InventoryView view = event.getView();
|
||||||
|
|
||||||
// Open the inventory panel that this player has open (they can only ever have one)
|
// Open the inventory panel that this player has open (they can only ever have one)
|
||||||
if (openPanels.containsKey(user.getUniqueId())) {
|
if (openPanels.containsKey(user.getUniqueId()) &&
|
||||||
|
openPanels.get(user.getUniqueId()).getInventory().equals(event.getClickedInventory())) {
|
||||||
// Cancel the event. If they don't want it to be cancelled then the click handler(s) should
|
// Cancel the event. If they don't want it to be cancelled then the click handler(s) should
|
||||||
// uncancel it. If gui was from our environment, then cancel event anyway.
|
// uncancel it. If gui was from our environment, then cancel event anyway.
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user