Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Florian CUNY 2019-06-14 10:23:06 +02:00
commit bd64f94e13

View File

@ -12,6 +12,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.inventory.InventoryView;
@ -31,7 +32,8 @@ public class PanelListenerManager implements Listener {
InventoryView view = event.getView();
// 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
// uncancel it. If gui was from our environment, then cancel event anyway.
event.setCancelled(true);